Method: Gitable::URI.parse
- Defined in:
- lib/gitable/uri.rb
.parse(uri) ⇒ Gitable::URI?
Parse a git repository URI into a URI object.
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/gitable/uri.rb', line 16 def self.parse(uri) return uri if uri.nil? || uri.kind_of?(self) # addressable::URI.parse always returns an instance of Addressable::URI. add = super # >:( at inconsistency if Gitable::ScpURI.scp?(uri) Gitable::ScpURI.parse(uri) else new(add.omit(:password,:query,:fragment).to_hash) end end |