diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-03-31 22:40:06 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-03-31 22:40:06 +0000 |
commit | 8cc45aae947d453acca029e13eb64f3f5f0bf942 (patch) | |
tree | f9485a20c99defe1aae3f32555a41d23c2298ad8 /lib/rubygems/source_info_cache_entry.rb | |
parent | dc8359969ec71ece10357ba9396430db7f029e45 (diff) |
Import RubyGems 1.1.0
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/source_info_cache_entry.rb')
-rw-r--r-- | lib/rubygems/source_info_cache_entry.rb | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/lib/rubygems/source_info_cache_entry.rb b/lib/rubygems/source_info_cache_entry.rb index 02e03ca9db..c3f75e5b99 100644 --- a/lib/rubygems/source_info_cache_entry.rb +++ b/lib/rubygems/source_info_cache_entry.rb @@ -3,24 +3,31 @@ require 'rubygems/source_index' require 'rubygems/remote_fetcher' ## -# Entrys held by a SourceInfoCache. +# Entries held by a SourceInfoCache. class Gem::SourceInfoCacheEntry + ## # The source index for this cache entry. + attr_reader :source_index + ## # The size of the of the source entry. Used to determine if the # source index has changed. + attr_reader :size + ## # Create a cache entry. + def initialize(si, size) @source_index = si || Gem::SourceIndex.new({}) @size = size + @all = false end - def refresh(source_uri) + def refresh(source_uri, all) begin marshal_uri = URI.join source_uri.to_s, "Marshal.#{Gem.marshal_version}" remote_size = Gem::RemoteFetcher.fetcher.fetch_size marshal_uri @@ -29,9 +36,12 @@ class Gem::SourceInfoCacheEntry remote_size = Gem::RemoteFetcher.fetcher.fetch_size yaml_uri end - return false if @size == remote_size # TODO Use index_signature instead of size? - updated = @source_index.update source_uri + # TODO Use index_signature instead of size? + return false if @size == remote_size and @all + + updated = @source_index.update source_uri, all @size = remote_size + @all = all updated end |