Sha256: 16055d782573aa56fbd24193ccef138d33e6e97a093a7a9456f1f2f007feb808

Contents?: true

Size: 908 Bytes

Versions: 3

Compression:

Stored size: 908 Bytes

Contents

require 'warden'
require 'pg'
require 's3'
require 'kaminari'
require 'observejs'

module Ecrire
  class Application < Rails::Application
    require 'ecrire/config/environment'

    alias :require_environment! :initialize!

    initializer 'ecrire.secrets', before: :bootstrap_hook do |app|
      app.paths.add 'config/secrets', with: Dir.pwd + '/secrets.yml'
    end

    Rails.application.paths.add 'config/database', with: Dir.pwd + '/secrets.yml'

    if File.exist?(Dir.pwd + '/secrets.yml')
      require 'ecrire/theme/engine'
    else
      require 'ecrire/onboarding/engine'
    end

    def paths
      @paths ||= begin
         paths = super
         paths.add 'config/routes.rb', with: 'routes.rb'
         paths.add 'config/locales', with: 'locales', glob: "**/*.{rb,yml}"
         paths
       end
    end

    def self.onboarding?
      defined?(Ecrire::Onboarding::Engine)
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ecrire-0.25.2 lib/ecrire/application.rb
ecrire-0.25.1 lib/ecrire/application.rb
ecrire-0.25.0 lib/ecrire/application.rb