Class: FWToolkit::Executable::ThorRunner

Inherits:
Object
  • Object
show all
Defined in:
lib/fwtoolkit/executable/executable.rb

Instance Method Summary collapse

Instance Method Details

#report_error(command, command_output) ⇒ Object

Raises:

  • (Thor::Error)


9
10
11
12
13
14
# File 'lib/fwtoolkit/executable/executable.rb', line 9

def report_error(command, command_output)
  command_output.gsub!(/e\[\d+m/, '') #Stripping colors
  say "An error has occured while running: \"#{command}\"", :red
  say 'Command output:'
  raise Thor::Error, "\n***\n#{command_output}***"
end

#run(command, config = {}) ⇒ Object



5
6
7
# File 'lib/fwtoolkit/executable/executable.rb', line 5

def run(command, config={})
  Thor::Actions::run(command, config)
end