diff --git a/MPW/Sync/MPWSync.rb b/MPW/Sync/MPWSync.rb index 16d314b..730d9fb 100644 --- a/MPW/Sync/MPWSync.rb +++ b/MPW/Sync/MPWSync.rb @@ -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) diff --git a/MPW/Sync/SSH.rb b/MPW/Sync/SSH.rb index 21c9c03..4868a85 100644 --- a/MPW/Sync/SSH.rb +++ b/MPW/Sync/SSH.rb @@ -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