instance method
Gem::CommandManager#load_and_instantiate
load_and_instantiate(command_name)
lib/rubygems/command_manager.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/rubygems/command_manager.rb, line 229
def load_and_instantiate(command_name)
command_name = command_name.to_s
const_name = command_name.capitalize.gsub(/_(.)/) { $1.upcase } << "Command"
begin
begin
require "rubygems/commands/#{command_name}_command"
rescue LoadError
# it may have been defined from a rubygems_plugin.rb file
end
Gem::Commands.const_get(const_name).new
rescue StandardError => e
alert_error clean_text("Loading command: #{command_name} (#{e.class})\n\t#{e}")
ui.backtrace e
end
end
No documentation available
See also
#invoke_command
#process_args
#instance
#register_command
also in
4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0