Parent

Methods

Gherkin::Cli::Main

Public Class Methods

die(msg) click to toggle source
# File lib/gherkin/cli/main.rb, line 28
def self.die(msg)
  Trollop::die("#{msg}\nusage: gherkin COMMAND [ARGS]\nAvailable commands: #{Tools::SUB_COMMANDS.join(' ')}")
end
run(args) click to toggle source
# File lib/gherkin/cli/main.rb, line 12
def self.run(args)
  Trollop::options(args) do
    banner "Super fast gherkin parser"
    stop_on Tools::SUB_COMMANDS
  end

  cmd_name = args.shift
  die("Missing command") if cmd_name.nil?
  begin
    cmd = Tools.const_get(cmd_name.capitalize.to_sym).new(args)
    cmd.run
  rescue => e
    Trollop::die(e.message + "\n#{e.backtrace.join("\n")}\n\nCommand: #{cmd_name}")
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.