class method
Gem::Util.gunzip
gunzip(data)
lib/rubygems/util.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/rubygems/util.rb, line 10
def self.gunzip(data)
require "zlib"
require "stringio"
data = StringIO.new(data, "r")
gzip_reader = begin
Zlib::GzipReader.new(data)
rescue Zlib::GzipFile::Error => e
raise e.class, e.inspect, e.backtrace
end
unzipped = gzip_reader.read
unzipped.force_encoding Encoding::BINARY
unzipped
end
Zlib::GzipReader wrapper that unzips data.
See also
.glob_files_in_dir
.gzip
.correct_for_windows_path
.inflate
also in
4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0