Class: Cardio::Commands::RspecCommand::Parser

Inherits:
OptionParser
  • Object
show all
Defined in:
lib/cardio/commands/rspec_command/parser.rb

Overview

parse decko/card -specific options for RSpec

Constant Summary collapse

RSPEC_PATH_MESSAGE =
"\nDECKO ARGS\n\nYou don't have to give a full path for FILENAME; the basename is enough.\nIf FILENAME does not include '_spec', then rspec searches for the\ncorresponding spec file.\nThe line number always refers to the example in the spec file.\n\n".freeze
RSPEC_BANNER =
"\nUsage: decko rspec [DECKO ARGS] -- [RSPEC ARGS]\n\nRSPEC ARGS\n\n".freeze
DESC =
{
  d: "Run spec for a Decko deck file",
  c: "Run spec for a Decko core file",
  m: "Run all specs for a mod or matching a mod"
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(opts) ⇒ Parser

Returns a new instance of Parser.



35
36
37
38
39
40
41
42
43
44
# File 'lib/cardio/commands/rspec_command/parser.rb', line 35

def initialize opts
  super() do |parser|
    parser.banner = RSPEC_BANNER
    parser.separator RSPEC_PATH_MESSAGE

    file_options parser, opts
    other_options parser, opts
    parser.separator "\n"
  end
end