Skip to content

Instantly share code, notes, and snippets.

@xymbol
Last active December 21, 2015 14:44
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 xymbol/789e169c62ec663c9f4e to your computer and use it in GitHub Desktop.
Save xymbol/789e169c62ec663c9f4e to your computer and use it in GitHub Desktop.
require "open-uri"
options = {
content_length_proc: ->(length) {
if length && 0 < length
puts "content_length = #{length}"
end
},
progress_proc: ->(size) {
puts "progress = #{size}"
}
}
ARGV.each do |url|
puts "--- #{url} ---"
open(url, options).read
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment