lib/em-ssh/connection.rb
# Returns the host (and possibly IP address) in a format compatible with
# SSH known-host files.
Returns the host (and possibly IP address) in a format compatible with
SSH known-host files.
Returns the host ( and possibly IP address ) in a format compatible with SSH known - host files .
def host_as_string
        @host_as_string ||= "#{host}".tap do |string|
          string = "[#{string}]:#{port}" if port != DEFAULT_PORT
          _, ip = Socket.unpack_sockaddr_in(get_peername)
          if ip != host
            string << "," << (port != DEFAULT_PORT ? "[#{ip}]:#{port}" : ip)
          end 
        end 
      end
def host_as_string @host_as_string ||= "#{host}" . tap do | string | string = "[#{string}]:#{port}" if port != DEFAULT_PORT _ , ip = Socket . unpack_sockaddr_in ( get_peername ) if ip != host string << "," << ( port != DEFAULT_PORT ? "[#{ip}]:#{port}" : ip ) end end end
Returns the host (and possibly IP address) in a format compatible with
SSH known-host files.
Returns the host ( and possibly IP address ) in a format compatible with SSH known - host files .
# ip != host #  |string|