class Git::GitAltURI
@api public
that was passed to the initializer.
This class is necessary to ensure that #to_s returns the same string
The URI for git’s alternative scp-like syntax
def initialize(user:, host:, path:)
-
path
(String
) -- the path from the URL -
host
(String
) -- the host from the URL -
user
(String, nil
) -- the user from the URL or nil
def initialize(user:, host:, path:) super(scheme: 'git-alt', user: user, host: host, path: path) end
def to_s
-
(String)
- the URI as a String
def to_s if user "#{user}@#{host}:#{path[1..-1]}" else "#{host}:#{path[1..-1]}" end end