mixlib-shellout 2.0.0.rc.1-x86-mingw32 → 2.0.0.rc.2-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/mixlib/shellout/unix.rb +18 -8
- data/lib/mixlib/shellout/version.rb +1 -1
- data/lib/mixlib/shellout.rb +1 -1
- metadata +15 -23
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 39af5ac40bc171e53721fc869c53ddfacc2a5f86
|
4
|
+
data.tar.gz: 02403cde281b2f111e03a3156915dd77ea7ead4b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 3a5635f84f322b8316e317ad304e2d97d0672c5feb8f4c5bd2b18e2814b65af3124e8584cda017a0f6b19d963676e19622730ffec3da00773e95863646519650
|
7
|
+
data.tar.gz: bf78f908eae73bec95c57b61af138f0cff4b7efb1f6b32cad7882153ba0e566ccfd00e386c9720af92da7091904c049fcd7a8db221270f4a55019683db48446b
|
data/lib/mixlib/shellout/unix.rb
CHANGED
@@ -229,7 +229,7 @@ module Mixlib
|
|
229
229
|
# Some patch levels of ruby in wide use (in particular the ruby 1.8.6 on OSX)
|
230
230
|
# segfault when you IO.select a pipe that's reached eof. Weak sauce.
|
231
231
|
def open_pipes
|
232
|
-
@open_pipes ||= [child_stdout, child_stderr]
|
232
|
+
@open_pipes ||= [child_stdout, child_stderr, child_process_status]
|
233
233
|
end
|
234
234
|
|
235
235
|
# Keep this unbuffered for now
|
@@ -241,11 +241,10 @@ module Mixlib
|
|
241
241
|
|
242
242
|
def attempt_buffer_read
|
243
243
|
ready = IO.select(open_pipes, nil, nil, READ_WAIT_TIME)
|
244
|
-
if ready
|
245
|
-
read_stdout_to_buffer
|
246
|
-
|
247
|
-
|
248
|
-
read_stderr_to_buffer
|
244
|
+
if ready
|
245
|
+
read_stdout_to_buffer if ready.first.include?(child_stdout)
|
246
|
+
read_stderr_to_buffer if ready.first.include?(child_stderr)
|
247
|
+
read_process_status_to_buffer if ready.first.include?(child_process_status)
|
249
248
|
end
|
250
249
|
ready
|
251
250
|
end
|
@@ -270,6 +269,15 @@ module Mixlib
|
|
270
269
|
open_pipes.delete(child_stderr)
|
271
270
|
end
|
272
271
|
|
272
|
+
def read_process_status_to_buffer
|
273
|
+
while chunk = child_process_status.read_nonblock(READ_SIZE)
|
274
|
+
@process_status << chunk
|
275
|
+
end
|
276
|
+
rescue Errno::EAGAIN
|
277
|
+
rescue EOFError
|
278
|
+
open_pipes.delete(child_process_status)
|
279
|
+
end
|
280
|
+
|
273
281
|
def fork_subprocess
|
274
282
|
initialize_ipc
|
275
283
|
|
@@ -311,12 +319,14 @@ module Mixlib
|
|
311
319
|
# assume everything went well.
|
312
320
|
def propagate_pre_exec_failure
|
313
321
|
begin
|
314
|
-
|
322
|
+
attempt_buffer_read until child_process_status.eof?
|
323
|
+
e = Marshal.load(@process_status)
|
315
324
|
raise(Exception === e ? e : "unknown failure: #{e.inspect}")
|
316
|
-
rescue
|
325
|
+
rescue ArgumentError # If we get an ArgumentError error, then the exec was successful
|
317
326
|
true
|
318
327
|
ensure
|
319
328
|
child_process_status.close
|
329
|
+
open_pipes.delete(child_process_status)
|
320
330
|
end
|
321
331
|
end
|
322
332
|
|
data/lib/mixlib/shellout.rb
CHANGED
@@ -144,7 +144,7 @@ module Mixlib
|
|
144
144
|
# cmd = Mixlib::ShellOut.new("apachectl", "start", :user => 'www', :env => nil, :cwd => '/tmp')
|
145
145
|
# cmd.run_command # etc.
|
146
146
|
def initialize(*command_args)
|
147
|
-
@stdout, @stderr = '', ''
|
147
|
+
@stdout, @stderr, @process_status = '', '', ''
|
148
148
|
@live_stdout = @live_stderr = nil
|
149
149
|
@input = nil
|
150
150
|
@log_level = :debug
|
metadata
CHANGED
@@ -1,62 +1,55 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mixlib-shellout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.rc.
|
5
|
-
prerelease: 6
|
4
|
+
version: 2.0.0.rc.2
|
6
5
|
platform: x86-mingw32
|
7
6
|
authors:
|
8
7
|
- Opscode
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2014-
|
11
|
+
date: 2014-11-12 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rspec
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- - ~>
|
17
|
+
- - "~>"
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '2.0'
|
22
20
|
type: :development
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- - ~>
|
24
|
+
- - "~>"
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '2.0'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: win32-process
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- - ~>
|
31
|
+
- - "~>"
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: 0.7.1
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- - ~>
|
38
|
+
- - "~>"
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: 0.7.1
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: windows-pr
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- - ~>
|
45
|
+
- - "~>"
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: 1.2.2
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- - ~>
|
52
|
+
- - "~>"
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: 1.2.2
|
62
55
|
description: Run external commands on Unix or Windows
|
@@ -69,34 +62,33 @@ extra_rdoc_files:
|
|
69
62
|
files:
|
70
63
|
- LICENSE
|
71
64
|
- README.md
|
65
|
+
- lib/mixlib/shellout.rb
|
72
66
|
- lib/mixlib/shellout/exceptions.rb
|
73
67
|
- lib/mixlib/shellout/unix.rb
|
74
68
|
- lib/mixlib/shellout/version.rb
|
75
|
-
- lib/mixlib/shellout/windows/core_ext.rb
|
76
69
|
- lib/mixlib/shellout/windows.rb
|
77
|
-
- lib/mixlib/shellout.rb
|
70
|
+
- lib/mixlib/shellout/windows/core_ext.rb
|
78
71
|
homepage: http://wiki.opscode.com/
|
79
72
|
licenses: []
|
73
|
+
metadata: {}
|
80
74
|
post_install_message:
|
81
75
|
rdoc_options: []
|
82
76
|
require_paths:
|
83
77
|
- lib
|
84
78
|
required_ruby_version: !ruby/object:Gem::Requirement
|
85
|
-
none: false
|
86
79
|
requirements:
|
87
|
-
- -
|
80
|
+
- - ">="
|
88
81
|
- !ruby/object:Gem::Version
|
89
82
|
version: 1.9.3
|
90
83
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
91
|
-
none: false
|
92
84
|
requirements:
|
93
|
-
- -
|
85
|
+
- - ">"
|
94
86
|
- !ruby/object:Gem::Version
|
95
87
|
version: 1.3.1
|
96
88
|
requirements: []
|
97
89
|
rubyforge_project:
|
98
|
-
rubygems_version:
|
90
|
+
rubygems_version: 2.4.1
|
99
91
|
signing_key:
|
100
|
-
specification_version:
|
92
|
+
specification_version: 4
|
101
93
|
summary: Run external commands on Unix or Windows
|
102
94
|
test_files: []
|