Skip to content

Instantly share code, notes, and snippets.

@raulgobr
Created September 2, 2014 10:52
Show Gist options
  • Save raulgobr/543f660ad659506a07b0 to your computer and use it in GitHub Desktop.
Save raulgobr/543f660ad659506a07b0 to your computer and use it in GitHub Desktop.
def url_with_protocol(url)
/^http/.match(url) ? url : "https://#{url}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment