diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-25 15:13:14 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-25 15:13:14 +0000 |
commit | d0233291bc8a5068e52c69c210e5979e5324b5bc (patch) | |
tree | 7d9459449c33792c63eeb7baa071e76352e0baab /trunk/lib/rubygems/source_info_cache_entry.rb | |
parent | 0dc342de848a642ecce8db697b8fecd83a63e117 (diff) | |
parent | 72eaacaa15256ab95c3b52ea386f88586fb9da40 (diff) |
re-adding tag v1_9_0_4 as an alias of trunk@18848v1_9_0_4
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v1_9_0_4@18849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'trunk/lib/rubygems/source_info_cache_entry.rb')
-rw-r--r-- | trunk/lib/rubygems/source_info_cache_entry.rb | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/trunk/lib/rubygems/source_info_cache_entry.rb b/trunk/lib/rubygems/source_info_cache_entry.rb deleted file mode 100644 index c3f75e5b99..0000000000 --- a/trunk/lib/rubygems/source_info_cache_entry.rb +++ /dev/null @@ -1,56 +0,0 @@ -require 'rubygems' -require 'rubygems/source_index' -require 'rubygems/remote_fetcher' - -## -# 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, all) - begin - marshal_uri = URI.join source_uri.to_s, "Marshal.#{Gem.marshal_version}" - remote_size = Gem::RemoteFetcher.fetcher.fetch_size marshal_uri - rescue Gem::RemoteSourceException - yaml_uri = URI.join source_uri.to_s, 'yaml' - remote_size = Gem::RemoteFetcher.fetcher.fetch_size yaml_uri - end - - # 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 - - def ==(other) # :nodoc: - self.class === other and - @size == other.size and - @source_index == other.source_index - end - -end - |