open4 0.6.0 → 0.7.0

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.
data/README CHANGED
@@ -10,6 +10,18 @@ SYNOPSIS
10
10
 
11
11
  HISTORY
12
12
 
13
+ 0.7.0:
14
+ - merged functionality of exitstatus/status keywords:
15
+
16
+ include Open4
17
+
18
+ spawn 'ruby -e "exit 42"' # raises
19
+ spawn 'ruby -e "exit 42"', :status=>true # ok, returns status
20
+ spawn 'ruby -e "exit 42"', :status=>42 # raises if status != 42
21
+ spawn 'ruby -e "exit 42"', :status=>0,42 # raises if status != 0||42
22
+
23
+ - the 0.6.0 was broken on rubyforge... this release fixes that (somehow!?)
24
+
13
25
  0.6.0:
14
26
  - added feature for exitstatus to be list of acceptable exit statuses
15
27
 
@@ -4,7 +4,7 @@ require 'thread'
4
4
 
5
5
  module Open4
6
6
  #--{{{
7
- VERSION = '0.6.0'
7
+ VERSION = '0.7.0'
8
8
  def self.version() VERSION end
9
9
 
10
10
  class Error < ::StandardError; end
@@ -229,9 +229,9 @@ module Open4
229
229
  #--{{{
230
230
  getopt = getopts opts
231
231
 
232
- ignore_exit_failure = getopt[ 'ignore_exit_failure', getopt['status', getopt['quiet', false] ] ]
232
+ ignore_exit_failure = getopt[ 'ignore_exit_failure', getopt['quiet', false] ]
233
233
  ignore_exec_failure = getopt[ 'ignore_exec_failure', !getopt['raise', true] ]
234
- exitstatus = getopt[ %w( exitstatus exit_status status ), 0 ]
234
+ exitstatus = getopt[ %w( exitstatus exit_status status ) ]
235
235
  stdin = getopt[ %w( stdin in i 0 ) << 0 ]
236
236
  stdout = getopt[ %w( stdout out o 1 ) << 1 ]
237
237
  stderr = getopt[ %w( stderr err e 2 ) << 2 ]
@@ -240,13 +240,21 @@ module Open4
240
240
  stdin_timeout = getopt[ %w( stdin_timeout ) ]
241
241
  stdout_timeout = getopt[ %w( stdout_timeout io_timeout ) ]
242
242
  stderr_timeout = getopt[ %w( stderr_timeout ) ]
243
+ status = getopt[ %w( status ) ]
244
+
245
+ exitstatus =
246
+ case exitstatus
247
+ when TrueClass, FalseClass
248
+ ignore_exit_failure = true if exitstatus
249
+ [0]
250
+ else
251
+ [*(exitstatus || 0)].map{|i| Integer i}
252
+ end
243
253
 
244
254
  stdin ||= '' if stdin_timeout
245
255
  stdout ||= '' if stdout_timeout
246
256
  stderr ||= '' if stderr_timeout
247
257
 
248
- exitstatus = [*exitstatus]
249
-
250
258
  started = false
251
259
 
252
260
  status =
@@ -4,7 +4,7 @@ require 'thread'
4
4
 
5
5
  module Open4
6
6
  #--{{{
7
- VERSION = '0.6.0'
7
+ VERSION = '0.7.0'
8
8
  def self.version() VERSION end
9
9
 
10
10
  class Error < ::StandardError; end
@@ -229,9 +229,9 @@ module Open4
229
229
  #--{{{
230
230
  getopt = getopts opts
231
231
 
232
- ignore_exit_failure = getopt[ 'ignore_exit_failure', getopt['status', getopt['quiet', false] ] ]
232
+ ignore_exit_failure = getopt[ 'ignore_exit_failure', getopt['quiet', false] ]
233
233
  ignore_exec_failure = getopt[ 'ignore_exec_failure', !getopt['raise', true] ]
234
- exitstatus = getopt[ %w( exitstatus exit_status status ), 0 ]
234
+ exitstatus = getopt[ %w( exitstatus exit_status status ) ]
235
235
  stdin = getopt[ %w( stdin in i 0 ) << 0 ]
236
236
  stdout = getopt[ %w( stdout out o 1 ) << 1 ]
237
237
  stderr = getopt[ %w( stderr err e 2 ) << 2 ]
@@ -240,13 +240,21 @@ module Open4
240
240
  stdin_timeout = getopt[ %w( stdin_timeout ) ]
241
241
  stdout_timeout = getopt[ %w( stdout_timeout io_timeout ) ]
242
242
  stderr_timeout = getopt[ %w( stderr_timeout ) ]
243
+ status = getopt[ %w( status ) ]
244
+
245
+ exitstatus =
246
+ case exitstatus
247
+ when TrueClass, FalseClass
248
+ ignore_exit_failure = true if exitstatus
249
+ [0]
250
+ else
251
+ [*(exitstatus || 0)].map{|i| Integer i}
252
+ end
243
253
 
244
254
  stdin ||= '' if stdin_timeout
245
255
  stdout ||= '' if stdout_timeout
246
256
  stderr ||= '' if stderr_timeout
247
257
 
248
- exitstatus = [*exitstatus]
249
-
250
258
  started = false
251
259
 
252
260
  status =
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: open4
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.6.0
7
- date: 2006-08-31 00:00:00.000000 -06:00
6
+ version: 0.7.0
7
+ date: 2006-09-01 00:00:00.000000 -06:00
8
8
  summary: open4
9
9
  require_paths:
10
10
  - lib
@@ -33,7 +33,6 @@ files:
33
33
  - sample
34
34
  - lib
35
35
  - README
36
- - open4-0.6.0.gem
37
36
  - gemspec.rb
38
37
  - sample/block.rb
39
38
  - sample/simple.rb
@@ -43,7 +42,7 @@ files:
43
42
  - sample/timeout.rb
44
43
  - sample/stdin_timeout.rb
45
44
  - lib/open4.rb
46
- - lib/open4-0.6.0.rb
45
+ - lib/open4-0.7.0.rb
47
46
  test_files: []
48
47
  rdoc_options: []
49
48
  extra_rdoc_files: []
File without changes