instance method
Gem::Package::TarReader#seek
seek(name) { |entry| ... }
lib/rubygems/package/tar_reader.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/rubygems/package/tar_reader.rb, line 90
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.