module Warg::Host::Parser
Constants
- REGEXP
Public Instance Methods
call(host_string)
click to toggle source
# File lib/warg.rb, line 699 def call(host_string) match_data = REGEXP.match("ssh://#{host_string}") query_string = match_data[8] || "" query_fragments = query_string.split("&") properties = query_fragments.inject({}) do |all, fragment| name, value = fragment.split("=", 2) all.merge!(name.to_sym => value) end { user: match_data[3], address: match_data[4], port: match_data[5], properties: properties } end