lib/sconb/ssh_config.rb in sconb-1.1.0 vs lib/sconb/ssh_config.rb in sconb-1.1.1
- old
+ new
@@ -7,11 +7,11 @@
@options = options
file = File.expand_path(@path)
@configs = {}
return @configs unless File.readable?(file)
- @allconfig = Net::SSH::Config.sconb_load(@path, '*', @options)
+ @allconfig = Net::SSH::Config.load_with_key(@path, '*', @options)
@configs['*'] = @allconfig unless @allconfig.size <= 1
IO.foreach(file) do |line|
parse(line)
end
@configs
@@ -33,11 +33,11 @@
if key.downcase == 'host'
negative_hosts, positive_hosts = value.to_s.split(/\s+/).partition { |h| h.start_with?('!') }
positive_hosts.each do |host|
next if host == '*'
next unless host.match @regexp
- config = Net::SSH::Config.sconb_load(@path, host, @options)
+ config = Net::SSH::Config.load_with_key(@path, host, @options)
@allconfig.each do |k, _v|
next unless config.key? k
config.delete k if config[k] == @allconfig[k]
end
@@ -48,10 +48,10 @@
# Match
if key.downcase == 'match'
match_key = key + ' ' + value
return unless match_key.match @regexp
- @configs[match_key] = Net::SSH::Config.sconb_load(@path, value, @options)
+ @configs[match_key] = Net::SSH::Config.load_with_key(@path, value, @options)
end
end
end
end
end