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.
@@ -20,6 +20,7 @@ Gem::Specification.new do |gem|
20
20
  gem.add_development_dependency 'guard-rspec'
21
21
  gem.add_development_dependency 'rake'
22
22
 
23
+ gem.add_dependency 'posix-spawn'
23
24
  gem.add_dependency 'escape'
24
25
  gem.add_dependency 'eventmachine'
25
26
  end
@@ -1,4 +1,4 @@
1
- require 'open3'
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, @wait_thr = Open3.popen3 @command.to_s
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
- @wait_thr.pid
86
+ @pid
86
87
  end
87
88
 
88
89
  ##
89
- # Returns the status object of the popen3 call.
90
+ # Returns the status object of the popen4 call.
90
91
  def status
91
- @wait_thr.value
92
+ Process.waitpid2(pid)[1]
92
93
  end
93
94
 
94
95
  alias_method :success, :callback
@@ -1,5 +1,5 @@
1
1
  module Em
2
2
  module Systemcommand
3
- VERSION = "1.0.2"
3
+ VERSION = "1.1.2"
4
4
  end
5
5
  end
@@ -107,7 +107,7 @@ describe EM::SystemCommand do
107
107
  end
108
108
  end
109
109
 
110
- it 'should pass multiple command executions', focus: true do
110
+ it 'should pass multiple command executions' do
111
111
  counter = 0
112
112
  EM.run do
113
113
  2.times do
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.0.2
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-13 00:00:00.000000000 Z
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: 1875739728938098131
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: 1875739728938098131
175
+ hash: 2192614786888630701
160
176
  requirements: []
161
177
  rubyforge_project:
162
178
  rubygems_version: 1.8.24