Class: Dri::CLI
- Inherits:
-
Thor
- Object
- Thor
- Dri::CLI
- Defined in:
- lib/dri/cli.rb
Overview
Handle the application command line parsing and the dispatch to various command objects
Constant Summary collapse
- Error =
Error raised by this runner
Class.new(StandardError)
Class Method Summary collapse
Instance Method Summary collapse
- #faq ⇒ Object
- #help(*args) ⇒ Object
- #incidents ⇒ Object
- #init ⇒ Object
- #profile ⇒ Object
- #version ⇒ Object
Class Method Details
.exit_on_failure? ⇒ Boolean
16 17 18 |
# File 'lib/dri/cli.rb', line 16 def self.exit_on_failure? true end |
Instance Method Details
#faq ⇒ Object
84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/dri/cli.rb', line 84 def faq(*) if [:help] invoke :help, ['faq'] else begin require_relative 'commands/faq' Dri::Commands::FAQ.new().execute rescue Dri::Commands::FAQ::ExitCommand puts "Exiting faq command..." end end end |
#help(*args) ⇒ Object
20 21 22 23 24 25 |
# File 'lib/dri/cli.rb', line 20 def help(*args) font = TTY::Font.new(:doom) pastel = Pastel.new(enabled: ![:no_color]) puts pastel.yellow(font.write("DRI")) super end |
#incidents ⇒ Object
40 41 42 43 44 45 46 47 |
# File 'lib/dri/cli.rb', line 40 def incidents(*) if [:help] invoke :help, ['incidents'] else require_relative 'commands/incidents' Dri::Commands::Incidents.new().execute end end |
#init ⇒ Object
71 72 73 74 75 76 77 78 |
# File 'lib/dri/cli.rb', line 71 def init(*) if [:help] invoke :help, ['init'] else require_relative 'commands/init' Dri::Commands::Init.new().execute end end |