Geminstaller C0 Coverage Information - RCov

lib/geminstaller/missing_dependency_finder.rb

Name Total Lines Lines of Code Total Coverage Code Coverage
lib/geminstaller/missing_dependency_finder.rb 46 38
13.04%
13.16%

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 MissingDependencyFinder
3     attr_writer :gem_command_manager, :gem_spec_manager, :gem_arg_processor, :output_filter
4     def find(dependent_gem)
5       if GemInstaller::RubyGemsVersionChecker.matches?('>=0.9.5')
6         # missing_dependency_finder is not used for RubyGems >= 0.9.5
7         raise RuntimeError.new("Internal GemInstaller Error: MissingDependencyFinder should not be used for RubyGems >= 0.9.5")
8       end
9       
10       # NOTE: this doesn't resolve platforms, there's currently no way to know what
11       # platform should be selected for a dependency gem.  Best-effort handling
12       # of ambiguous platforms on dependency gems will be handled elsewhere
13       matching_dependent_gems = @gem_spec_manager.local_matching_gems(dependent_gem)
14       missing_dependencies = []
15       install_options = dependent_gem.install_options
16       add_include_dependency_option(install_options)
17       common_args = @gem_arg_processor.strip_non_common_gem_args(install_options)
18       matching_dependent_gems.each do |matching_dependent_gem|
19         message_already_printed = false
20         dependency_gems = @gem_command_manager.dependency(matching_dependent_gem.name, matching_dependent_gem.version.to_s, common_args)
21         dependency_gems.each do |dependency_gem|
22           dependency_gem.install_options = install_options
23           local_matching_dependency_gems = @gem_spec_manager.local_matching_gems(dependency_gem, false)
24           unless local_matching_dependency_gems.size > 0
25             unless message_already_printed
26               @output_filter.geminstaller_output(:info, "Missing dependencies found for #{matching_dependent_gem.name} (#{matching_dependent_gem.version}):\n")
27               message_already_printed = true
28             end
29             # TODO: print install options too?
30             @output_filter.geminstaller_output(:info, "  #{dependency_gem.name} (#{dependency_gem.version})\n")
31             missing_dependencies << dependency_gem
32           end        
33           # recurse to find any missing dependencies in the tree
34           sub_dependencies = find(dependency_gem)
35           missing_dependencies += sub_dependencies if sub_dependencies.size > 0 
36         end
37       end
38       return missing_dependencies
39     end
40     
41     def add_include_dependency_option(install_options)
42       return if install_options.index('-y') or install_options.index('--include-dependencies')
43       install_options << '--include-dependencies'
44     end
45   end
46 end

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