Sha256: 542b7952f5ba5ca4c84169f6f769f7640151c2e094667ec13b7267b9f6be0693
Contents?: true
Size: 1.07 KB
Versions: 62
Compression:
Stored size: 1.07 KB
Contents
require 'sprockets/rails/task' module Sprockets module Rails module Workarea # This is required because when precompiling assets in a deployed env # like staging or production, Rails.application.assets will be nil # because Rails.application.config.assets.compile = false. This means # "don't fall back to the asset pipeline if an asset can't be found", # which is what we want in those environvments. # # When Rails.application.assets == nil, sprockets-rails falls back and # uses it's own Sprockets::Environment. Since there is no # Sprockets::Environment for our app to add our plugin asset appends # points during initialization, we must monkey patch the ad hoc creation # of one for these rake tasks here to get these included. PRETTY SHITTY. # def environment result = super result.context_class.instance_eval do include ::Workarea::Plugin::AssetAppendsHelper end result end end end end Sprockets::Rails::Task.prepend(Sprockets::Rails::Workarea)
Version data entries
62 entries across 62 versions & 1 rubygems