aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2013-02-10 03:30:34 -0800
committerXavier Noria <fxn@hashref.com>2013-02-10 03:30:34 -0800
commit95dd699c3649a56cabf7676534ec2ef65f3341fe (patch)
treecded0188908b940f161b57532710b36c43f79d55 /activesupport/lib/active_support
parenta0380e808d3dbd2462df17f5d3b7fcd8bd812496 (diff)
parentd59a877da44848d28960ec9038056344a5c31c0d (diff)
downloadrails-95dd699c3649a56cabf7676534ec2ef65f3341fe.tar.gz
rails-95dd699c3649a56cabf7676534ec2ef65f3341fe.tar.bz2
rails-95dd699c3649a56cabf7676534ec2ef65f3341fe.zip
Merge pull request #7730 from beyond/gzip
added compress options for gzip
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r--activesupport/lib/active_support/gzip.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/gzip.rb b/activesupport/lib/active_support/gzip.rb
index 6ef33ab683..b837c879bb 100644
--- a/activesupport/lib/active_support/gzip.rb
+++ b/activesupport/lib/active_support/gzip.rb
@@ -25,9 +25,9 @@ module ActiveSupport
end
# Compresses a string using gzip.
- def self.compress(source)
+ def self.compress(source, level=Zlib::DEFAULT_COMPRESSION, strategy=Zlib::DEFAULT_STRATEGY)
output = Stream.new
- gz = Zlib::GzipWriter.new(output)
+ gz = Zlib::GzipWriter.new(output, level, strategy)
gz.write(source)
gz.close
output.string