Skip to content

Commit e2085e8

Browse files
committed
using spawn
1 parent 5c73251 commit e2085e8

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
language: ruby
22
rvm:
3-
- 1.8.7
43
- 1.9.3
54
- 2.2.1
65

lib/browserstack/local.rb

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,11 @@ def start(options = {})
5858
end
5959

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

6468
while true
@@ -75,7 +79,7 @@ def start(options = {})
7579
return
7680
end
7781
if line.strip == "Press Ctrl-C to exit"
78-
@pid = @process.pid
82+
#@pid = @process.pid
7983
@stdout.close
8084
break
8185
end
@@ -96,10 +100,10 @@ def stop
96100
puts "PID #{@pid}"
97101
puts `ps aux| grep BrowserStackLocal`
98102
puts `lsof -i:45691`
99-
Process.kill("INT", @pid)
100-
sleep 3
101-
Process.kill("KILL", @pid)
102-
@process.close
103+
Process.kill("TERM", @pid)
104+
# sleep 3
105+
# Process.kill("KILL", @pid)
106+
# @process.close
103107
puts "Closed"
104108
puts `ps aux| grep BrowserStackLocal`
105109
puts `lsof -i:45691`

0 commit comments

Comments
 (0)