Class: Fanta::Task

Inherits:
Object
  • Object
show all
Defined in:
lib/fanta/task.rb

Direct Known Subclasses

Builder, Packager

Instance Method Summary collapse

Instance Method Details

#run_command(text, options) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/fanta/task.rb', line 3

def run_command text, options
  result = `#{text}`
  
  File.open(options[:results], "w") {|f| f.write result }
  
  if $?.to_i == 0
    puts "Success. Results in #{options[:results]}"
    puts
  else
    fail exec "cat #{options[:results]}"
  end
end