mixlib-shellout 2.0.0 → 2.0.1

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,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: ae873b2fbca1dec0d26764f1c7134ab3b8a697dd
4
- data.tar.gz: a49b2add6d6151f4f5b68f626c0e7bc28f858334
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NGM3NmFiYjNlN2IwZTI3YWNiNTJiYWViODg3MTlhYTNlZjZiMzlkNg==
5
+ data.tar.gz: !binary |-
6
+ ZmQ5NDI4Nzc0MzJiOGYxNzQ1NDZkODYwZTRhZmQ4OTQ1YjYxMmVhYQ==
5
7
  SHA512:
6
- metadata.gz: 69dc3771428980ed6e4b8faac07bca0bf440abf2ed656b86ca34f332975d44a6a528071d88b258a9b6bb80ee09a7aee5ada46912b649582a7839cc277b878ded
7
- data.tar.gz: 60fb8fbb8f36e92ad612ce2b7aa0ac8d480305a79c16fd4f3f893b89e04b02c7cef7d0fdf8edb592d97d9d647f55505526de845ad7832abab4897ae3f5febba4
8
+ metadata.gz: !binary |-
9
+ NjU0MjZkMDFkNDAwMDQ3Y2I3NTJkZTVhMTQ5MTc3MzY1MTBhMzU0ZWZlYjAx
10
+ NjBlMTU2ZmRiODAyNjI4ODlkOWEzYmFiNzJjNzc3YTg5NWQ4MzVmZDViM2Iw
11
+ YWQyMWIyNTcxYjUxNjVjNTk4YjdiNGJkYjc2NmE4YzhhYjlkZjI=
12
+ data.tar.gz: !binary |-
13
+ MmE4ZjAxOGU0ZGM3OTY3M2EyZmExMjJkODI1ZDE0YmQwZDU4ZGY0YzQyYThh
14
+ MzI1NDdkMTc3MGFkNGQwZDA5NmJjMzg2NmFhNWQzOWExMDczZTFkZWQ5NzVh
15
+ YWVlNjRlNTEyN2VlMDU1YTY3M2I5NDFlZDI3NTk2OTU5ZTk1YWQ=
@@ -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'")
@@ -1,5 +1,5 @@
1
1
  module Mixlib
2
2
  class ShellOut
3
- VERSION = "2.0.0"
3
+ VERSION = "2.0.1"
4
4
  end
5
5
  end
@@ -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
- @live_stream << next_chunk if @live_stream
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.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-01 00:00:00.000000000 Z
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.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