Class: Yap::Shell::Execution::FileSystemCommandExecution

Inherits:
CommandExecution show all
Defined in:
lib/yap/shell/execution/file_system_command_execution.rb

Instance Attribute Summary

Attributes inherited from CommandExecution

#stderr, #stdin, #stdout, #world

Instance Method Summary collapse

Methods inherited from CommandExecution

#execute, #initialize, on_execute, #suspended?

Constructor Details

This class inherits a constructor from Yap::Shell::Execution::CommandExecution

Instance Method Details

#resumeObject



98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/yap/shell/execution/file_system_command_execution.rb', line 98

def resume
  args = @suspended
  @suspended = nil

  puts "Resuming: #{args[:pid]}" if ENV["DEBUG"]
  resume_blk = lambda do
    Process.kill "SIGCONT", args[:pid]
    args[:pid]
  end

  self.instance_exec command:args[:command], n:args[:n], of:args[:of], resume_blk:resume_blk, wait:true, &self.class.on_execute
end

#suspended(command:, n:, of:, pid:) ⇒ Object



111
112
113
114
115
116
117
118
119
# File 'lib/yap/shell/execution/file_system_command_execution.rb', line 111

def suspended(command:, n:, of:, pid:)
  puts "Suspending: #{pid}" if ENV["DEBUG"]
  @suspended = {
    command: command,
    n: n,
    of: of,
    pid: pid
  }
end