Class: Tcelfer::CLI::DBTasks
- Inherits:
-
Thor
- Object
- Thor
- Tcelfer::CLI::DBTasks
- Defined in:
- lib/tcelfer/cli/db_tasks.rb
Overview
Subcommands for various database tasks
Class Method Summary collapse
-
.exit_on_failure? ⇒ Boolean
Useful return codes are nice, of course.
Instance Method Summary collapse
- #initdb ⇒ Object
-
#initialize(*_args) ⇒ DBTasks
constructor
A new instance of DBTasks.
- #migrate ⇒ Object
- #path ⇒ Object
Constructor Details
#initialize(*_args) ⇒ DBTasks
Returns a new instance of DBTasks.
21 22 23 24 25 26 |
# File 'lib/tcelfer/cli/db_tasks.rb', line 21 def initialize(*_args) # Quit on Ctrl-C please @prompt = TTY::Prompt.new(interrupt: :exit) super end |
Class Method Details
.exit_on_failure? ⇒ Boolean
Useful return codes are nice, of course
29 30 31 |
# File 'lib/tcelfer/cli/db_tasks.rb', line 29 def self.exit_on_failure? true end |
Instance Method Details
#initdb ⇒ Object
39 40 41 42 43 44 45 46 |
# File 'lib/tcelfer/cli/db_tasks.rb', line 39 def initdb Tcelfer.config.debug = [:verbose] _db_exists! if File.exist?(Tcelfer.config.sqlite_path) && !.force _db_migrate! rescue Tcelfer::Error => e @prompt.error("[#{e.class}]", e) end |