method
load_and_instantiate
v2_1_10 -
Show latest stable
-
0 notes -
Class: CommandManager
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125 (0)
- 1_9_3_392 (0)
- 2_1_10 (0)
- 2_2_9 (0)
- 2_4_6 (0)
- 2_5_5 (0)
- 2_6_3 (0)
- What's this?
load_and_instantiate(command_name)
private
Hide source
# File lib/rubygems/command_manager.rb, line 196 def load_and_instantiate(command_name) command_name = command_name.to_s const_name = command_name.capitalize.gsub(/_(.)/) { $1.upcase } << "Command" load_error = nil begin begin require "rubygems/commands/#{command_name}_command" rescue LoadError => e load_error = e end Gem::Commands.const_get(const_name).new rescue Exception => e e = load_error if load_error alert_error "Loading command: #{command_name} (#{e.class})\n\t#{e}" ui.backtrace e end end