Class: Cardio::Command::RspecCommand::Parser

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

Overview

parse decko/card -specific options for RSpec

Constant Summary collapse

RSPEC_PATH_MESSAGE =
"\n\#{Command.bin_name.upcase} ARGS\n\n".freeze
RSPEC_BANNER =
"\nUsage: \#{Command.bin_name} rspec [\#{Command.bin_name.upcase} ARGS] -- [RSPEC ARGS]\n\nRSPEC ARGS\n\nSee https://rspec.info/features/3-12/rspec-core/command-line/ or\nrun card rspec -- -hb\n".freeze
DESC =
{
  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.



32
33
34
35
36
37
38
39
40
41
# File 'lib/cardio/command/rspec_command/parser.rb', line 32

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