Module: URI::SshGit
- Defined in:
- lib/uri/ssh_git.rb,
lib/uri/ssh_git/generic.rb,
lib/uri/ssh_git/version.rb
Overview
Parse and build git repository url via ssh protocol.
Defined Under Namespace
Classes: Generic
Constant Summary collapse
- VERSION =
'2.0.0'
Class Method Summary collapse
-
.parse(uri_string) ⇒ Generic
Parsed object.
Class Method Details
.parse(uri_string) ⇒ Generic
Returns parsed object.
30 31 32 33 34 35 36 |
# File 'lib/uri/ssh_git.rb', line 30 def self.parse(uri_string) host_part, path_part = uri_string.split(':', 2) # There may be no user, so reverse the split to make sure host always # is !nil if host_part was !nil. host, userinfo = host_part.split('@', 2).reverse Generic.build(userinfo: userinfo, host: host, path: path_part) end |