class SubshellCommand::Command

Attributes

command_string[R]
current_directory[R]
env_hash[R]
failure_callback[R]
redirect_stderr_to_stdout[R]
success_callback[R]

Public Class Methods

new(command_string) click to toggle source
# File lib/subshell_command.rb, line 11
def initialize(command_string)
  @command_string = command_string
  @env_hash = {}
  @current_directory = Dir.pwd
  @success_callback = ->{}
  @failure_callback = ->{}
  @redirect_stderr_to_stdout = false
end

Public Instance Methods

cmd=(command_string) click to toggle source
# File lib/subshell_command.rb, line 20
def cmd=(command_string)
  @command_string = command_string
end
current_directory=(directory_string) click to toggle source
# File lib/subshell_command.rb, line 28
def current_directory=(directory_string)
  @current_directory = directory_string
end
env=(env_hash) click to toggle source
# File lib/subshell_command.rb, line 24
def env=(env_hash)
  @env_hash = env_hash
end
on_failure=(callback) click to toggle source
# File lib/subshell_command.rb, line 36
def on_failure=(callback)
  @failure_callback = callback
end
on_success=(callback) click to toggle source
# File lib/subshell_command.rb, line 32
def on_success=(callback)
  @success_callback = callback
end
redirect_stderr_to_stdout=(value) click to toggle source
# File lib/subshell_command.rb, line 40
def redirect_stderr_to_stdout=(value)
  @redirect_stderr_to_stdout = value
end