Geminstaller C0 Coverage Information - RCov

lib/geminstaller/source_index_search_adapter.rb

Name Total Lines Lines of Code Total Coverage Code Coverage
lib/geminstaller/source_index_search_adapter.rb 49 39
87.76%
84.62%

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 SourceIndexSearchAdapter
3     attr_writer :gem_source_index_proxy
4     
5     def all_local_specs
6       if GemInstaller::RubyGemsVersionChecker.matches?('<=0.9.4')
7         search_less_than_or_equal_0_9_4('',GemInstaller::RubyGem.default_version)
8       else
9         dependency = Gem::Dependency.new('', GemInstaller::RubyGem.default_version)
10         @gem_source_index_proxy.refresh!
11         @gem_source_index_proxy.search(dependency, false)
12       end
13     end
14 
15     def search(gem, version_requirement, platform_only = false)
16       if GemInstaller::RubyGemsVersionChecker.matches?('<=0.9.4')
17         gem_pattern = /^#{gem.regexp_escaped_name}$/
18         search_less_than_or_equal_0_9_4(gem_pattern, version_requirement)
19       else
20         search_greater_than_0_9_4(gem, version_requirement, platform_only)
21       end
22     end
23     
24     def search_less_than_or_equal_0_9_4(gem_pattern, version_requirement)
25       @gem_source_index_proxy.refresh!
26       @gem_source_index_proxy.search(gem_pattern, version_requirement)
27     end
28     
29     def search_greater_than_0_9_4(gem, version_requirement, platform_only = false)
30       dependency = nil
31       begin
32         dependency = Gem::Dependency.new(gem.name, version_requirement)
33       rescue => e
34         msg = "Rubygems failed to parse gem: name='#{gem.name}', version='#{version_requirement}'.  Original Error:\n" +
35               "  #{e.inspect}\n" +
36               "If you are having problems with prerelease gems or non-numeric versions, please upgrade to the latest Rubygems."
37         raise GemInstaller::GemInstallerError.new(msg)
38       end
39       @gem_source_index_proxy.refresh!
40       @gem_source_index_proxy.search(dependency, platform_only)
41     end
42 
43   end
44 end
45 
46 
47 
48 
49 

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