module Syncoku::Runnable

Public Instance Methods

run_command(command) click to toggle source
# File lib/syncoku/runnable.rb, line 4
def run_command(command)
  Bundler.with_clean_env {
    out = `#{command}`
    if $?.success?
      out
    else
      puts "Error running command:"
      puts command
      puts out
      exit $?.exitstatus
    end
  }
end
test_command(command) click to toggle source
# File lib/syncoku/runnable.rb, line 18
def test_command(command)
  Bundler.with_clean_env {
    `#{command} 2> /dev/null`
    $?.success?
  }
end