Class: Dragnet::CLI::Base
- Inherits:
-
Thor
- Object
- Thor
- Dragnet::CLI::Base
- Includes:
- Thor::Actions
- Defined in:
- lib/dragnet/cli/base.rb
Overview
Base class for all CLI classes.
Direct Known Subclasses
Constant Summary collapse
- E_CONFIG_LOAD_ERROR =
Exit status codes
1
Instance Attribute Summary collapse
-
#configuration ⇒ Object
readonly
Returns the value of attribute configuration.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
Class Method Summary collapse
-
.exit_on_failure? ⇒ Boolean
Tells Thor to return an unsuccessful return code (different from 0) if an error is raised.
Instance Method Summary collapse
-
#initialize(*args) ⇒ Base
constructor
Creates a new instance of the class.
Constructor Details
#initialize(*args) ⇒ Base
Creates a new instance of the class. Called by Thor when a command is executed. Creates a logger for the class passing Thor's shell to it (Thor's shell handles the output to the console)
37 38 39 40 |
# File 'lib/dragnet/cli/base.rb', line 37 def initialize(*args) super @logger = Dragnet::CLI::Logger.new(shell) end |
Instance Attribute Details
#configuration ⇒ Object (readonly)
Returns the value of attribute configuration.
20 21 22 |
# File 'lib/dragnet/cli/base.rb', line 20 def configuration @configuration end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
20 21 22 |
# File 'lib/dragnet/cli/base.rb', line 20 def logger @logger end |
Class Method Details
.exit_on_failure? ⇒ Boolean
Tells Thor to return an unsuccessful return code (different from 0) if an error is raised.
30 31 32 |
# File 'lib/dragnet/cli/base.rb', line 30 def self.exit_on_failure? true end |