Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #4385 from r-stu31/static_compiler_option_zip_files

Sprockets::StaticCompiler: option ":zip_files"
  • Loading branch information...
commit 7cfd1bd76a41bea528c945d821a9fbc3902af479 2 parents 199dcae + c763b03
@josevalim josevalim authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  actionpack/lib/sprockets/static_compiler.rb
View
3  actionpack/lib/sprockets/static_compiler.rb
@@ -11,6 +11,7 @@ def initialize(env, target, paths, options = {})
@digest = options.key?(:digest) ? options.delete(:digest) : true
@manifest = options.key?(:manifest) ? options.delete(:manifest) : true
@manifest_path = options.delete(:manifest_path) || target
+ @zip_files = options.delete(:zip_files) || /\.(?:css|html|js|svg|txt|xml)$/
end
def compile
@@ -36,7 +37,7 @@ def write_asset(asset)
filename = File.join(target, path)
FileUtils.mkdir_p File.dirname(filename)
asset.write_to(filename)
- asset.write_to("#{filename}.gz") if filename.to_s =~ /\.(css|js)$/
+ asset.write_to("#{filename}.gz") if filename.to_s =~ @zip_files
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.