Class: Kybus::CLI::Bot::Config::ConfigGenerator
- Inherits:
-
FileProvider
- Object
- FileProvider
- Kybus::CLI::Bot::Config::ConfigGenerator
- Defined in:
- lib/kybus/cli/bot/file_providers/config_generator.rb
Constant Summary collapse
- DB_CONFIGS =
{ 'sequel' => " name: sequel\n endpoint: 'sqlite://${bot_name_snake_case}_botmeta.db'\n SEQUEL\n 'dynamoid' => <<-DYNAMOID.chomp\n name: dynamoid\n dynamoid_config: true\n region: 'us-east-1'\n namespace: '${bot_name_snake_case}'\n read_capacity: 3\n write_capacity: 3\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, #keep_files, #skip_file?
Constructor Details
This class inherits a constructor from Kybus::CLI::Bot::FileProvider
Instance Method Details
#make_contents ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/kybus/cli/bot/file_providers/config_generator.rb', line 29 def make_contents " bots:\n main:\n provider:\n name: \#{@config[:bot_provider]}\n token: \#{@config[:bot_token]}\n mode: \#{@config[:with_deployment_file] && @config[:cloud_provider] == 'aws' ? 'webhook_lambda' : 'polling'}\n debug: true\n state_repository:\n YAML\nend\n" + db_config.gsub('${bot_name_snake_case}', bot_name_snake_case) |
#saving_path ⇒ Object
25 26 27 |
# File 'lib/kybus/cli/bot/file_providers/config_generator.rb', line 25 def saving_path 'config/config.yaml' end |