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

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

Overview

parse decko/card -specific options for RSpec

Constant Summary collapse

RSPEC_PATH_MESSAGE =
<<~MESSAGE.freeze

  #{Command.bin_name.upcase} ARGS

MESSAGE
RSPEC_BANNER =
<<~BANNER.freeze

  Usage: #{Command.bin_name} rspec [#{Command.bin_name.upcase} ARGS] -- [RSPEC ARGS]

  RSPEC ARGS

  See https://rspec.info/features/3-12/rspec-core/command-line/ or 
  run card rspec -- -hb
BANNER
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 'card/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