Sha256: 0af3eec3b51ae2f47a9b4e832d12861b74ae3ae225f11a61418f78df766491b5

Contents?: true

Size: 1.05 KB

Versions: 9

Compression:

Stored size: 1.05 KB

Contents

# frozen_string_literal: true

require "rails"

module Katalyst
  module Content
    class Engine < ::Rails::Engine
      isolate_namespace 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

9 entries across 9 versions & 1 rubygems

Version Path
katalyst-content-2.5.0 lib/katalyst/content/engine.rb
katalyst-content-2.4.2 lib/katalyst/content/engine.rb
katalyst-content-2.4.1 lib/katalyst/content/engine.rb
katalyst-content-2.3.2 lib/katalyst/content/engine.rb
katalyst-content-2.3.1 lib/katalyst/content/engine.rb
katalyst-content-2.3.0 lib/katalyst/content/engine.rb
katalyst-content-2.2.0 lib/katalyst/content/engine.rb
katalyst-content-2.1.4 lib/katalyst/content/engine.rb
katalyst-content-2.1.3 lib/katalyst/content/engine.rb