Class: Trophonius::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/trophonius_generator.rb

Instance Method Summary collapse

Instance Method Details

#copy_initializer_fileObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/generators/trophonius_generator.rb', line 14

def copy_initializer_file
  @host = options['host']
  @database = options['database']
  create_file 'config/initializers/trophonius.rb',
              "Trophonius.configure do |config|
  config.host = '#{@host}'
  config.database = '#{@database}'
  config.username = Rails.application.credentials.dig(:username) # (requires >= Rails 5.2) otherwise use old secrets
  config.password = Rails.application.credentials.dig(:password) # (requires >= Rails 5.2) otherwise use old secrets
  config.redis_connection = false # default false, true if you want to store the token in redis
  config.ssl = true # or false depending on whether https or http should be used
  config.fm_18 = true
  # USE THE NEXT OPTION WITH CAUTION
  config.local_network = false # if true the ssl certificate will not be verified to allow for self-signed certificates
end"
end