Class Gem::GemRunner
In: lib/rubygems/gem_runner.rb
Parent: Object

Run an instance of the gem program.

Methods

new   run  

Public Class methods

[Source]

    # File lib/rubygems/gem_runner.rb, line 18
18:     def initialize(options={})
19:       @command_manager_class = options[:command_manager] || Gem::CommandManager
20:       @config_file_class = options[:config_file] || Gem::ConfigFile
21:       @doc_manager_class = options[:doc_manager] || Gem::DocManager
22:     end

Public Instance methods

Run the gem command with the following arguments.

[Source]

    # File lib/rubygems/gem_runner.rb, line 25
25:     def run(args)
26:       start_time = Time.now
27:       do_configuration(args)
28:       cmd = @command_manager_class.instance
29:       cmd.command_names.each do |command_name|
30:         config_args = Gem.configuration[command_name]
31:         config_args = case config_args
32:                       when String
33:                         config_args.split ' '
34:                       else
35:                         Array(config_args)
36:                       end
37:         Command.add_specific_extra_args command_name, config_args
38:       end
39:       cmd.run(Gem.configuration.args)
40:       end_time = Time.now
41:       if Gem.configuration.benchmark 
42:         printf "\nExecution time: %0.2f seconds.\n", end_time-start_time
43:         puts "Press Enter to finish"
44:         STDIN.gets
45:       end
46:     end

[Validate]