Class: MockWS::CLI::MainCommand
- Inherits:
-
Thor
- Object
- Thor
- MockWS::CLI::MainCommand
- Defined in:
- lib/mockws/cli.rb
Overview
The CLI Command structure for Thor
Class Method Summary collapse
-
.exit_on_failure? ⇒ Boolean
callback for managing ARGV errors.
Instance Method Summary collapse
-
#initialize(*args) ⇒ MainCommand
constructor
A new instance of MainCommand.
- #sanitycheck ⇒ Object
- #start ⇒ Object
- #status ⇒ Object
- #stop ⇒ Object
Constructor Details
#initialize(*args) ⇒ MainCommand
Returns a new instance of MainCommand.
9 10 11 12 13 14 15 16 17 |
# File 'lib/mockws/cli.rb', line 9 def initialize(*args) super @output = Carioca::Registry.get.get_service name: :output @finisher = Carioca::Registry.get.get_service name: :finisher if [:debug] then @output.level = :debug @output.debug "DEBUG activated" end end |
Class Method Details
.exit_on_failure? ⇒ Boolean
callback for managing ARGV errors
20 21 22 |
# File 'lib/mockws/cli.rb', line 20 def self.exit_on_failure? true end |
Instance Method Details
#sanitycheck ⇒ Object
38 39 40 41 42 43 |
# File 'lib/mockws/cli.rb', line 38 def sanitycheck @finisher.secure_execute! exit_case: :sanitycheck_success do MockWS::Configuration::Checker.sanitycheck end end |
#start ⇒ Object
30 31 32 33 34 |
# File 'lib/mockws/cli.rb', line 30 def start @finisher.secure_execute! exit_case: :success_exit do MockWS::Daemon::Controller::start end end |
#status ⇒ Object
63 64 65 66 67 |
# File 'lib/mockws/cli.rb', line 63 def status @finisher.secure_execute! exit_case: :success_exit do MockWS::Daemon::Controller::status end end |
#stop ⇒ Object
52 53 54 55 56 |
# File 'lib/mockws/cli.rb', line 52 def stop @finisher.secure_execute! exit_case: :success_exit do MockWS::Daemon::Controller::stop end end |