class Praegustator::CLI

Public Class Methods

exit_on_failure?() click to toggle source
# File lib/praegustator/cli.rb, line 6
def self.exit_on_failure?
  true
end

Public Instance Methods

init(spec_dir ='spec') click to toggle source
# File lib/praegustator/cli.rb, line 36
def init(spec_dir ='spec')
  Praegustator::Setup.new.init(spec_dir)
end
taste(query,check) click to toggle source
# File lib/praegustator/cli.rb, line 15
def taste(query,check)
  config_file_path = Dir.pwd+"/.praegustator.yml"
  Praegustator.configure_with config_file_path
  Praegustator::Executor.new.execute_check(query,check)
  exit 1 if Praegustator.reporter.status == 'failed'
end
validate(*recipes) click to toggle source
# File lib/praegustator/cli.rb, line 23
def validate(*recipes)
  config_file_path = Dir.pwd+"/.praegustator.yml"
  Praegustator.configure_with config_file_path
  recipes_dir = Praegustator.config['spec']['recipes_dir']
  recipes = Dir[Dir.pwd+"/#{recipes_dir}/**/*_recipe.rb"] if recipes.empty?
  Praegustator::Executor.new.execute(recipes)

  Praegustator.reporter.status
  exit 1 if Praegustator.reporter.status == 'failed'
end