# File lib/net/ssh/config.rb, line 58
 58:       def load(path, host, settings={})
 59:         file = File.expand_path(path)
 60:         return settings unless File.readable?(file)
 61:         
 62:         globals = {}
 63:         matched_host = nil
 64:         multi_host = []
 65:         seen_host = false
 66:         IO.foreach(file) do |line|
 67:           next if line =~ /^\s*(?:#.*)?$/
 68:           
 69:           if line =~ /^\s*(\S+)\s*=(.*)$/
 70:             key, value = $1, $2
 71:           else
 72:             key, value = line.strip.split(/\s+/, 2)
 73:           end
 74: 
 75:           # silently ignore malformed entries
 76:           next if value.nil?
 77: 
 78:           key.downcase!
 79:           value = $1 if value =~ /^"(.*)"$/
 80:           
 81:           value = case value.strip
 82:             when /^\d+$/ then value.to_i
 83:             when /^no$/i then false
 84:             when /^yes$/i then true
 85:             else value
 86:             end
 87:           
 88:           if key == 'host'
 89:             # Support "Host host1 host2 hostN".
 90:             # See http://github.com/net-ssh/net-ssh/issues#issue/6
 91:             multi_host = value.to_s.split(/\s+/)
 92:             matched_host = multi_host.select { |h| host =~ pattern2regex(h) }.first
 93:             seen_host = true
 94:           elsif !seen_host
 95:             if key == 'identityfile'
 96:               (globals[key] ||= []) << value
 97:             else
 98:               globals[key] = value unless settings.key?(key)
 99:             end
100:           elsif !matched_host.nil?
101:             if key == 'identityfile'
102:               (settings[key] ||= []) << value
103:             else
104:               settings[key] = value unless settings.key?(key)
105:             end
106:           end
107:         end
108:         
109:         settings = globals.merge(settings) if globals
110:         
111:         return settings
112:       end