Method: Git::URL.parse
- Defined in:
- lib/git/url.rb
.parse(url) ⇒ Addressable::URI
Parse a Git URL and return an Addressable::URI object
The URI returned can be converted back to a string with 'to_s'. This is guaranteed to return the same URL string that was parsed.
47 48 49 50 51 52 53 |
# File 'lib/git/url.rb', line 47 def self.parse(url) if !url.start_with?('file:') && (m = GIT_ALTERNATIVE_SSH_SYNTAX.match(url)) GitAltURI.new(user: m[:user], host: m[:host], path: m[:path]) else Addressable::URI.parse(url) end end |