class Dk::DryRunner

Public Class Methods

new(config, *args) click to toggle source

run with disabled cmds, just log actions, but run all sub-tasks

Calls superclass method Dk::ConfigRunner::new
# File lib/dk/dry_runner.rb, line 11
def initialize(config, *args)
  super(config, *args)
  config.dry_tree_cmd_stubs.each do |s|
    self.stub_cmd(s.cmd_str_proc, {
      :input => s.input_proc,
      :opts  => s.given_opts_proc
    }, &s.block)
  end
  config.dry_tree_ssh_stubs.each do |s|
    self.stub_ssh(s.cmd_str_proc, {
      :input => s.input_proc,
      :opts  => s.given_opts_proc
    }, &s.block)
  end
end

Private Instance Methods

has_the_stubs_build_local_cmd(cmd_str, given_opts) click to toggle source
# File lib/dk/dry_runner.rb, line 29
def has_the_stubs_build_local_cmd(cmd_str, given_opts)
  given_opts ||= {}
  cmd_klass = given_opts[:dry_tree_run] ? Local::Cmd : Local::CmdSpy
  cmd_klass.new(cmd_str, given_opts)
end
has_the_stubs_build_remote_cmd(cmd_str, ssh_opts) click to toggle source
# File lib/dk/dry_runner.rb, line 35
def has_the_stubs_build_remote_cmd(cmd_str, ssh_opts)
  ssh_opts ||= {}
  cmd_klass = ssh_opts[:dry_tree_run] ? Remote::Cmd : Remote::CmdSpy
  cmd_klass.new(cmd_str, ssh_opts)
end