End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Gem::Package#extract_files
extract_files(destination_dir, pattern = "*")
lib/rubygems/package.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.0.5/lib/rubygems/package.rb, line 380
def extract_files(destination_dir, pattern = "*")
verify unless @spec
FileUtils.mkdir_p destination_dir, :mode => dir_mode && 0755
@gem.with_read_io do |io|
reader = Gem::Package::TarReader.new io
reader.each do |entry|
next unless entry.full_name == 'data.tar.gz'
extract_tar_gz entry, destination_dir, pattern
return # ignore further entries
end
end
end
Extracts the files in this package into destination_dir
If pattern is specified, only entries matching that glob will be extracted.