Geminstaller C0 Coverage Information - RCov

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

Name Total Lines Lines of Code Total Coverage Code Coverage
spec/fixture/rubygems_dist/rubygems-trunk/lib/rubygems/source_info_cache_entry.rb 56 31
82.14%
70.97%

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 require 'rubygems'
2 require 'rubygems/source_index'
3 require 'rubygems/remote_fetcher'
4 
5 ##
6 # Entries held by a SourceInfoCache.
7 
8 class Gem::SourceInfoCacheEntry
9 
10   ##
11   # The source index for this cache entry.
12 
13   attr_reader :source_index
14 
15   ##
16   # The size of the source entry.  Used to determine if the source index has
17   # changed.
18 
19   attr_reader :size
20 
21   ##
22   # Create a cache entry.
23 
24   def initialize(si, size)
25     @source_index = si || Gem::SourceIndex.new({})
26     @size = size
27     @all = false
28   end
29 
30   def refresh(source_uri, all)
31     begin
32       marshal_uri = URI.join source_uri.to_s, "Marshal.#{Gem.marshal_version}"
33       remote_size = Gem::RemoteFetcher.fetcher.fetch_size marshal_uri
34     rescue Gem::RemoteSourceException
35       yaml_uri = URI.join source_uri.to_s, 'yaml'
36       remote_size = Gem::RemoteFetcher.fetcher.fetch_size yaml_uri
37     end
38 
39     # TODO Use index_signature instead of size?
40     return false if @size == remote_size and @all
41 
42     updated = @source_index.update source_uri, all
43     @size = remote_size
44     @all = all
45 
46     updated
47   end
48 
49   def ==(other) # :nodoc:
50     self.class === other and
51     @size == other.size and
52     @source_index == other.source_index
53   end
54 
55 end
56 

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