Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
Gem::Package::TarReader#seek
seek(name) { |entry| ... }
lib/rubygems/package/tar_reader.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.4.1/lib/rubygems/package/tar_reader.rb, line 88
def seek(name) # :yields: entry
found = find do |entry|
entry.full_name == name
end
return unless found
yield found
ensure
rewind
end
Seeks through the tar file until it finds the entry with name and yields it. Rewinds the tar file to the beginning when the block terminates.