Sha256: 0b5d650c058a4003a83b12ebce24351e9e4d48bba8489bf92ca7c82df51e8633

Contents?: true

Size: 922 Bytes

Versions: 3

Compression:

Stored size: 922 Bytes

Contents

# frozen_string_literal: true

require "rails"

module Roadie
  module Rails
    class Railtie < ::Rails::Railtie
      config.roadie = Roadie::Rails::Options.new

      initializer "roadie-rails.setup" do |app|
        config.roadie.asset_providers = [
          Roadie::FilesystemProvider.new(::Rails.root.join("public").to_s)
        ]

        if app.config.respond_to?(:assets) && app.config.assets
          if app.assets
            config.roadie.asset_providers << AssetPipelineProvider.new(app.assets)
          elsif defined?(Propshaft)
            config.after_initialize do |app|
              config.roadie.asset_providers << AssetPropshaftProvider.new(app.assets)
            end
          else
            app.config.assets.configure do |env|
              config.roadie.asset_providers <<
                AssetPipelineProvider.new(env)
            end
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 2 versions & 2 rubygems

Version Path
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.1.0/gems/roadie-rails-3.3.0/lib/roadie/rails/railtie.rb
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.3.0/gems/roadie-rails-3.3.0/lib/roadie/rails/railtie.rb
roadie-rails-3.3.0 lib/roadie/rails/railtie.rb