Geminstaller C0 Coverage Information - RCov

spec/fixture/rubygems_dist/rubygems-trunk/lib/rubygems/custom_require.rb

Name Total Lines Lines of Code Total Coverage Code Coverage
spec/fixture/rubygems_dist/rubygems-trunk/lib/rubygems/custom_require.rb 46 17
91.30%
76.47%

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 require 'rubygems'
8 
9 module Kernel
10 
11   ##
12   # The Kernel#require from before RubyGems was loaded.
13 
14   alias gem_original_require require
15 
16   ##
17   # When RubyGems is required, Kernel#require is replaced with our own which
18   # is capable of loading gems on demand.
19   #
20   # When you call <tt>require 'x'</tt>, this is what happens:
21   # * If the file can be loaded from the existing Ruby loadpath, it
22   #   is.
23   # * Otherwise, installed gems are searched for a file that matches.
24   #   If it's found in gem 'y', that gem is activated (added to the
25   #   loadpath).
26   #
27   # The normal <tt>require</tt> functionality of returning false if
28   # that file has already been loaded is preserved.
29 
30   def require(path) # :doc:
31     gem_original_require path
32   rescue LoadError => load_error
33     if load_error.message =~ /#{Regexp.escape path}\z/ and
34        spec = Gem.searcher.find(path) then
35       Gem.activate(spec.name, "= #{spec.version}")
36       gem_original_require path
37     else
38       raise load_error
39     end
40   end
41 
42   private :require
43   private :gem_original_require
44 
45 end
46 

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