Class: Kybus::CLI::Bot::Config::ConfigDefaultGenerator

Inherits:
FileProvider
  • Object
show all
Defined in:
lib/kybus/cli/bot/file_providers/config_default_generator.rb

Constant Summary collapse

DB_CONFIGS =
{
  'sequel' => "    name: sequel\n    endpoint: 'sqlite://${bot_name_snake_case}_botmeta.db'\n    database: 'sqlite://${bot_name_snake_case}.db'\n  SEQUEL\n  'dynamoid' => <<~DYNAMOID.chomp\n    name: json\n    storage: ./storage\n  DYNAMOID\n}.freeze\n".chomp,

Instance Method Summary collapse

Methods inherited from FileProvider

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

Constructor Details

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

Instance Method Details

#keep_filesObject



26
27
28
# File 'lib/kybus/cli/bot/file_providers/config_default_generator.rb', line 26

def keep_files
  ['models/migrations/.keep']
end

#make_contentsObject



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/kybus/cli/bot/file_providers/config_default_generator.rb', line 30

def make_contents
  "    logger:\n      stdout: yes\n      severity: debug\n    bots:\n      main:\n        pool_size: 1\n        inline_args: true\n        provider:\n          name: REPLACE_ME\n          token: REPLACE_ME\n          debug: true\n        state_repository:\n  YAML\nend\n" + db_config.gsub('${bot_name_snake_case}', bot_name_snake_case)

#saving_pathObject



22
23
24
# File 'lib/kybus/cli/bot/file_providers/config_default_generator.rb', line 22

def saving_path
  'config/config.default.yaml'
end