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
10 11 12 13 14 15 16 17 18 |
# File 'lib/teaspoon/command_line.rb', line 10 def initialize = {} [:files] = opt_parser.parse! require_console Teaspoon.abort(nil, 1) if Teaspoon::Console.new().failures? rescue Teaspoon::EnvironmentNotFound => e Teaspoon.abort("#{e.message} Consider using --require=path/to/teaspoon_env.rb") end |
Instance Method Details
#opt_parser ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/teaspoon/command_line.rb', line 20 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 |