fix remote parsing / setup

This commit is contained in:
Torsten Ruger 2015-11-18 13:17:49 +02:00
parent 7daaec6a0a
commit 0e89cbe8ff

View File

@ -10,6 +10,7 @@ Rye::Cmd.add_command :aout, './a.out'
# #
# The second obviously takes a fair bit of time so it's only done when an REMOTE is set # The second obviously takes a fair bit of time so it's only done when an REMOTE is set
# REMOTE has to be set to user@machine:port or it will default to an emulator # REMOTE has to be set to user@machine:port or it will default to an emulator
# the minimum is REMOTE=username , and off course ssh keys have to be set up
module RuntimeTests module RuntimeTests
@ -42,9 +43,9 @@ module RuntimeTests
def connected def connected
return false unless ENV["REMOTE"] return false unless ENV["REMOTE"]
user , rest = ENV["REMOTE"].split("@") user , rest = ENV["REMOTE"].split("@")
machine , port = rest.split(":") machine , port = rest.to_s.split(":")
return @@conn if defined?(@@conn) return @@conn if defined?(@@conn)
@@conn = Rye::Box.new(machine | "localhost" , :port => (port | 2222) , :user => (user | "pi")) @@conn = Rye::Box.new(machine || "localhost" , :port => (port || 2222) , :user => (user || "pi"))
end end
def check_remote ret def check_remote ret