Sha256: da369802666415cdab6c388c3165499eaf0d8fced68abdd4d83f29babdfe00ae

Contents?: true

Size: 1018 Bytes

Versions: 6

Compression:

Stored size: 1018 Bytes

Contents

module RailsExternalAssets
  module Rails
    class Railtie < ::Rails::Railtie
      rake_tasks do
        load 'rails_external_assets/tasks/assets.rake'
      end

      initializer 'rails_external_assets.initialize' do |app|
        ActionView::Base.send :include, ViewHelpers

        if app.config.respond_to?(:assets)
          app.config.assets.configure do |env|
            env.prepend_path(File.join('public', RailsExternalAssets.config.base_path))
            RailsExternalAssets.config.sprockets_directives.each do |directive|
              env.register_preprocessor directive[:mime_type], RailsExternalAssets::Sprockets::DirectiveProcessor.new(comments: directive[:comments])
            end
          end
        else
          RailsExternalAssets.config.sprockets_directives.each do |directive|
            app.assets.register_preprocessor directive[:mime_type], RailsExternalAssets::Sprockets::DirectiveProcessor.new(comments: directive[:comments])
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rails_external_assets-0.6.0 lib/rails_external_assets/rails/railtie.rb
rails_external_assets-0.5.0 lib/rails_external_assets/rails/railtie.rb
rails_external_assets-0.4.0 lib/rails_external_assets/rails/railtie.rb
rails_external_assets-0.3.1 lib/rails_external_assets/rails/railtie.rb
rails_external_assets-0.3.0 lib/rails_external_assets/rails/railtie.rb
rails_external_assets-0.2.0 lib/rails_external_assets/rails/railtie.rb