Class: Mammoth::Commands::BootstrapCommand
- Inherits:
-
Object
- Object
- Mammoth::Commands::BootstrapCommand
- Defined in:
- lib/mammoth/commands/bootstrap_command.rb
Overview
Initializes the configured operational SQLite database.
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
Instance Method Summary collapse
-
#call ⇒ Integer
Process-style status code.
-
#initialize(config, output: $stdout) ⇒ BootstrapCommand
constructor
A new instance of BootstrapCommand.
Constructor Details
#initialize(config, output: $stdout) ⇒ BootstrapCommand
Returns a new instance of BootstrapCommand.
11 12 13 14 |
# File 'lib/mammoth/commands/bootstrap_command.rb', line 11 def initialize(config, output: $stdout) @config = config @output = output end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
7 8 9 |
# File 'lib/mammoth/commands/bootstrap_command.rb', line 7 def config @config end |
#output ⇒ Object (readonly)
Returns the value of attribute output.
7 8 9 |
# File 'lib/mammoth/commands/bootstrap_command.rb', line 7 def output @output end |
Instance Method Details
#call ⇒ Integer
Returns process-style status code.
17 18 19 20 21 22 23 |
# File 'lib/mammoth/commands/bootstrap_command.rb', line 17 def call store = SQLiteStore.connect(config.dig("sqlite", "path")).bootstrap! output.puts "SQLite database initialized" output.puts "Path: #{store.path}" output.puts "Tables: #{store.tables.join(", ")}" 0 end |