Sha256: 6fc20413329b866ddb2c9bd0bf4351c643d9b30b9016d8899b79f4da8c1ca1a0

Contents?: true

Size: 1.06 KB

Versions: 16

Compression:

Stored size: 1.06 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/javascripts")
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
katalyst-content-2.1.2 lib/katalyst/content/engine.rb
katalyst-content-2.1.1 lib/katalyst/content/engine.rb
katalyst-content-2.1.0 lib/katalyst/content/engine.rb
katalyst-content-2.0.1 lib/katalyst/content/engine.rb
katalyst-content-2.0.0 lib/katalyst/content/engine.rb
katalyst-content-1.1.1 lib/katalyst/content/engine.rb
katalyst-content-1.1.0 lib/katalyst/content/engine.rb
katalyst-content-1.0.2 lib/katalyst/content/engine.rb
katalyst-content-1.0.1 lib/katalyst/content/engine.rb
katalyst-content-1.0.0 lib/katalyst/content/engine.rb
katalyst-content-0.2.2 lib/katalyst/content/engine.rb
katalyst-content-0.2.1 lib/katalyst/content/engine.rb
katalyst-content-0.2.0 lib/katalyst/content/engine.rb
katalyst-content-0.1.2 lib/katalyst/content/engine.rb
katalyst-content-0.1.1 lib/katalyst/content/engine.rb
katalyst-content-0.1.0 lib/katalyst/content/engine.rb