diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-02-10 08:00:19 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-02-10 08:00:19 +0000 |
commit | 5d613c83ccb6992c6b99e5a23512719604bbdae9 (patch) | |
tree | 8f1591102f7c8e1a27bd3c30b43567ced67e2519 /lib/rubygems/package.rb | |
parent | c12b28936266c205d174458f0bd21766154048f7 (diff) | |
download | ruby-5d613c83ccb6992c6b99e5a23512719604bbdae9.tar.gz |
Import RubyGems r1601. [ruby-core:15381].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/package.rb')
-rw-r--r-- | lib/rubygems/package.rb | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/rubygems/package.rb b/lib/rubygems/package.rb index ee136b6267..f15e4feecb 100644 --- a/lib/rubygems/package.rb +++ b/lib/rubygems/package.rb @@ -614,14 +614,16 @@ module Gem::Package # this method would use the String IO approach on all platforms at all # times. And that's the way it is. def zipped_stream(entry) - # This is Jamis Buck's ZLib workaround. The original code is - # commented out while we evaluate this patch. - entry.read(10) # skip the gzip header - zis = Zlib::Inflate.new(-Zlib::MAX_WBITS) - is = StringIO.new(zis.inflate(entry.read)) - # zis = Zlib::GzipReader.new entry - # dis = zis.read - # is = StringIO.new(dis) + if defined? Rubinius then + zis = Zlib::GzipReader.new entry + dis = zis.read + is = StringIO.new(dis) + else + # This is Jamis Buck's ZLib workaround for some unknown issue + entry.read(10) # skip the gzip header + zis = Zlib::Inflate.new(-Zlib::MAX_WBITS) + is = StringIO.new(zis.inflate(entry.read)) + end ensure zis.finish if zis end |