1
0
Fork 0
mirror of https://github.com/nishiki/manage-password.git synced 2024-11-27 07:33:05 +00:00

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

View file

@ -37,7 +37,7 @@ module MPW
@path = path
@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
end
rescue Exception => e
@ -56,7 +56,7 @@ module MPW
end
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)
end
@ -86,7 +86,7 @@ module MPW
file << data
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)
end