Geminstaller C0 Coverage Information - RCov

spec/fixture/rubygems_dist/rubygems-trunk/lib/rubygems/gem_runner.rb

Name Total Lines Lines of Code Total Coverage Code Coverage
spec/fixture/rubygems_dist/rubygems-trunk/lib/rubygems/gem_runner.rb 78 44
91.03%
90.91%

Key

Code reported as executed by Ruby looks like this...and this: this line is also marked as covered.Lines considered as run by rcov, but not reported by Ruby, look like this,and this: these lines were inferred by rcov (using simple heuristics).Finally, here's a line marked as not executed.

Coverage Details

1 #--
2 # Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
3 # All rights reserved.
4 # See LICENSE.txt for permissions.
5 #++
6 
7 require 'rubygems/command_manager'
8 require 'rubygems/config_file'
9 require 'rubygems/doc_manager'
10 
11 ##
12 # Run an instance of the gem program.
13 #
14 # Gem::GemRunner is only intended for internal use by RubyGems itself.  It
15 # does not form any public API and may change at any time for any reason.
16 #
17 # If you would like to duplicate functionality of `gem` commands, use the
18 # classes they call directly.
19 
20 class Gem::GemRunner
21 
22   def initialize(options={})
23     @command_manager_class = options[:command_manager] || Gem::CommandManager
24     @config_file_class = options[:config_file] || Gem::ConfigFile
25     @doc_manager_class = options[:doc_manager] || Gem::DocManager
26   end
27 
28   ##
29   # Run the gem command with the following arguments.
30 
31   def run(args)
32     start_time = Time.now
33 
34     if args.include?('--')
35       # We need to preserve the original ARGV to use for passing gem options
36       # to source gems.  If there is a -- in the line, strip all options after
37       # it...its for the source building process.
38       build_args = args[args.index("--") + 1...args.length]
39       args = args[0...args.index("--")]
40     end
41 
42     Gem::Command.build_args = build_args if build_args
43 
44     do_configuration args
45     cmd = @command_manager_class.instance
46 
47     cmd.command_names.each do |command_name|
48       config_args = Gem.configuration[command_name]
49       config_args = case config_args
50                     when String
51                       config_args.split ' '
52                     else
53                       Array(config_args)
54                     end
55       Gem::Command.add_specific_extra_args command_name, config_args
56     end
57 
58     cmd.run Gem.configuration.args
59     end_time = Time.now
60 
61     if Gem.configuration.benchmark then
62       printf "\nExecution time: %0.2f seconds.\n", end_time - start_time
63       puts "Press Enter to finish"
64       STDIN.gets
65     end
66   end
67 
68   private
69 
70   def do_configuration(args)
71     Gem.configuration = @config_file_class.new(args)
72     Gem.use_paths(Gem.configuration[:gemhome], Gem.configuration[:gempath])
73     Gem::Command.extra_args = Gem.configuration[:gem]
74     @doc_manager_class.configured_args = Gem.configuration[:rdoc]
75   end
76 
77 end
78 

Generated on Mon May 10 23:40:28 -0700 2010 with rcov 0.9.8