Class: Kybus::CLI::Bot::Config::DeploymentFileProvide
- Inherits:
-
FileProvider
- Object
- FileProvider
- Kybus::CLI::Bot::Config::DeploymentFileProvide
show all
- Defined in:
- lib/kybus/cli/bot/file_providers/deployment_file_provider.rb
Instance Method Summary
collapse
autoregister!, #bot_name, #bot_name_class, #bot_name_constantize, #bot_name_snake_case, #generate, #initialize, #keep_files
Instance Method Details
#generate_secret_token ⇒ Object
32
33
34
|
# File 'lib/kybus/cli/bot/file_providers/deployment_file_provider.rb', line 32
def generate_secret_token
SecureRandom.alphanumeric(64)
end
|
#make_contents ⇒ Object
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/kybus/cli/bot/file_providers/deployment_file_provider.rb', line 19
def make_contents
<<~YAML
name: #{bot_name_snake_case}
cloud_provider: #{@config[:cloud_provider]}
dynamo:
capacity: #{@config[:dynamo_capacity]}
table_name: #{@config[:dynamo_table]}
chat_provider: #{@config[:bot_provider]}
bot_token: #{@config[:bot_token]}
secret_token: #{generate_secret_token}
YAML
end
|
#saving_path ⇒ Object
11
12
13
|
# File 'lib/kybus/cli/bot/file_providers/deployment_file_provider.rb', line 11
def saving_path
'./kybusbot.yaml'
end
|
#skip_file? ⇒ Boolean
15
16
17
|
# File 'lib/kybus/cli/bot/file_providers/deployment_file_provider.rb', line 15
def skip_file?
!@config[:with_deployment_file]
end
|