Created
March 20, 2012 05:20
-
-
Save garrow/2131636 to your computer and use it in GitHub Desktop.
URI::parse
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
[65] pry(main)> ftp_abc = 'ftp://www.abc.net.au/hifive/' | |
=> "ftp://www.abc.net.au/hifive/" | |
[66] pry(main)> http_abc = 'http://www.abc.net.au/hifive/' | |
=> "http://www.abc.net.au/hifive/" | |
[67] pry(main)> f = URI::parse ftp_abc | |
=> #<URI::FTP:0x7ffe21b416b8 URL:ftp://www.abc.net.au/hifive/> | |
[68] pry(main)> h = URI::parse http_abc | |
=> #<URI::HTTP:0x7ffe21b37c58 URL:http://www.abc.net.au/hifive/> | |
[69] pry(main)> f.path | |
=> "hifive/" | |
[70] pry(main)> h.path | |
=> "/hifive/" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment