diff options
author | r-stu31 <r.stu3.1@googlemail.com> | 2012-01-08 12:27:56 +0100 |
---|---|---|
committer | r-stu31 <r.stu3.1@googlemail.com> | 2012-01-08 12:27:56 +0100 |
commit | 8e727ecea1dba086a95d94aa3b655f277af10b7a (patch) | |
tree | d8537581279ad71986bc00c081c35212307badbc | |
parent | 199dcaeade6c319a43b507dbc111cb15b78fa52b (diff) | |
download | rails-8e727ecea1dba086a95d94aa3b655f277af10b7a.tar.gz rails-8e727ecea1dba086a95d94aa3b655f277af10b7a.tar.bz2 rails-8e727ecea1dba086a95d94aa3b655f277af10b7a.zip |
Enable to handle over in options the regexp determining which files to gzip.
-rw-r--r-- | actionpack/lib/sprockets/static_compiler.rb | 3 |
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 |