Geminstaller C0 Coverage Information - RCov

spec/fixture/rubygems_dist/rubygems-trunk/lib/rubygems/ext/builder.rb

Name Total Lines Lines of Code Total Coverage Code Coverage
spec/fixture/rubygems_dist/rubygems-trunk/lib/rubygems/ext/builder.rb 54 36
33.33%
19.44%

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 #--
2 # Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
3 # All rights reserved.
4 # See LICENSE.txt for permissions.
5 #++
6 
7 class Gem::Ext::Builder
8 
9   def self.class_name
10     name =~ /Ext::(.*)Builder/
11     $1.downcase
12   end
13 
14   def self.make(dest_path, results)
15     unless File.exist? 'Makefile' then
16       raise Gem::InstallError, "Makefile not found:\n\n#{results.join "\n"}" 
17     end
18 
19     mf = File.read('Makefile')
20     mf = mf.gsub(/^RUBYARCHDIR\s*=\s*\$[^$]*/, "RUBYARCHDIR = #{dest_path}")
21     mf = mf.gsub(/^RUBYLIBDIR\s*=\s*\$[^$]*/, "RUBYLIBDIR = #{dest_path}")
22 
23     File.open('Makefile', 'wb') {|f| f.print mf}
24 
25     make_program = ENV['make']
26     unless make_program then
27       make_program = (/mswin/ =~ RUBY_PLATFORM) ? 'nmake' : 'make'
28     end
29 
30     ['', ' install'].each do |target|
31       cmd = "#{make_program}#{target}"
32       results << cmd
33       results << `#{cmd} #{redirector}`
34 
35       raise Gem::InstallError, "make#{target} failed:\n\n#{results}" unless
36         $?.success?
37     end
38   end
39 
40   def self.redirector
41     '2>&1'
42   end
43 
44   def self.run(command, results)
45     results << command
46     results << `#{command} #{redirector}`
47 
48     unless $?.success? then
49       raise Gem::InstallError, "#{class_name} failed:\n\n#{results.join "\n"}"
50     end
51   end
52 
53 end
54 

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