Sha256: 4fd4214e4c9c1f7a27fcb87552d46c57935c0031bc5763d8274ff6494ceb76a2

Contents?: true

Size: 726 Bytes

Versions: 1

Compression:

Stored size: 726 Bytes

Contents

# frozen_string_literal: true

module Scrapbook
  # :nodoc:
  class Engine < ::Rails::Engine
    isolate_namespace Scrapbook

    config.scrapbook = ActiveSupport::OrderedOptions.new
    config.scrapbook.paths ||= []
    config.scrapbook.precompile_assets = config.scrapbook.precompile_assets || false

    initializer 'scrapbook.configuration' do |app|
      settings = app.config.scrapbook

      settings.paths << Rails.root.join('scrapbook') if settings.paths.empty?
    end

    initializer 'scrapbook.assets' do |app|
      if app.config.scrapbook.precompile_assets && app.config.respond_to?(:assets)
        app.config.assets.precompile.concat %w[
          scrapbook/tailwind.css
        ]
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
scrapbook-0.2.0 lib/scrapbook/engine.rb