mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to RubyGems 1.3.0 r1891
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19547 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
788001a9c8
commit
d478c7a734
60 changed files with 2174 additions and 1049 deletions
|
|
@ -34,16 +34,20 @@ class Gem::FakeFetcher
|
|||
path = path.to_s
|
||||
@paths << path
|
||||
raise ArgumentError, 'need full URI' unless path =~ %r'^http://'
|
||||
data = @data[path]
|
||||
|
||||
if data.nil? then
|
||||
raise Gem::RemoteFetcher::FetchError.new('no data', path)
|
||||
unless @data.key? path then
|
||||
raise Gem::RemoteFetcher::FetchError.new("no data for #{path}", path)
|
||||
end
|
||||
|
||||
data = @data[path]
|
||||
|
||||
if data.respond_to?(:call) then
|
||||
data.call
|
||||
else
|
||||
data = Gem.gunzip data if path.to_s =~ /gz$/ unless data.empty?
|
||||
if path.to_s =~ /gz$/ and not data.nil? and not data.empty? then
|
||||
data = Gem.gunzip data
|
||||
end
|
||||
|
||||
data
|
||||
end
|
||||
end
|
||||
|
|
@ -51,13 +55,15 @@ class Gem::FakeFetcher
|
|||
def fetch_size(path)
|
||||
path = path.to_s
|
||||
@paths << path
|
||||
raise ArgumentError, 'need full URI' unless path =~ %r'^http://'
|
||||
data = @data[path]
|
||||
|
||||
if data.nil? then
|
||||
raise Gem::RemoteFetcher::FetchError.new("no data for #{path}", nil)
|
||||
raise ArgumentError, 'need full URI' unless path =~ %r'^http://'
|
||||
|
||||
unless @data.key? path then
|
||||
raise Gem::RemoteFetcher::FetchError.new("no data for #{path}", path)
|
||||
end
|
||||
|
||||
data = @data[path]
|
||||
|
||||
data.respond_to?(:call) ? data.call : data.length
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue