fix new syntax

This commit is contained in:
nishiki 2014-08-31 13:07:06 +02:00
parent 6c09c7f1b3
commit 1d3b127df0
2 changed files with 14 additions and 12 deletions

View file

@ -68,10 +68,11 @@ module MPW
msg = nil msg = nil
TCPSocket.open(@host, @port) do |socket| TCPSocket.open(@host, @port) do |socket|
send_msg = {:action => 'get', send_msg = {action: 'get',
:gpg_key => @gpg_key, gpg_key: @gpg_key,
:password => @password, password: @password,
:suffix => @suffix} suffix: @suffix
}
socket.puts send_msg.to_json socket.puts send_msg.to_json
msg = JSON.parse(socket.gets) msg = JSON.parse(socket.gets)
@ -112,11 +113,12 @@ module MPW
msg = nil msg = nil
TCPSocket.open(@host, @port) do |socket| TCPSocket.open(@host, @port) do |socket|
send_msg = {:action => 'update', send_msg = {action: 'update',
:gpg_key => @gpg_key, gpg_key: @gpg_key,
:password => @password, password: @password,
:suffix => @suffix, suffix: @suffix,
:data => data} data: data
}
socket.puts send_msg.to_json socket.puts send_msg.to_json
msg = JSON.parse(socket.gets) msg = JSON.parse(socket.gets)

View file

@ -37,7 +37,7 @@ module MPW
@path = path @path = path
@port = port.instance_of?(Integer) ? 22 : port @port = port.instance_of?(Integer) ? 22 : port
Net::SSH.start(@host, @user, :password => @password, :port => @port) do Net::SSH.start(@host, @user, password: @password, port: @port) do
@enable = true @enable = true
end end
rescue Exception => e rescue Exception => e
@ -56,7 +56,7 @@ module MPW
end end
tmp_file = tmpfile tmp_file = tmpfile
Net::SCP.start(@host, @user, :password => @password, :port => @port) do |scp| Net::SCP.start(@host, @user, password: @password, port: @port) do |scp|
scp.download!(@path, tmp_file) scp.download!(@path, tmp_file)
end end
@ -86,7 +86,7 @@ module MPW
file << data file << data
end end
Net::SCP.start(@host, @user, :password => @password, :port => @port) do |scp| Net::SCP.start(@host, @user, password: @password, port: @port) do |scp|
scp.upload!(tmp_file, @path) scp.upload!(tmp_file, @path)
end end