Class: Teaspoon::CommandLine
- Inherits:
-
Object
- Object
- Teaspoon::CommandLine
- Defined in:
- lib/teaspoon/command_line.rb
Instance Method Summary collapse
-
#initialize ⇒ CommandLine
constructor
A new instance of CommandLine.
- #opt_parser ⇒ Object
Constructor Details
#initialize ⇒ CommandLine
Returns a new instance of CommandLine.
8 9 10 11 12 13 14 15 16 |
# File 'lib/teaspoon/command_line.rb', line 8 def initialize = {} [:files] = opt_parser.parse! require_console abort if Teaspoon::Console.new().failures? rescue Teaspoon::EnvironmentNotFound => e abort("#{e.message}\nConsider using -r path/to/teaspoon_env\n") end |
Instance Method Details
#opt_parser ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/teaspoon/command_line.rb', line 18 def opt_parser OptionParser.new do |parser| @parser = parser @parser. = "Usage: teaspoon [options] [files]\n\n" opts_for_general opts_for_filtering opts_for_output opts_for_coverage opts_for_utility end end |