Class: Transpec::OptionParser
- Inherits:
-
Object
- Object
- Transpec::OptionParser
- Defined in:
- lib/transpec/option_parser.rb
Constant Summary collapse
- CONFIG_ATTRS_FOR_KEEP_TYPES =
{ should: :convert_should=, oneliner: :convert_oneliner=, should_receive: :convert_should_receive=, stub: :convert_stub=, have_items: :convert_have_items=, its: :convert_its=, deprecated: :convert_deprecated_method= }
- VALID_BOOLEAN_MATCHER_TYPES =
%w(truthy,falsey truthy,falsy true,false)
Instance Attribute Summary collapse
-
#configuration ⇒ Object
readonly
Returns the value of attribute configuration.
Class Method Summary collapse
Instance Method Summary collapse
- #help ⇒ Object
-
#initialize(configuration = Configuration.new) ⇒ OptionParser
constructor
A new instance of OptionParser.
- #parse(args) ⇒ Object
Constructor Details
#initialize(configuration = Configuration.new) ⇒ OptionParser
Returns a new instance of OptionParser.
32 33 34 35 |
# File 'lib/transpec/option_parser.rb', line 32 def initialize(configuration = Configuration.new) @configuration = configuration setup_parser end |
Instance Attribute Details
#configuration ⇒ Object (readonly)
Returns the value of attribute configuration.
26 27 28 |
# File 'lib/transpec/option_parser.rb', line 26 def configuration @configuration end |
Class Method Details
.available_conversion_types ⇒ Object
28 29 30 |
# File 'lib/transpec/option_parser.rb', line 28 def self.available_conversion_types CONFIG_ATTRS_FOR_KEEP_TYPES.keys end |
Instance Method Details
#help ⇒ Object
43 44 45 |
# File 'lib/transpec/option_parser.rb', line 43 def help @parser.help end |
#parse(args) ⇒ Object
37 38 39 40 41 |
# File 'lib/transpec/option_parser.rb', line 37 def parse(args) args = (args) @parser.parse!(args) args end |