Skip to content
This repository
Browse code

Enable to handle over in options the regexp determining which files t…

…o gzip.
  • Loading branch information...
commit 8e727ecea1dba086a95d94aa3b655f277af10b7a 1 parent 199dcae
r-stu31 authored January 08, 2012
3  actionpack/lib/sprockets/static_compiler.rb
@@ -11,6 +11,7 @@ def initialize(env, target, paths, options = {})
11 11
       @digest = options.key?(:digest) ? options.delete(:digest) : true
12 12
       @manifest = options.key?(:manifest) ? options.delete(:manifest) : true
13 13
       @manifest_path = options.delete(:manifest_path) || target
  14
+      @zip_files = options.delete(:zip_files) || /\.(css|js)$/
14 15
     end
15 16
 
16 17
     def compile
@@ -36,7 +37,7 @@ def write_asset(asset)
36 37
         filename = File.join(target, path)
37 38
         FileUtils.mkdir_p File.dirname(filename)
38 39
         asset.write_to(filename)
39  
-        asset.write_to("#{filename}.gz") if filename.to_s =~ /\.(css|js)$/
  40
+        asset.write_to("#{filename}.gz") if filename.to_s =~ @zip_files
40 41
       end
41 42
     end
42 43
 

0 notes on commit 8e727ec

Please sign in to comment.
Something went wrong with that request. Please try again.