Parent

Methods

Class Index [+]

Quicksearch

Gem::SourceInfoCacheEntry

Entries held by a SourceInfoCache.

Attributes

source_index[R]

The source index for this cache entry.

size[R]

The size of the source entry. Used to determine if the source index has changed.

Public Class Methods

new(si, size) click to toggle source

Create a cache entry.

    # File lib/rubygems/source_info_cache_entry.rb, line 24
24:   def initialize(si, size)
25:     @source_index = si || Gem::SourceIndex.new({})
26:     @size = size
27:     @all = false
28:   end

Public Instance Methods

refresh(source_uri, all) click to toggle source
    # File lib/rubygems/source_info_cache_entry.rb, line 30
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

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.