childprocess 0.4.1.rc2 → 0.4.1.rc3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -0
- data/lib/childprocess/version.rb +1 -1
- data/lib/childprocess/windows/lib.rb +1 -1
- data/spec/childprocess_spec.rb +10 -0
- data/spec/io_spec.rb +9 -11
- data/spec/spec_helper.rb +6 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 00ddfafdc09952346436784796593dbd84226f8f
|
4
|
+
data.tar.gz: cf8357a92e51f5d3788be2f8f6764dacdce3ec4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f542b37a593c546c075f79ac326ccc6f675d91053c0c055a7b2a7e4cd77c4a080c6af54b964dce77bbf67d86214ccfab729d2cd742aa7157126120896cb5dbef
|
7
|
+
data.tar.gz: b1c00379cc624d562b020995aeb446d2af35dd56a643e56462e86df0b037d018dcf336ba91350cff2040c023b846143468df6b04aeda92282edda868dccacbe2
|
data/.travis.yml
CHANGED
data/lib/childprocess/version.rb
CHANGED
@@ -136,7 +136,7 @@ module ChildProcess
|
|
136
136
|
# );
|
137
137
|
#
|
138
138
|
|
139
|
-
attach_function :wait_for_single_object, :WaitForSingleObject, [:pointer, :ulong], :wait_status
|
139
|
+
attach_function :wait_for_single_object, :WaitForSingleObject, [:pointer, :ulong], :wait_status, :blocking => true
|
140
140
|
|
141
141
|
#
|
142
142
|
# BOOL WINAPI GetExitCodeProcess(
|
data/spec/childprocess_spec.rb
CHANGED
@@ -215,4 +215,14 @@ describe ChildProcess do
|
|
215
215
|
wait_until(3) { alive?(pid).should be_false }
|
216
216
|
end
|
217
217
|
end
|
218
|
+
|
219
|
+
it 'releases the GIL while waiting for the process' do
|
220
|
+
time = Time.now
|
221
|
+
threads = []
|
222
|
+
|
223
|
+
threads << Thread.new { proc = sleeping_ruby(1).start; proc.wait }
|
224
|
+
threads << Thread.new(time) { (Time.now - time).should < 0.5 }
|
225
|
+
|
226
|
+
threads.each { |t| t.join }
|
227
|
+
end
|
218
228
|
end
|
data/spec/io_spec.rb
CHANGED
@@ -51,21 +51,19 @@ describe ChildProcess do
|
|
51
51
|
end
|
52
52
|
|
53
53
|
it "pumps all output" do
|
54
|
-
|
55
|
-
process = echo
|
54
|
+
process = echo
|
56
55
|
|
57
|
-
|
56
|
+
out = Tempfile.new("pump")
|
58
57
|
|
59
|
-
|
60
|
-
|
58
|
+
begin
|
59
|
+
process.io.stdout = out
|
61
60
|
|
62
|
-
|
63
|
-
|
61
|
+
process.start
|
62
|
+
process.wait
|
64
63
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
end
|
64
|
+
rewind_and_read(out).should == "hello\n"
|
65
|
+
ensure
|
66
|
+
out.close
|
69
67
|
end
|
70
68
|
end
|
71
69
|
|
data/spec/spec_helper.rb
CHANGED
@@ -19,8 +19,12 @@ module ChildProcessSpecHelper
|
|
19
19
|
@process = ChildProcess.build(RUBY , *args)
|
20
20
|
end
|
21
21
|
|
22
|
-
def sleeping_ruby
|
23
|
-
|
22
|
+
def sleeping_ruby(seconds = nil)
|
23
|
+
if seconds
|
24
|
+
ruby_process("-e", "sleep #{seconds}")
|
25
|
+
else
|
26
|
+
ruby_process("-e", "sleep")
|
27
|
+
end
|
24
28
|
end
|
25
29
|
|
26
30
|
def invalid_process
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: childprocess
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.1.
|
4
|
+
version: 0.4.1.rc3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jari Bakken
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|