Sha256: 77eeb7fa41e90f96698a56e543c53e78390fce86cd37f6d4df5cce2a555746a5

Contents?: true

Size: 1.02 KB

Versions: 22

Compression:

Stored size: 1.02 KB

Contents

# frozen_string_literal: true

require "rails/engine"
require "primer/classify/utilities"

module Primer
  module ViewComponents
    # :nodoc:
    class Engine < ::Rails::Engine
      isolate_namespace Primer::ViewComponents
      config.eager_load_paths = %W[
        #{root}/app/components
        #{root}/app/lib
      ]

      config.primer_view_components = ActiveSupport::OrderedOptions.new

      config.primer_view_components.raise_on_invalid_options = false
      config.primer_view_components.silence_deprecations = false
      config.primer_view_components.validate_class_names = !Rails.env.production?
      config.primer_view_components.raise_on_invalid_aria = false

      initializer "primer_view_components.assets" do |app|
        app.config.assets.precompile += %w[primer_view_components] if app.config.respond_to?(:assets)
      end

      config.after_initialize do |app|
        ::Primer::Classify::Utilities.validate_class_names = app.config.primer_view_components.delete(:validate_class_names)
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
primer_view_components-0.0.65 lib/primer/view_components/engine.rb
primer_view_components-0.0.64 lib/primer/view_components/engine.rb