Class: RSpec::Core::Parser
- Defined in:
- lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/option_parser.rb
Instance Attribute Summary collapse
-
#original_args ⇒ Object
readonly
Returns the value of attribute original_args.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(original_args) ⇒ Parser
constructor
A new instance of Parser.
- #parse(source = nil) ⇒ Object
Constructor Details
#initialize(original_args) ⇒ Parser
Returns a new instance of Parser.
13 14 15 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/option_parser.rb', line 13 def initialize(original_args) @original_args = original_args end |
Instance Attribute Details
#original_args ⇒ Object (readonly)
Returns the value of attribute original_args.
11 12 13 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/option_parser.rb', line 11 def original_args @original_args end |
Class Method Details
.parse(args, source = nil) ⇒ Object
7 8 9 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/option_parser.rb', line 7 def self.parse(args, source=nil) new(args).parse(source) end |
Instance Method Details
#parse(source = nil) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/option_parser.rb', line 17 def parse(source=nil) return { :files_or_directories_to_run => [] } if original_args.empty? args = original_args.dup = args.delete('--tty') ? { :tty => true } : {} begin parser().parse!(args) rescue OptionParser::InvalidOption => e abort "#{e.}#{" (defined in #{source})" if source}\n\n" \ "Please use --help for a listing of valid options" end [:files_or_directories_to_run] = args end |