Skip to content

Instantly share code, notes, and snippets.

@hitode909
Last active May 27, 2016 00:19
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 hitode909/8e3fde72960e9adbbc7b5cbf4e0d5861 to your computer and use it in GitHub Desktop.
Save hitode909/8e3fde72960e9adbbc7b5cbf4e0d5861 to your computer and use it in GitHub Desktop.
Extract and print the URLs
require 'uri'
while line = gets
begin
URI.extract(line, ['http', 'https']).each do |uri|
puts uri
end
rescue
end
end
Gem::Specification.new do |spec|
spec.name = "urls"
spec.version = "0.0.3"
spec.authors = ["hitode909"]
spec.email = ["hitode909@gmail.com"]
spec.summary = "Extract and print the URLs"
spec.files = ["urls"]
spec.bindir = "."
spec.executables = ["urls"]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment