Class: Ecrire::Configuration

Inherits:
Rails::Application::Configuration
  • Object
show all
Defined in:
lib/ecrire/configuration.rb

Instance Method Summary collapse

Instance Method Details

#database_configurationObject



32
33
34
35
36
# File 'lib/ecrire/configuration.rb', line 32

def database_configuration
  {
    Rails.env => Ecrire::Application.secrets.database
  }
end

#pathsObject

Return paths based off Rails default plus some customization.

These paths are Ecrire’s, not the users’s theme.

For the user’s paths, look at Ecrire::Theme::Engine.paths



19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/ecrire/configuration.rb', line 19

def paths
  @paths ||= begin
     paths = super
     paths.add 'config/secrets', with: Ecrire::Theme.path + 'secrets.yml'
     paths.add 'config/database', with: Ecrire::Theme.path + 'secrets.yml'
     paths.add 'config/routes.rb', with: 'routes.rb'
     paths.add 'config/locales', with: 'locales', glob: "**/*.{rb,yml}"

     paths.add 'lib/tasks', with: 'tasks', glob: '**/*.rake'
     paths
   end
end

#secret_key_baseObject



4
5
6
# File 'lib/ecrire/configuration.rb', line 4

def secret_key_base
  SecureRandom.hex(16)
end

#secret_tokenObject



8
9
10
# File 'lib/ecrire/configuration.rb', line 8

def secret_token
  SecureRandom.hex(16)
end