Skip to content

Commit ad4f936

Browse files
committed
Merge pull request #2 from browserstack/travis
Travis configured
2 parents a69677d + ce53eeb commit ad4f936

File tree

2 files changed

+24
-7
lines changed

2 files changed

+24
-7
lines changed

.travis.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
11
language: ruby
2-
rvm:
3-
- 1.9.3
4-
- 2.2.1
2+
3+
matrix:
4+
include:
5+
- os: linux
6+
ruby: 2.2.2
7+
- os: linux
8+
ruby: 2.2.1
9+
- os: linux
10+
ruby: 1.9.3
11+
- os: linux
12+
ruby: 1.8.7
13+
- os: osx
14+
ruby: 2.2.2
15+
- os: osx
16+
ruby: 2.2.1
17+
- os: osx
18+
ruby: 1.9.3
519

620
before_install:
721
- 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)