Sha256: a3cddfa5d8fca97eb0c8818caa4d2049891f65dd779f9ef3d73138f8c679b0a2

Contents?: true

Size: 471 Bytes

Versions: 3

Compression:

Stored size: 471 Bytes

Contents

# frozen_string_literal: true

require "rails"

module RailsHttpPreload
  class Railtie < Rails::Railtie
    initializer "rails_http_preload.middleware" do |app|
      app.config.middleware.use RailsHttpPreload::Middleware

      config.after_initialize do
        RailsHttpPreload.config.asset_host = app.config.asset_host
        RailsHttpPreload.config.default_asset_host_protocol = app.config.action_controller.default_asset_host_protocol
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rails_http_preload-0.3.0 lib/rails_http_preload/railtie.rb
rails_http_preload-0.2.0 lib/rails_http_preload/railtie.rb
rails_http_preload-0.1.0 lib/rails_http_preload/railtie.rb