End of Life Ruby 3.1 has reached end of life and gets no more fixes. 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.1.3/lib/rubygems/package/tar_reader.rb, line 111
def seek(name) # :yields: entry
found = find do |entry|
entry.full_name == name
end
return unless found
return 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.