Class: Jets::Shim::Adapter::Command
- Inherits:
-
Base
- Object
- Base
- Jets::Shim::Adapter::Command
show all
- Defined in:
- lib/jets/shim/adapter/command.rb
Instance Attribute Summary
Attributes inherited from Base
#context, #event, #target
Instance Method Summary
collapse
Methods inherited from Base
#initialize
#log
Instance Method Details
#handle ⇒ Object
5
6
7
8
9
10
11
12
13
14
15
|
# File 'lib/jets/shim/adapter/command.rb', line 5
def handle
cmd = event[:command]
result = {stdout: "", stderr: ""}
Open3.popen3(*cmd) do |stdin, stdout, stderr, wait_thread|
result[:stdout] << stdout.read
result[:stderr] << stderr.read
result[:status] = wait_thread.value.exitstatus
end
result
end
|
#handle? ⇒ Boolean
17
18
19
|
# File 'lib/jets/shim/adapter/command.rb', line 17
def handle?
event[:command]
end
|