Geminstaller C0 Coverage Information - RCov

lib/geminstaller/config.rb

Name Total Lines Lines of Code Total Coverage Code Coverage
lib/geminstaller/config.rb 68 57
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 Config
3     def initialize(yaml)
4       @yaml = yaml
5       @default_install_options_string = nil
6     end
7 
8     def gems
9       parse_defaults
10       gem_defs = @yaml["gems"]
11       gems = []
12       gem_defs.each do |gem_def|
13         name = gem_def['name']
14         version = gem_def['version'].to_s
15         platform = gem_def['platform'].to_s
16         # get install_options for specific gem, if specified
17         install_options_string = gem_def['install_options'].to_s
18         # if no install_options were specified for specific gem, and default install_options were specified...
19         if install_options_string.empty? &&
20            !@default_install_options_string.nil? && 
21            !@default_install_options_string.empty? then
22           # then use the default install_options
23           install_options_string = @default_install_options_string
24         end
25         install_options_array = []
26         # if there was an install options string specified, default or gem-specific, parse it to an array
27         install_options_array = install_options_string.split(" ") unless install_options_string.empty?
28 
29         check_for_upgrade = gem_def['check_for_upgrade']
30         if check_for_upgrade.nil? && defined? @default_check_for_upgrade then
31           check_for_upgrade = @default_check_for_upgrade
32         end
33 
34         fix_dependencies = gem_def['fix_dependencies']
35         if fix_dependencies.nil? && defined? @default_fix_dependencies then
36           fix_dependencies = @default_fix_dependencies
37         end
38 
39         no_autogem = gem_def['no_autogem']
40         if no_autogem.nil? && defined? @default_no_autogem then
41           no_autogem = @default_no_autogem
42         end
43 
44         gem = GemInstaller::RubyGem.new(
45           name, 
46           :version => version, 
47           :platform => platform, 
48           :install_options => install_options_array, 
49           :check_for_upgrade => check_for_upgrade,
50           :no_autogem => no_autogem,
51           :fix_dependencies => fix_dependencies)
52         gems << gem
53       end
54       return gems
55     end
56 
57     protected
58 
59     def parse_defaults
60       defaults = @yaml["defaults"]
61       return if defaults.nil?
62       @default_install_options_string = defaults['install_options']
63       @default_check_for_upgrade = defaults['check_for_upgrade']
64       @default_fix_dependencies = defaults['fix_dependencies']
65       @default_no_autogem = defaults['no_autogem']
66     end
67   end
68 end

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