Geminstaller C0 Coverage Information - RCov

lib/geminstaller/version_specifier.rb

Name Total Lines Lines of Code Total Coverage Code Coverage
lib/geminstaller/version_specifier.rb 25 23
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 VersionSpecifier
3     # NOTE: available_versions should be sorted in descending order (highest versions first)
4     # This method will return the first matching version
5     def specify(version_requirement, available_versions, gem_name = nil)
6       rubygems_version_requirement = GemInstaller::REQUIREMENT_CLASS.new [version_requirement]
7       if available_versions.respond_to? :to_str
8         available_versions = available_versions.split(', ')
9       end
10       available_versions.each do |available_version_string|
11         available_version_string_without_platforms = available_version_string.split(' ').first
12         available_version = Gem::Version.new(available_version_string_without_platforms)
13         if rubygems_version_requirement.satisfied_by?(available_version)
14           return available_version.to_s
15         end
16       end
17       gem_name_msg = ''
18       if gem_name
19         gem_name_msg = "for gem '#{gem_name}' "
20       end
21       error_msg = "The specified version requirement '#{version_requirement}' #{gem_name_msg}is not met by any of the available versions: #{available_versions.join(', ')}."
22       raise GemInstaller::GemInstallerError.new(error_msg)
23     end
24   end
25 end

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