aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/sprockets
diff options
context:
space:
mode:
authorr-stu31 <r.stu3.1@googlemail.com>2012-01-08 12:27:56 +0100
committerr-stu31 <r.stu3.1@googlemail.com>2012-01-08 12:27:56 +0100
commit8e727ecea1dba086a95d94aa3b655f277af10b7a (patch)
treed8537581279ad71986bc00c081c35212307badbc /actionpack/lib/sprockets
parent199dcaeade6c319a43b507dbc111cb15b78fa52b (diff)
downloadrails-8e727ecea1dba086a95d94aa3b655f277af10b7a.tar.gz
rails-8e727ecea1dba086a95d94aa3b655f277af10b7a.tar.bz2
rails-8e727ecea1dba086a95d94aa3b655f277af10b7a.zip
Enable to handle over in options the regexp determining which files to gzip.
Diffstat (limited to 'actionpack/lib/sprockets')
-rw-r--r--actionpack/lib/sprockets/static_compiler.rb3
1 files changed, 2 insertions, 1 deletions
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