Geminstaller C0 Coverage Information - RCov

lib/geminstaller/gem_arg_processor.rb

Name Total Lines Lines of Code Total Coverage Code Coverage
lib/geminstaller/gem_arg_processor.rb 44 29
100.00%
100.00%

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 module GemInstaller
2   class GemArgProcessor
3     #Common Options:
4     #      --source URL                 Use URL as the remote source for gems
5     #  -p, --[no-]http-proxy [URL]      Use HTTP proxy for remote operations
6     #  -h, --help                       Get help on this command
7     #  -v, --verbose                    Set the verbose level of output
8     #      --config-file FILE           Use this config file instead of default
9     #      --backtrace                  Show stack backtrace on errors
10     #      --debug                      Turn on Ruby debugging
11     GEM_COMMON_OPTIONS_WITHOUT_ARG = ['--no-http-proxy','-v','--verbose','--backtrace','--debug']
12     GEM_COMMON_OPTIONS_WITH_ARG = ['--source','-p','--http_proxy','--config-file']
13     
14     # take an array of args, and strip all args that are not common gem command args
15     def strip_non_common_gem_args(args)
16       # I can't figure out a way to elegantly do this, so I hardcoded the options.  Here's how you print them
17       # Gem::Command.common_options.each do |option|
18       #  p option[0]
19       # end
20 
21       common_args = [] 
22       i = 0
23       loop do
24         break if i == args.size
25         arg = args[i]
26         if GEM_COMMON_OPTIONS_WITHOUT_ARG.include?(arg)
27           common_args << arg
28         else
29           GEM_COMMON_OPTIONS_WITH_ARG.each do |option|
30             if arg.include?(option)
31               common_args << arg
32               unless arg.include?('=')
33                 i += 1
34                 common_args << args[i]
35               end
36             end
37           end
38         end
39         i += 1
40       end
41       common_args
42     end
43   end
44 end

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