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
- #src_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, #env_expand_ary, #env_expand_i, #qx, reaper
Methods included from DTAS::SpawnFix
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.
19 20 21 |
# File 'lib/dtas/source/cmd.rb', line 19 def initialize(command) command_init(command: command) end |
Instance Method Details
#source_dup ⇒ Object
23 24 25 26 27 |
# File 'lib/dtas/source/cmd.rb', line 23 def source_dup rv = self.class.new SIVS.each { |iv| rv.__send__("#{iv}=", self.__send__(iv)) } rv end |
#src_spawn(format, rg_state, opts) ⇒ Object
35 36 37 38 39 |
# File 'lib/dtas/source/cmd.rb', line 35 def src_spawn(format, rg_state, opts) raise "BUG: #{self.inspect}#src_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
29 30 31 |
# File 'lib/dtas/source/cmd.rb', line 29 def to_hash ivars_to_hash(SIVS) end |