Sha256: d51de54fddfe8aaf01a5941c5f9fd68249b31763ed0291cc896af53f36f43b1a
Contents?: true
Size: 981 Bytes
Versions: 3
Compression:
Stored size: 981 Bytes
Contents
module SmartAssets class Railtie < Rails::Railtie config.smart_assets = ActiveSupport::OrderedOptions.new config.smart_assets.cache_control = 'public,max-age=60' config.smart_assets.prefix = nil config.smart_assets.serve_non_digest_assets = !Rails.env.development? initializer 'smart_assets.configure' do |app| if app.config.smart_assets.serve_non_digest_assets prefix = app.config.smart_assets.prefix || app.config.assets.prefix || '/assets' cc = app.config.smart_assets.cache_control if app.config.respond_to?(:public_file_server) app.config.public_file_server.enabled = true # >= 5.0 elsif app.config.respond_to?(:serve_static_files) app.config.serve_static_files = true # = 4.2 else app.config.serve_static_assets = true # <= 4.1 end app.middleware.insert_after(::Rack::Sendfile, SmartAssets::Rack, prefix, cc) end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
smart_assets-1.0.0 | lib/smart_assets/railtie.rb |
smart_assets-0.5.0 | lib/smart_assets/railtie.rb |
smart_assets-0.4.0 | lib/smart_assets/railtie.rb |