Class: Discharger::SetupRunner::PreCommands::BasePreCommand

Inherits:
Object
  • Object
show all
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.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#configObject (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

#descriptionObject



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

#executeObject

Raises:

  • (NotImplementedError)


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