Sha256: 6cd272c4dec1fec5c2699bacc1ffe975d607514303cc1afc34fef66273aa8eac

Contents?: true

Size: 754 Bytes

Versions: 5

Compression:

Stored size: 754 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)
          else
            app.config.assets.configure do |env|
              config.roadie.asset_providers <<
                AssetPipelineProvider.new(env)
            end
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
roadie-rails-2.3.0 lib/roadie/rails/railtie.rb
roadie-rails-2.2.0 lib/roadie/rails/railtie.rb
roadie-rails-2.1.1 lib/roadie/rails/railtie.rb
roadie-rails-2.1.0 lib/roadie/rails/railtie.rb
roadie-rails-2.0.0 lib/roadie/rails/railtie.rb