Sha256: 706ed1c076e4dd84e1115a8155f9980826b6c7c6e6c74347d0dd0e5051ef6123

Contents?: true

Size: 1.01 KB

Versions: 4

Compression:

Stored size: 1.01 KB

Contents

module Ecrire
  class Railtie < ::Rails::Railtie
    require 'ecrire/railtie/onboarding'
    require 'ecrire/railtie/theme'

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

    initializer 'ecrire.load_paths', before: :bootstrap_hook do |app|
      ActiveSupport::Dependencies.autoload_paths.unshift(*self.paths.autoload_paths)
      ActiveSupport::Dependencies.autoload_once_paths.unshift(*self.paths.autoload_once)
    end

    initializer 'ecrire.append_paths', before: :set_autoload_paths do |app|
      app.config.eager_load_paths.unshift *paths.eager_load
      app.config.autoload_once_paths.unshift *paths.autoload_once
      app.config.autoload_paths.unshift *paths.autoload_paths
    end

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

    if File.exist?(Dir.pwd + '/secrets.yml')
      include Ecrire::Railtie::Theme
    else
      include Ecrire::Railtie::Onboarding
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ecrire-0.23.0 lib/ecrire/railtie.rb
ecrire-0.22.1 lib/ecrire/railtie.rb
ecrire-0.21.0 lib/ecrire/railtie.rb
ecrire-0.20.0 lib/ecrire/railtie.rb