mixlib-shellout 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/lib/mixlib/shellout.rb +11 -0
- data/lib/mixlib/shellout/version.rb +1 -1
- data/lib/mixlib/shellout/windows.rb +7 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
NGM3NmFiYjNlN2IwZTI3YWNiNTJiYWViODg3MTlhYTNlZjZiMzlkNg==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
ZmQ5NDI4Nzc0MzJiOGYxNzQ1NDZkODYwZTRhZmQ4OTQ1YjYxMmVhYQ==
|
5
7
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
NjU0MjZkMDFkNDAwMDQ3Y2I3NTJkZTVhMTQ5MTc3MzY1MTBhMzU0ZWZlYjAx
|
10
|
+
NjBlMTU2ZmRiODAyNjI4ODlkOWEzYmFiNzJjNzc3YTg5NWQ4MzVmZDViM2Iw
|
11
|
+
YWQyMWIyNTcxYjUxNjVjNTk4YjdiNGJkYjc2NmE4YzhhYjlkZjI=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
MmE4ZjAxOGU0ZGM3OTY3M2EyZmExMjJkODI1ZDE0YmQwZDU4ZGY0YzQyYThh
|
14
|
+
MzI1NDdkMTc3MGFkNGQwZDA5NmJjMzg2NmFhNWQzOWExMDczZTFkZWQ5NzVh
|
15
|
+
YWVlNjRlNTEyN2VlMDU1YTY3M2I5NDFlZDI3NTk2OTU5ZTk1YWQ=
|
data/lib/mixlib/shellout.rb
CHANGED
@@ -130,6 +130,17 @@ module Mixlib
|
|
130
130
|
# total amount of time that ShellOut waited on the child process without
|
131
131
|
# receiving any output (i.e., IO.select returned nil). Default is 60
|
132
132
|
# seconds. Note: the stdlib Timeout library is not used.
|
133
|
+
# * +input+: A String of data to be passed to the subcommand. This is
|
134
|
+
# written to the child process' stdin stream before the process is
|
135
|
+
# launched. The child's stdin stream will be a pipe, so the size of input
|
136
|
+
# data should not exceed the system's default pipe capacity (4096 bytes
|
137
|
+
# is a safe value, though on newer Linux systems the capacity is 64k by
|
138
|
+
# default).
|
139
|
+
# * +live_stream+: An IO or Logger-like object (must respond to the append
|
140
|
+
# operator +<<+) that will receive data as ShellOut reads it from the
|
141
|
+
# child process. Generally this is used to copy data from the child to
|
142
|
+
# the parent's stdout so that users may observe the progress of
|
143
|
+
# long-running commands.
|
133
144
|
# === Examples:
|
134
145
|
# Invoke find(1) to search for .rb files:
|
135
146
|
# find = Mixlib::ShellOut.new("find . -name '*.rb'")
|
@@ -111,6 +111,12 @@ module Mixlib
|
|
111
111
|
when WAIT_TIMEOUT
|
112
112
|
# Kill the process
|
113
113
|
if (Time.now - start_wait) > timeout
|
114
|
+
begin
|
115
|
+
Process.kill(:KILL, process.process_id)
|
116
|
+
rescue Errno::EIO
|
117
|
+
logger.warn("Failed to kill timed out process #{process.process_id}") if logger
|
118
|
+
end
|
119
|
+
|
114
120
|
raise Mixlib::ShellOut::CommandTimeout, "command timed out:\n#{format_for_exception}"
|
115
121
|
end
|
116
122
|
|
@@ -156,7 +162,7 @@ module Mixlib
|
|
156
162
|
begin
|
157
163
|
next_chunk = stdout_read.readpartial(READ_SIZE)
|
158
164
|
@stdout << next_chunk
|
159
|
-
@
|
165
|
+
@live_stdout << next_chunk if @live_stdout
|
160
166
|
rescue EOFError
|
161
167
|
stdout_read.close
|
162
168
|
open_streams.delete(stdout_read)
|
metadata
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mixlib-shellout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Opscode
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '2.0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '2.0'
|
27
27
|
description: Run external commands on Unix or Windows
|
@@ -49,17 +49,17 @@ require_paths:
|
|
49
49
|
- lib
|
50
50
|
required_ruby_version: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ! '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 1.9.3
|
55
55
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
56
56
|
requirements:
|
57
|
-
- -
|
57
|
+
- - ! '>='
|
58
58
|
- !ruby/object:Gem::Version
|
59
59
|
version: '0'
|
60
60
|
requirements: []
|
61
61
|
rubyforge_project:
|
62
|
-
rubygems_version: 2.4.
|
62
|
+
rubygems_version: 2.4.1
|
63
63
|
signing_key:
|
64
64
|
specification_version: 4
|
65
65
|
summary: Run external commands on Unix or Windows
|