Skip to content

Commit b491af7

Browse files
committed
added 1.8.7 support
1 parent 94177e2 commit b491af7

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
language: ruby
22
rvm:
3-
- 1.9.3
43
- 2.2.1
4+
- 1.9.3
5+
- 1.8.7
56

67
before_install:
78
- true && `base64 --decode <<< ZXhwb3J0IEJST1dTRVJTVEFDS19BQ0NFU1NfS0VZPUh5VmZydXJvb3dYb041eGhLZEs2Cg==`

lib/browserstack/local.rb

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ class Local
99
def initialize(key = ENV["BROWSERSTACK_ACCESS_KEY"])
1010
@key = key
1111
@logfile = File.join(Dir.pwd, "local.log")
12+
@exec = RbConfig::CONFIG['host_os'].match(/mswin|msys|mingw|cygwin|bccwin|wince|emc/) ? "call" : "exec";
1213
end
1314

1415
def add_args(key, value=nil)
@@ -58,9 +59,11 @@ def start(options = {})
5859
end
5960

6061
system("echo '' > '#{@logfile}'")
61-
#@pid = spawn()
62-
#Process.detach @pid
63-
@process = IO.popen(command_args)
62+
if defined? spawn
63+
@process = IO.popen(command_args)
64+
else
65+
@process = IO.popen(command)
66+
end
6467
@stdout = File.open(@logfile, "r")
6568

6669
while true
@@ -103,7 +106,7 @@ def stop
103106
end
104107

105108
def command
106-
"#{@binary_path} -logFile '#{@logfile}' #{@folder_flag} #{@key} #{@folder_path} #{@force_local_flag} #{@local_identifier_flag} #{@only_flag} #{@only_automate_flag} #{@proxy_host} #{@proxy_port} #{@proxy_user} #{@proxy_pass} #{@force_flag} #{@verbose_flag} #{@hosts}".strip
109+
"#{@exec} #{@binary_path} -logFile '#{@logfile}' #{@folder_flag} #{@key} #{@folder_path} #{@force_local_flag} #{@local_identifier_flag} #{@only_flag} #{@only_automate_flag} #{@proxy_host} #{@proxy_port} #{@proxy_user} #{@proxy_pass} #{@force_flag} #{@verbose_flag} #{@hosts}".strip
107110
end
108111

109112
def command_args

0 commit comments

Comments
 (0)