lib/arql/app.rb in arql-0.1.22 vs lib/arql/app.rb in arql-0.1.23
- old
+ new
@@ -7,14 +7,10 @@
attr_accessor :log_io
def config
@@effective_config
end
-
- def local_ssh_proxy_port
- @@local_ssh_proxy_port
- end
end
def initialize(options)
require 'active_support/all'
require 'active_record'
@@ -46,14 +42,16 @@
load(effective_config[:initializer])
end
def start_ssh_proxy!
ssh_config = effective_config[:ssh]
- @ssh_gateway = Net::SSH::Gateway.new(ssh_config[:host], ssh_config[:user], ssh_config.slice(:port, :password).symbolize_keys)
- @@local_ssh_proxy_port = @ssh_gateway.open(effective_config[:host], effective_config[:port], ssh_config[:local_port])
+ local_ssh_proxy_port = Arql::SSHProxy.connect(ssh_config.slice(:host, :user, :port, :password).merge(
+ forward_host: effective_config[:host],
+ forward_port: effective_config[:port],
+ local_port: ssh_config[:local_port]))
{
host: '127.0.0.1',
- port: @@local_ssh_proxy_port
+ port: local_ssh_proxy_port
}
end
def config
@config ||= YAML.load(IO.read(@options.config_file)).with_indifferent_access