Class: TestLauncher::CLI::InputParser
- Inherits:
-
Object
- Object
- TestLauncher::CLI::InputParser
- Defined in:
- lib/test_launcher/cli/input_parser.rb
Constant Summary collapse
- ParseError =
Class.new(RuntimeError)
- BANNER =
"Find tests and run them by trying to match an individual test or the name of a test file(s).\n\nSee full README: https://github.com/petekinnecom/test_launcher\n\nUsage: `test_launcher \"search string\" [--all]`\n\nVERSION: \#{TestLauncher::VERSION}\n\n"
Instance Method Summary collapse
-
#initialize(args) ⇒ InputParser
constructor
A new instance of InputParser.
- #options ⇒ Object
- #query ⇒ Object
Constructor Details
#initialize(args) ⇒ InputParser
Returns a new instance of InputParser.
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/test_launcher/cli/input_parser.rb', line 20 def initialize(args) @query = args = {} option_parser.parse!(args) rescue OptionParser::ParseError puts "Invalid arguments" puts "----" puts option_parser exit end |
Instance Method Details
#options ⇒ Object
42 43 44 |
# File 'lib/test_launcher/cli/input_parser.rb', line 42 def end |
#query ⇒ Object
31 32 33 34 35 36 37 38 39 40 |
# File 'lib/test_launcher/cli/input_parser.rb', line 31 def query if @query.size == 0 puts option_parser exit elsif @query.size > 1 puts "Concatenating args to single string. (see https://github.com/petekinnecom/test_launcher)" end @query.join(" ") end |