Flowdock
method

load_and_instantiate

Importance_0
Ruby latest stable (v1_9_3_392) - 0 notes - Class: CommandManager
load_and_instantiate(command_name) private

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/rubygems/command_manager.rb, line 170
  def load_and_instantiate(command_name)
    command_name = command_name.to_s
    const_name = command_name.capitalize.gsub(/_(.)/) { $1.upcase } << "Command"
    commands = Gem::Commands
    retried = false

    begin
      commands.const_get(const_name).new
    rescue NameError
      raise if retried

      retried = true
      begin
        require "rubygems/commands/#{command_name}_command"
      rescue Exception => e
        alert_error "Loading command: #{command_name} (#{e.class})\n    #{e}"
        ui.errs.puts "\t#{e.backtrace.join "\n\t"}" if
          Gem.configuration.backtrace
      end
      retry
    end
  end
Register or log in to add new notes.