redis_page 0.1.22 → 0.1.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a06d2e1d0a4a723ce3e9d47a2c7f4484a3522c9b
4
- data.tar.gz: 3c2a6f6b31396d1557207dc8f8cd20da2d15e9fa
3
+ metadata.gz: dc682c2a3a8792e53a6290589539b64aa1ceac35
4
+ data.tar.gz: a3c930353c21b04c2c007b8cbba325c67b2f04d5
5
5
  SHA512:
6
- metadata.gz: 16e73d77c06ad803d4e619b0a63fd5dec38fef56d786ca49cb059a339867109e02b8e63d49acc21d836b2fd92a558a0af418d7fd155c7117f1fca004a3236a8d
7
- data.tar.gz: 6197bc33d126d55544cf153241f878fd00641703f2f4b1111d738a67e75eb55f83532fce9f3d888f442922b5bc3f27c54c3d8a98a01644f8f149d1615aac6179
6
+ metadata.gz: f7594439cade2b7d77f6187767a99f6bbb8746a2e440b175eb36053e5032bfa6c1f92382988d6f34464dc874ae61d82b986f151f7d25b6e62ecdacdd79df9a95
7
+ data.tar.gz: f3b556ab7f89b497605761444c72862913f7a487b32c2cc96f772f7729081894123f512d742e3f84ae11842562079f46df78aacee40471a356e99876c33904cc
@@ -1,4 +1,5 @@
1
1
  require 'active_support/core_ext/class/attribute_accessors'
2
+ require 'active_support/gzip'
2
3
  require 'zlib'
3
4
 
4
5
  module ActionController
@@ -36,7 +37,14 @@ module ActionController
36
37
  end
37
38
 
38
39
  def compress_content(content)
39
- RedisPage.compress_method == :deflate ? Zlib::Deflate.deflate(content) : content
40
+ case RedisPage.compress_method
41
+ when :deflate
42
+ Zlib::Deflate.deflate(content)
43
+ when :gzip
44
+ ActiveSupport::Gzip.compress(content)
45
+ else
46
+ content
47
+ end
40
48
  end
41
49
 
42
50
  # TODO: 全球化部署时需要将一个页面写到多个redis上去,需要确保: 1. 写入速度快; 2. 确保写入成功;
@@ -1,3 +1,3 @@
1
1
  module RedisPage
2
- VERSION = '0.1.22'
2
+ VERSION = '0.1.23'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis_page
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.22
4
+ version: 0.1.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - saberma