Class: Kybus::CLI::Bot::Config::DBGenerator

Inherits:
FileProvider show all
Defined in:
lib/kybus/cli/bot/file_providers/db_generator.rb

Constant Summary collapse

DB_CONTENTS =
{
  'sequel' => <<~RUBY,
  'activerecord' => <<~RUBY,
  'dynamoid' => <<~RUBY
    def run_migrations!
      require 'kybus/bot/migrator'
      Kybus::Bot::Migrator.run_migrations!(APP_CONF['bots']['main']['state_repository'])
    end
  RUBY
}.freeze

Instance Method Summary collapse

Methods inherited from FileProvider

autoregister!, #bot_name, #bot_name_class, #bot_name_constantize, #bot_name_snake_case, #generate, #initialize, #keep_files, #skip_file?

Constructor Details

This class inherits a constructor from Kybus::CLI::Bot::FileProvider

Instance Method Details

#make_contentsObject



45
46
47
# File 'lib/kybus/cli/bot/file_providers/db_generator.rb', line 45

def make_contents
  DB_CONTENTS[@config[:db_adapter]]
end

#saving_pathObject



41
42
43
# File 'lib/kybus/cli/bot/file_providers/db_generator.rb', line 41

def saving_path
  'config_loaders/db.rb'
end