From 8e727ecea1dba086a95d94aa3b655f277af10b7a Mon Sep 17 00:00:00 2001 From: r-stu31 Date: Sun, 8 Jan 2012 12:27:56 +0100 Subject: Enable to handle over in options the regexp determining which files to gzip. --- actionpack/lib/sprockets/static_compiler.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'actionpack') diff --git a/actionpack/lib/sprockets/static_compiler.rb b/actionpack/lib/sprockets/static_compiler.rb index 32a9d66e6e..5146e12d70 100644 --- a/actionpack/lib/sprockets/static_compiler.rb +++ b/actionpack/lib/sprockets/static_compiler.rb @@ -11,6 +11,7 @@ module Sprockets @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|js)$/ 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 -- cgit v1.2.3 From c763b03d1544039a1cc5ade21d33d097d550bb6c Mon Sep 17 00:00:00 2001 From: r-stu31 Date: Sun, 8 Jan 2012 12:28:33 +0100 Subject: Extend the set of compressible files by some common types. --- actionpack/lib/sprockets/static_compiler.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack') diff --git a/actionpack/lib/sprockets/static_compiler.rb b/actionpack/lib/sprockets/static_compiler.rb index 5146e12d70..719df0bd51 100644 --- a/actionpack/lib/sprockets/static_compiler.rb +++ b/actionpack/lib/sprockets/static_compiler.rb @@ -11,7 +11,7 @@ module Sprockets @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|js)$/ + @zip_files = options.delete(:zip_files) || /\.(?:css|html|js|svg|txt|xml)$/ end def compile -- cgit v1.2.3