Sha256: aa90cab4e4cbf424182a337728a4b50bb857dcec8407b3dcb703fc612ae4e871

Contents?: true

Size: 692 Bytes

Versions: 1

Compression:

Stored size: 692 Bytes

Contents

require 'font_assets/middleware'

module FontAssets
  class Railtie < Rails::Railtie
    config.font_assets = ActiveSupport::OrderedOptions.new

    initializer "font_assets.configure_rails_initialization" do |app|
      config.font_assets.origin ||= "*"

      app.middleware.insert_before 'ActionDispatch::Static', FontAssets::Middleware, config.font_assets.origin
    end

    config.after_initialize do
      Rack::Mime::MIME_TYPES['.woff'] ||= 'application/x-font-woff'
      Rack::Mime::MIME_TYPES['.ttf']  ||= 'application/x-font-ttf'
      Rack::Mime::MIME_TYPES['.eot']  ||= 'application/vnd.ms-fontobject'
      Rack::Mime::MIME_TYPES['.svg']  ||= 'image/svg+xml'
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
font_assets-0.0.2 lib/font_assets/railtie.rb