childprocess 0.4.1.rc2 → 0.4.1.rc3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e46688d94bfe27c279b73eb02843fab1e7a83db2
4
- data.tar.gz: d72ef6c90fbeef9c71dc23f67686ba4f3793aba0
3
+ metadata.gz: 00ddfafdc09952346436784796593dbd84226f8f
4
+ data.tar.gz: cf8357a92e51f5d3788be2f8f6764dacdce3ec4f
5
5
  SHA512:
6
- metadata.gz: 8ba10a259c2cb39a937cdbb4175e6e886e958470c66970f2cf6f8e930dbae425fe46ef57a1efa0e9042dafa5c400ced65e0915352674e37d6ae6f2a0913a0d47
7
- data.tar.gz: 019d24fea23a564dc961aefac8af5d0fcd168fc145965dd3fee4059a762f4c1a43fadcf6f35eabee3ca86a9b2dd103bc74bac4b297680a36626cbf260996a9d3
6
+ metadata.gz: f542b37a593c546c075f79ac326ccc6f675d91053c0c055a7b2a7e4cd77c4a080c6af54b964dce77bbf67d86214ccfab729d2cd742aa7157126120896cb5dbef
7
+ data.tar.gz: b1c00379cc624d562b020995aeb446d2af35dd56a643e56462e86df0b037d018dcf336ba91350cff2040c023b846143468df6b04aeda92282edda868dccacbe2
@@ -12,3 +12,5 @@ matrix:
12
12
  allow_failures:
13
13
  - rvm: rbx
14
14
  - rvm: ruby-head
15
+ - rvm: 2.1.0
16
+ env: "CHILDPROCESS_POSIX_SPAWN=true"
@@ -1,3 +1,3 @@
1
1
  module ChildProcess
2
- VERSION = "0.4.1.rc2"
2
+ VERSION = "0.4.1.rc3"
3
3
  end
@@ -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(
@@ -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
@@ -51,21 +51,19 @@ describe ChildProcess do
51
51
  end
52
52
 
53
53
  it "pumps all output" do
54
- 10.times do |i|
55
- process = echo
54
+ process = echo
56
55
 
57
- out = Tempfile.new("duplex")
56
+ out = Tempfile.new("pump")
58
57
 
59
- begin
60
- process.io.stdout = out
58
+ begin
59
+ process.io.stdout = out
61
60
 
62
- process.start
63
- process.poll_for_exit(exit_timeout)
61
+ process.start
62
+ process.wait
64
63
 
65
- rewind_and_read(out).should == "hello\n"
66
- ensure
67
- out.close
68
- end
64
+ rewind_and_read(out).should == "hello\n"
65
+ ensure
66
+ out.close
69
67
  end
70
68
  end
71
69
 
@@ -19,8 +19,12 @@ module ChildProcessSpecHelper
19
19
  @process = ChildProcess.build(RUBY , *args)
20
20
  end
21
21
 
22
- def sleeping_ruby
23
- ruby_process("-e", "sleep")
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.rc2
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 00:00:00.000000000 Z
11
+ date: 2014-02-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec