Class: Discharger::SetupRunner::Commands::PgToolsCommand
- Inherits:
-
BaseCommand
- Object
- BaseCommand
- Discharger::SetupRunner::Commands::PgToolsCommand
show all
- Defined in:
- lib/discharger/setup_runner/commands/pg_tools_command.rb
Constant Summary
collapse
- TOOLS =
%w[pg_dump psql].freeze
Instance Attribute Summary
Attributes inherited from BaseCommand
#app_root, #config, #logger
Instance Method Summary
collapse
Methods inherited from BaseCommand
#initialize
Instance Method Details
#can_execute? ⇒ Boolean
15
16
17
|
# File 'lib/discharger/setup_runner/commands/pg_tools_command.rb', line 15
def can_execute?
config.respond_to?(:database) && config.database&.name.present?
end
|
#description ⇒ Object
11
12
13
|
# File 'lib/discharger/setup_runner/commands/pg_tools_command.rb', line 11
def description
"Setting up PostgreSQL tools wrappers"
end
|
#execute ⇒ Object
19
20
21
22
23
|
# File 'lib/discharger/setup_runner/commands/pg_tools_command.rb', line 19
def execute
create_pg_tools_directory
TOOLS.each { |tool| create_wrapper(tool) }
create_envrc_if_needed
end
|