Skip to content

Instantly share code, notes, and snippets.

@vakhnenko
Created April 30, 2016 15:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vakhnenko/a0f74dcdf77c7a2e66c028b3de80c3e3 to your computer and use it in GitHub Desktop.
Save vakhnenko/a0f74dcdf77c7a2e66c028b3de80c3e3 to your computer and use it in GitHub Desktop.
require 'zlib'
require 'rubygems/package'
require 'open-uri'
# Download file here
mirror = 'http://nl.alpinelinux.org/alpine'
uri = "#{mirror}/edge/main/x86_64/APKINDEX.tar.gz"
archive = open(uri)
Zlib::GzipReader.open(archive) do |gz|
Gem::Package::TarReader.new(gz) do |tar|
tar.each { |entry| puts entry.full_name }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment