Class: Discharger::SetupRunner::PreCommands::BasePreCommand
- Inherits:
-
Object
- Object
- Discharger::SetupRunner::PreCommands::BasePreCommand
- Defined in:
- lib/discharger/setup_runner/pre_commands/base_pre_command.rb
Overview
Base class for pre-Rails commands. These commands run BEFORE bundler/Rails loads, so they must be pure Ruby with no gem dependencies.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
- #description ⇒ Object
- #execute ⇒ Object
-
#initialize(config = {}) ⇒ BasePreCommand
constructor
A new instance of BasePreCommand.
Constructor Details
#initialize(config = {}) ⇒ BasePreCommand
Returns a new instance of BasePreCommand.
14 15 16 |
# File 'lib/discharger/setup_runner/pre_commands/base_pre_command.rb', line 14 def initialize(config = {}) @config = config end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
12 13 14 |
# File 'lib/discharger/setup_runner/pre_commands/base_pre_command.rb', line 12 def config @config end |
Instance Method Details
#description ⇒ Object
22 23 24 |
# File 'lib/discharger/setup_runner/pre_commands/base_pre_command.rb', line 22 def description self.class.name.split("::").last.gsub(/PreCommand$/, "").gsub(/([a-z])([A-Z])/, '\1 \2') end |
#execute ⇒ Object
18 19 20 |
# File 'lib/discharger/setup_runner/pre_commands/base_pre_command.rb', line 18 def execute raise NotImplementedError, "#{self.class} must implement #execute" end |