open4 0.9.3 → 0.9.4

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -9,6 +9,10 @@ SYNOPSIS
9
9
  child processes and their io handles easily.
10
10
 
11
11
  HISTORY
12
+
13
+ 0.9.4:
14
+ - patch to #background from Corey Jewett
15
+
12
16
 
13
17
  0.9.3:
14
18
  - removed some debugging output accidentally left in 0.9.2. arggh!
@@ -1,10 +1,11 @@
1
+ # vim: ts=2:sw=2:sts=2:et:fdm=marker
1
2
  require 'fcntl'
2
3
  require 'timeout'
3
4
  require 'thread'
4
5
 
5
6
  module Open4
6
7
  #--{{{
7
- VERSION = '0.9.3'
8
+ VERSION = '0.9.4'
8
9
  def self.version() VERSION end
9
10
 
10
11
  class Error < ::StandardError; end
@@ -322,14 +323,19 @@ module Open4
322
323
  #--{{{
323
324
  require 'thread'
324
325
  q = Queue.new
325
- opts['pid'] = opts[:pid] = q
326
+ opts = { 'pid' => q, :pid => q }
327
+ case argv.last
328
+ when Hash
329
+ argv.last.update opts
330
+ else
331
+ argv.push opts
332
+ end
326
333
  thread = Thread.new(arg, argv){|arg, argv| spawn arg, *argv}
327
- pid = q.pop
328
334
  sc = class << thread; self; end
329
335
  sc.module_eval {
330
- define_method(:pid){ pid }
336
+ define_method(:pid){ @pid ||= q.pop }
331
337
  define_method(:spawn_status){ @spawn_status ||= value }
332
- define_method(:exitstatus){ spawn_status.exitstatus }
338
+ define_method(:exitstatus){ @exitstatus ||= spawn_status.exitstatus }
333
339
  }
334
340
  thread
335
341
  #--}}}
data/lib/open4.rb CHANGED
@@ -1,10 +1,11 @@
1
+ # vim: ts=2:sw=2:sts=2:et:fdm=marker
1
2
  require 'fcntl'
2
3
  require 'timeout'
3
4
  require 'thread'
4
5
 
5
6
  module Open4
6
7
  #--{{{
7
- VERSION = '0.9.3'
8
+ VERSION = '0.9.4'
8
9
  def self.version() VERSION end
9
10
 
10
11
  class Error < ::StandardError; end
@@ -322,14 +323,19 @@ module Open4
322
323
  #--{{{
323
324
  require 'thread'
324
325
  q = Queue.new
325
- opts['pid'] = opts[:pid] = q
326
+ opts = { 'pid' => q, :pid => q }
327
+ case argv.last
328
+ when Hash
329
+ argv.last.update opts
330
+ else
331
+ argv.push opts
332
+ end
326
333
  thread = Thread.new(arg, argv){|arg, argv| spawn arg, *argv}
327
- pid = q.pop
328
334
  sc = class << thread; self; end
329
335
  sc.module_eval {
330
- define_method(:pid){ pid }
336
+ define_method(:pid){ @pid ||= q.pop }
331
337
  define_method(:spawn_status){ @spawn_status ||= value }
332
- define_method(:exitstatus){ spawn_status.exitstatus }
338
+ define_method(:exitstatus){ @exitstatus ||= spawn_status.exitstatus }
333
339
  }
334
340
  thread
335
341
  #--}}}
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.2
3
3
  specification_version: 1
4
4
  name: open4
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.9.3
7
- date: 2007-03-26 00:00:00 -06:00
6
+ version: 0.9.4
7
+ date: 2007-07-11 00:00:00 -06:00
8
8
  summary: open4
9
9
  require_paths:
10
10
  - lib
@@ -29,21 +29,20 @@ post_install_message:
29
29
  authors:
30
30
  - Ara T. Howard
31
31
  files:
32
+ - gemspec.rb
32
33
  - install.rb
34
+ - lib
35
+ - lib/open4-0.9.4.rb
36
+ - lib/open4.rb
37
+ - README
33
38
  - sample
39
+ - sample/bg.rb
34
40
  - sample/block.rb
35
- - sample/simple.rb
36
41
  - sample/exception.rb
42
+ - sample/simple.rb
37
43
  - sample/spawn.rb
38
- - sample/bg.rb
39
- - sample/timeout.rb
40
44
  - sample/stdin_timeout.rb
41
- - lib
42
- - lib/open4.rb
43
- - lib/open4-0.9.3.rb
44
- - README
45
- - gemspec.rb
46
- - open4-0.9.3.gem
45
+ - sample/timeout.rb
47
46
  - white_box
48
47
  - white_box/leak.rb
49
48
  test_files: []
data/open4-0.9.3.gem DELETED
File without changes