aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/gzip.rb
diff options
context:
space:
mode:
authorBeyond <beyond@be.to>2012-09-22 18:07:50 +0900
committerBeyond <beyond@be.to>2013-02-10 20:01:42 +0900
commitd59a877da44848d28960ec9038056344a5c31c0d (patch)
treecded0188908b940f161b57532710b36c43f79d55 /activesupport/lib/active_support/gzip.rb
parenta0380e808d3dbd2462df17f5d3b7fcd8bd812496 (diff)
downloadrails-d59a877da44848d28960ec9038056344a5c31c0d.tar.gz
rails-d59a877da44848d28960ec9038056344a5c31c0d.tar.bz2
rails-d59a877da44848d28960ec9038056344a5c31c0d.zip
added compress options for gzip
added test for compress options of gzip update changelog
Diffstat (limited to 'activesupport/lib/active_support/gzip.rb')
-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