Created
October 17, 2016 09:33
-
-
Save awesome/46a324b33be657699664945b7bc3d974 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Halp | |
extend self | |
def format_host(str) | |
"#{(url = URI(str)).host}#{":#{url.port}" if url.port != 80}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment