buff-shell_out 0.1.0 → 0.1.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.
- data/.ruby-version +1 -1
- data/LICENSE +1 -1
- data/README.md +1 -1
- data/buff-shell_out.gemspec +1 -1
- data/lib/buff/shell_out.rb +3 -1
- data/lib/buff/shell_out/version.rb +1 -1
- data/spec/buff/shell_out_spec.rb +8 -0
- metadata +4 -4
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.9.3-
|
1
|
+
1.9.3-p448
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -39,6 +39,6 @@ Using it as a module
|
|
39
39
|
|
40
40
|
# Authors and Contributors
|
41
41
|
|
42
|
-
* Jamie Winsor (<
|
42
|
+
* Jamie Winsor (<jamie@vialstudios.com>)
|
43
43
|
|
44
44
|
Thank you to all of our [Contributors](https://github.com/RiotGames/buff-shell_out/graphs/contributors), testers, and users.
|
data/buff-shell_out.gemspec
CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |spec|
|
|
7
7
|
spec.name = "buff-shell_out"
|
8
8
|
spec.version = Buff::ShellOut::VERSION
|
9
9
|
spec.authors = ["Jamie Winsor"]
|
10
|
-
spec.email = ["
|
10
|
+
spec.email = ["jamie@vialstudios.com"]
|
11
11
|
spec.description = %q{A mixin for issuing shell commands and collecting the output}
|
12
12
|
spec.summary = %q{Buff up your code with a mixin for issuing shell commands and collecting the output}
|
13
13
|
spec.homepage = "https://github.com/RiotGames/buff-shell_out"
|
data/lib/buff/shell_out.rb
CHANGED
@@ -31,7 +31,9 @@ module Buff
|
|
31
31
|
begin
|
32
32
|
pid = Process.spawn(command, out: out.to_i, err: err.to_i)
|
33
33
|
pid, status = Process.waitpid2(pid)
|
34
|
-
|
34
|
+
# Check if we're getting back a process status because win32-process 6.x was a fucking MURDERER.
|
35
|
+
# https://github.com/djberg96/win32-process/blob/master/lib/win32/process.rb#L494-L519
|
36
|
+
exitstatus = status.is_a?(Process::Status) ? status.exitstatus : status
|
35
37
|
rescue Errno::ENOENT => ex
|
36
38
|
exitstatus = 127
|
37
39
|
out.write("")
|
data/spec/buff/shell_out_spec.rb
CHANGED
@@ -23,6 +23,14 @@ describe Buff::ShellOut do
|
|
23
23
|
described_class.should_receive(:mri_out).with(command)
|
24
24
|
result
|
25
25
|
end
|
26
|
+
|
27
|
+
context "when Process.waitpid2 returns an Integer instead of a Process::Status" do
|
28
|
+
before { Process.stub(:waitpid2).and_return([12345, 0]) }
|
29
|
+
|
30
|
+
it "sets the exitstatus to the returned integer" do
|
31
|
+
expect(result.exitstatus).to eql(0)
|
32
|
+
end
|
33
|
+
end
|
26
34
|
end
|
27
35
|
|
28
36
|
context "when on JRuby" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: buff-shell_out
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-10-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: buff-ruby_engine
|
@@ -173,7 +173,7 @@ dependencies:
|
|
173
173
|
version: '0'
|
174
174
|
description: A mixin for issuing shell commands and collecting the output
|
175
175
|
email:
|
176
|
-
-
|
176
|
+
- jamie@vialstudios.com
|
177
177
|
executables: []
|
178
178
|
extensions: []
|
179
179
|
extra_rdoc_files: []
|
@@ -216,7 +216,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
216
216
|
version: '0'
|
217
217
|
segments:
|
218
218
|
- 0
|
219
|
-
hash:
|
219
|
+
hash: -3294574992538716380
|
220
220
|
requirements: []
|
221
221
|
rubyforge_project:
|
222
222
|
rubygems_version: 1.8.23
|