Class: DTAS::Source::Cmd
- Inherits:
-
Object
- Object
- DTAS::Source::Cmd
- Includes:
- Command, Process, DTAS::Serialize, Common
- Defined in:
- lib/dtas/source/cmd.rb
Overview
:nodoc:
Constant Summary collapse
- SIVS =
%w(command env)
Constants included from Process
Constants included from Command
Instance Attribute Summary
Attributes included from Common
#dst, #dst_zero_byte, #requeued
Attributes included from Command
#command, #env, #pid, #spawn_at, #to_io
Instance Method Summary collapse
-
#initialize(command) ⇒ Cmd
constructor
A new instance of Cmd.
- #source_dup ⇒ Object
- #spawn(format, rg_state, opts) ⇒ Object
- #to_hash ⇒ Object (also: #to_hsh)
Methods included from DTAS::Serialize
Methods included from Common
Methods included from Process
#dtas_spawn, #env_expand, #qx, reaper
Methods included from XS
Methods included from Command
#command_init, #command_string, #on_death
Constructor Details
#initialize(command) ⇒ Cmd
Returns a new instance of Cmd.
18 19 20 |
# File 'lib/dtas/source/cmd.rb', line 18 def initialize(command) command_init(command: command) end |
Instance Method Details
#source_dup ⇒ Object
22 23 24 25 26 |
# File 'lib/dtas/source/cmd.rb', line 22 def source_dup rv = self.class.new SIVS.each { |iv| rv.__send__("#{iv}=", self.__send__(iv)) } rv end |
#spawn(format, rg_state, opts) ⇒ Object
34 35 36 37 38 |
# File 'lib/dtas/source/cmd.rb', line 34 def spawn(format, rg_state, opts) raise "BUG: #{self.inspect}#spawn called twice" if @to_io e = format.to_env @pid = dtas_spawn(e.merge!(@env), command_string, opts) end |
#to_hash ⇒ Object Also known as: to_hsh
28 29 30 |
# File 'lib/dtas/source/cmd.rb', line 28 def to_hash ivars_to_hash(SIVS) end |