Sha256: 01fc8f4e6bc48d8921b361b060f2c340f3b860f729ca1f87916d27c4fee5ae06

Contents?: true

Size: 1.23 KB

Versions: 8

Compression:

Stored size: 1.23 KB

Contents

module Auther
  class Engine < ::Rails::Engine
    isolate_namespace Auther

    # Set defaults. Can be overwritten in app config.
    config.auther_settings = {}

    # Autoload presenters
    config.to_prepare do
      Dir.glob(Engine.root + "app/presenters/**/*.rb").each do |presenter|
        require_dependency presenter
      end
    end

    initializer "auther.initialize" do |app|
      asset_paths = app.config.assets.paths

      # Add jQuery assets.
      add_asset_paths asset_paths, "jquery-rails", "javascripts"

      # Add Modernizr assets.
      add_asset_paths asset_paths, "modernizr-rails", "javascripts"

      # Add Zurb Foundation assets.
      add_asset_paths asset_paths, "foundation-rails", "javascripts"
      add_asset_paths asset_paths, "foundation-rails", "stylesheets"

      # Configure log filter parameters.
      app.config.filter_parameters += [:login, :password]

      # Initialize Gatekeeper middleware.
      app.config.app_middleware.use Auther::Gatekeeper, app.config.auther_settings
    end

    private

    def full_gem_path name
      Gem.loaded_specs[name].full_gem_path
    end

    def add_asset_paths paths, name, directory
      paths << "#{full_gem_path name}/vendor/assets/#{directory}"
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
auther-4.1.0 lib/auther/engine.rb
auther-4.0.0 lib/auther/engine.rb
auther-3.2.0 lib/auther/engine.rb
auther-3.1.0 lib/auther/engine.rb
auther-3.0.0 lib/auther/engine.rb
auther-2.2.0 lib/auther/engine.rb
auther-2.1.0 lib/auther/engine.rb
auther-2.0.0 lib/auther/engine.rb