diff --git a/lib/tasks/assets.rake b/lib/tasks/assets.rake index ed695bc7d..20c843ed8 100644 --- a/lib/tasks/assets.rake +++ b/lib/tasks/assets.rake @@ -29,38 +29,15 @@ task 'assets:precompile:before' do include GlobalPath if $node_uglify - # monkey patch asset pipeline not to gzip, compress: false is broken - class ::Sprockets::Asset - # Save asset to disk. - def write_to(filename, options = {}) - # Gzip contents if filename has '.gz' - return if File.extname(filename) == '.gz' - - begin - FileUtils.mkdir_p File.dirname(filename) - - File.open("#{filename}+", 'wb') do |f| - f.write to_s - end - - # Atomic write - FileUtils.mv("#{filename}+", filename) - - # Set mtime correctly - File.utime(mtime, mtime, filename) - - nil - ensure - # Ensure tmp file gets cleaned up - FileUtils.rm("#{filename}+") if File.exist?("#{filename}+") + module ::Sprockets + # TODO: https://github.com/rails/sprockets-rails/pull/342 + # Rails.configuration.assets.gzip = false + class Base + def skip_gzip? + true end end - - end - - module ::Sprockets - class UglifierCompressor def evaluate(context, locals, &block)