Sha256: 8bb8e72c2955111821ec7588cad70611582f2f2cd37473c16c7929cf1852320f

Contents?: true

Size: 1.17 KB

Versions: 7

Compression:

Stored size: 1.17 KB

Contents

# frozen_string_literal: true

require "katalyst/html_attributes"
require "katalyst/kpop"
require "rails/engine"

module Katalyst
  module Content
    class Engine < ::Rails::Engine
      isolate_namespace Katalyst::Content
      config.eager_load_namespaces << Katalyst::Content

      initializer "katalyst-content.factories", after: "factory_bot.set_factory_paths" do
        FactoryBot.definition_file_paths << Engine.root.join("spec/factories") if defined?(FactoryBot)
      end

      config.generators do |g|
        g.test_framework :rspec
        g.fixture_replacement :factory_bot
        g.factory_bot dir: "spec/factories"
      end

      initializer "katalyst-content.asset" do
        config.after_initialize do |app|
          if app.config.respond_to?(:assets)
            app.config.assets.precompile += %w(katalyst-content.js)
          end
        end
      end

      initializer "katalyst-content.importmap", before: "importmap" do |app|
        if app.config.respond_to?(:importmap)
          app.config.importmap.paths << root.join("config/importmap.rb")
          app.config.importmap.cache_sweepers << root.join("app/assets/builds")
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
katalyst-content-2.8.0 lib/katalyst/content/engine.rb
katalyst-content-2.7.1 lib/katalyst/content/engine.rb
katalyst-content-2.7.0 lib/katalyst/content/engine.rb
katalyst-content-2.6.2 lib/katalyst/content/engine.rb
katalyst-content-2.6.1 lib/katalyst/content/engine.rb
katalyst-content-2.6.0 lib/katalyst/content/engine.rb
katalyst-content-2.5.1 lib/katalyst/content/engine.rb