aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/sprockets/static_compiler.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/sprockets/static_compiler.rb')
-rw-r--r--actionpack/lib/sprockets/static_compiler.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/actionpack/lib/sprockets/static_compiler.rb b/actionpack/lib/sprockets/static_compiler.rb
index 32a9d66e6e..9bbb464474 100644
--- a/actionpack/lib/sprockets/static_compiler.rb
+++ b/actionpack/lib/sprockets/static_compiler.rb
@@ -8,9 +8,10 @@ module Sprockets
@env = env
@target = target
@paths = paths
- @digest = options.key?(:digest) ? options.delete(:digest) : true
- @manifest = options.key?(:manifest) ? options.delete(:manifest) : true
+ @digest = options.fetch(:digest, true)
+ @manifest = options.fetch(: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 @@ module Sprockets
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