Class | MSpecOptions |
In: |
lib/mspec/utils/options.rb
|
Parent: | Object |
MSpecOptions provides a parser for command line options. It also provides a composable set of options from which the runner scripts can select for their particular functionality.
banner | [RW] | |
config | [RW] | |
options | [RW] | |
width | [RW] |
Adds documentation text for an option and adds an MSpecOption instance to the list of registered options.
The methods below provide groups of options that are composed by the particular runners to provide their functionality
Searches all registered options to find a match for opt. Returns nil if no registered options match.
Registers an option. Acceptable formats for arguments are:
on "-a", "description" on "-a", "--abdc", "description" on "-a", "ARG", "description" on "--abdc", "ARG", "description" on "-a", "--abdc", "ARG", "description"
If an block is passed, it will be invoked when the option is matched. Not passing a block is permitted, but nonsensical.
Processes an option. Calles the on_extra block (or default) for unrecognized options. For registered options, possibly fetches an argument and invokes the option‘s block if it is not nil.