Sha256: 84ba3ce80393affcbc93513f604f90688511df76d4063e1aa96780a2a9477b15

Contents?: true

Size: 678 Bytes

Versions: 5

Compression:

Stored size: 678 Bytes

Contents

# frozen_string_literal: true

require_relative "middleware"
module Masks
  # The Rails engine/railtie for Masks.
  #
  # Adds two initializers:
  #
  # - masks.assets.precompile - ensures masks assets are precompiled and added to the Rails asset pipeline
  # - masks.middleware - appends +Masks::Middleware+ to the middleware chain
  #
  class Engine < ::Rails::Engine
    isolate_namespace Masks

    initializer "masks.assets.precompile" do |app|
      app.config.assets.precompile += %w[masks_manifest.js] if app.config.try(
        :assets
      )
    end

    initializer "masks.middleware" do |app|
      app.config.app_middleware.use Masks::Middleware
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
masks-0.4.0 lib/masks/engine.rb
masks-0.3.2 lib/masks/engine.rb
masks-0.3.1 lib/masks/engine.rb
masks-0.3.0 lib/masks/engine.rb
masks-0.2.0 lib/masks/engine.rb