Geminstaller C0 Coverage Information - RCov

lib/geminstaller/autogem.rb

Name Total Lines Lines of Code Total Coverage Code Coverage
lib/geminstaller/autogem.rb 48 45
79.17%
77.78%

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 Autogem
3     attr_writer :gem_command_manager, :gem_source_index_proxy
4     def autogem(gems)
5       @gem_source_index_proxy.refresh!
6       # REALLY refresh - refreshing the source_index directly isn't enough.
7       Gem.refresh
8       @completed_names = []
9       @completed_gems = []
10       gems.each do |gem|
11         process_gem(gem)
12       end
13       @completed_gems
14     end
15     
16     def process_gem(gem)
17       name = gem.name
18       version = gem.version
19       unless @completed_names.index(name) or gem.no_autogem
20         begin
21           invoke_require_gem_command(name, version)
22         rescue Gem::LoadError => load_error
23           load_error_message = load_error.message
24           load_error_message.strip!
25           error_message = "Error: GemInstaller attempted to load gem '#{name}', version '#{version}', but that version is not installed.  Use GemInstaller to install the gem.  Original Gem::LoadError was: '#{load_error_message}'"
26           raise GemInstaller::GemInstallerError.new(error_message)
27         end
28         @completed_names << name
29         @completed_gems << gem
30       end
31     end
32     
33     def invoke_require_gem_command(name, version)
34       if GemInstaller::RubyGemsVersionChecker.matches?('< 0.9')
35         require_gem(name, version)
36       else
37         begin
38           result = gem(name, version)
39         rescue Gem::Exception => e
40           exception_message = e.message
41           exception_message.strip!
42           error_message = "Error: GemInstaller failed to activate gem '#{name}', version '#{version}'.  This may be because GemInstaller processes gems in order (was alphabetical prior to 0.5.0), and an earlier gem in your geminstaller.yml config already activated another version.  Use the 'gem dependency [-R]' command to track this down, and reorder/edit your config as necessary.  Original Gem::Exception was: '#{exception_message}'"
43           raise GemInstaller::GemInstallerError.new(error_message)
44         end
45       end
46     end
47   end
48 end

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