Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
class method
Gem::Util.gunzip
gunzip(data)
lib/rubygems/util.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.3.0/lib/rubygems/util.rb, line 12
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 · 4.0 · 3.4 · 3.2 · 3.1 · 3.0