Class: Transpec::OptionParser
- Inherits:
-
Object
- Object
- Transpec::OptionParser
- Defined in:
- lib/transpec/option_parser.rb
Overview
rubocop:disable ClassLength
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=, pending: :convert_pending=, deprecated: :convert_deprecated_method= }
- CONFIG_ATTRS_FOR_CONVERT_TYPES =
{ example_group: :convert_example_group=, hook_scope: :convert_hook_scope=, stub_with_hash: :convert_stub_with_hash_to_allow_to_receive_and_return= }
- VALID_BOOLEAN_MATCHER_TYPES =
%w(truthy,falsey truthy,falsy true,false)
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Class Method Summary collapse
Instance Method Summary collapse
- #help ⇒ Object
-
#initialize(config = Config.new) ⇒ OptionParser
constructor
A new instance of OptionParser.
- #parse(args) ⇒ Object
Constructor Details
#initialize(config = Config.new) ⇒ OptionParser
Returns a new instance of OptionParser.
37 38 39 40 |
# File 'lib/transpec/option_parser.rb', line 37 def initialize(config = Config.new) @config = config setup_parser end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
31 32 33 |
# File 'lib/transpec/option_parser.rb', line 31 def config @config end |
Class Method Details
.available_conversion_types ⇒ Object
33 34 35 |
# File 'lib/transpec/option_parser.rb', line 33 def self.available_conversion_types CONFIG_ATTRS_FOR_KEEP_TYPES.keys end |
Instance Method Details
#help ⇒ Object
48 49 50 |
# File 'lib/transpec/option_parser.rb', line 48 def help @parser.help end |
#parse(args) ⇒ Object
42 43 44 45 46 |
# File 'lib/transpec/option_parser.rb', line 42 def parse(args) args = (args) @parser.parse!(args) args end |