em-systemcommand 1.0.2 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/em-systemcommand.gemspec +1 -0
- data/lib/em-systemcommand.rb +6 -5
- data/lib/em-systemcommand/version.rb +1 -1
- data/spec/em-systmcommand_spec.rb +1 -1
- metadata +20 -4
data/em-systemcommand.gemspec
CHANGED
data/lib/em-systemcommand.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require '
|
1
|
+
require 'posix/spawn'
|
2
2
|
|
3
3
|
require "em-systemcommand/version"
|
4
4
|
require "em-systemcommand/pipe"
|
@@ -59,8 +59,9 @@ module EventMachine
|
|
59
59
|
@callbacks = []
|
60
60
|
@errbacks = []
|
61
61
|
|
62
|
-
stdin, stdout, stderr
|
62
|
+
pid, stdin, stdout, stderr = POSIX::Spawn.popen4 @command.to_s
|
63
63
|
|
64
|
+
@pid = pid
|
64
65
|
@stdin = attach_pipe_handler :stdin, stdin
|
65
66
|
@stdout = attach_pipe_handler :stdout, stdout
|
66
67
|
@stderr = attach_pipe_handler :stderr, stderr
|
@@ -82,13 +83,13 @@ module EventMachine
|
|
82
83
|
##
|
83
84
|
# Returns the pid of the child process.
|
84
85
|
def pid
|
85
|
-
@
|
86
|
+
@pid
|
86
87
|
end
|
87
88
|
|
88
89
|
##
|
89
|
-
# Returns the status object of the
|
90
|
+
# Returns the status object of the popen4 call.
|
90
91
|
def status
|
91
|
-
|
92
|
+
Process.waitpid2(pid)[1]
|
92
93
|
end
|
93
94
|
|
94
95
|
alias_method :success, :callback
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: em-systemcommand
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.2
|
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: 2012-06-
|
12
|
+
date: 2012-06-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
@@ -75,6 +75,22 @@ dependencies:
|
|
75
75
|
- - ! '>='
|
76
76
|
- !ruby/object:Gem::Version
|
77
77
|
version: '0'
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: posix-spawn
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
type: :runtime
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
78
94
|
- !ruby/object:Gem::Dependency
|
79
95
|
name: escape
|
80
96
|
requirement: !ruby/object:Gem::Requirement
|
@@ -147,7 +163,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
147
163
|
version: '0'
|
148
164
|
segments:
|
149
165
|
- 0
|
150
|
-
hash:
|
166
|
+
hash: 2192614786888630701
|
151
167
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
152
168
|
none: false
|
153
169
|
requirements:
|
@@ -156,7 +172,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
156
172
|
version: '0'
|
157
173
|
segments:
|
158
174
|
- 0
|
159
|
-
hash:
|
175
|
+
hash: 2192614786888630701
|
160
176
|
requirements: []
|
161
177
|
rubyforge_project:
|
162
178
|
rubygems_version: 1.8.24
|