class URI::Ssh::Generic

Public Instance Methods

check_host(_v) click to toggle source

check_host returns `false` for 'foo_bar' but in ssh config this can be a valid host

# File lib/dr/base/uri.rb, line 58
def check_host(_v)
  return true
end
to_ssh(show_path: true) click to toggle source

@example

URI::Ssh::Generic.build(
  userinfo: 'git',
  host: 'github.com',
  path: 'packsaddle/ruby-uri-ssh_git.git'
).to_ssh
#=> 'git@github.com:packsaddle/ruby-uri-ssh_git.git'

@return [String] git repository url via ssh protocol

# File lib/dr/base/uri.rb, line 70
def to_ssh(show_path: true)
  str = ''
  str << "#{user}@" if user && !user.empty?
  str << "#{host}"
  str << ":#{path}" if path and show_path
  str
end