Skip to content

Instantly share code, notes, and snippets.

@blizzarddreams
Created December 27, 2015 16:55
Show Gist options
  • Select an option

  • Save blizzarddreams/1e7df0aea2b595cb7607 to your computer and use it in GitHub Desktop.

Select an option

Save blizzarddreams/1e7df0aea2b595cb7607 to your computer and use it in GitHub Desktop.
require "zlib"
require "open-uri"
url = "https://cache.ruby-lang.org/pub/ruby/ruby-2.1.2.zip"
file_name = "ruby.zip"
File.open(file_name, "wb") { |file| file.write(open(url).read) }
z = Zlib::GzipReader.open(file_name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment