rails-brotli-cache 0.3.10 → 0.3.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9c5512004d2aecf612e5d79e2b1718466af061f9e4365f2589d767a8d28bf523
4
- data.tar.gz: 89bffbc70d9cd93e8daf4e65731d4023f82703910b0dc333b3fc07775409ae7b
3
+ metadata.gz: 2870c72930bbed4f3ccdc807cf5f62e692bc56456a1c456c123fc4d3b14b537c
4
+ data.tar.gz: c12a04062bdae8ca70535ca15aad9a77953dff01618d544f9bd28408e222cfde
5
5
  SHA512:
6
- metadata.gz: 329a2f361c842187b6c1afc4585dec17638950503908bd9991f83b4243eb8a798903a10a6537650acb6cf229dd1327b79e8bea5467c2abde07f64e926656c08a
7
- data.tar.gz: fbb555285118d28986c453b2a7c7935ce35a8d06d88d581888f54bff82426e2f8b705a21e42d7b2d63ce18ee20e277c3a08b2e11ff9d1701c41377501faa5088
6
+ metadata.gz: 5683b7363fc845e04739e077315fc0d0e363d8dda8fc6dcc9d3f44eb2d0ec5e8a4dc4d45ef8e6d1354f7ba669c9befae4cd30dda3f1da553eec1ed73d4e41076
7
+ data.tar.gz: 636786c88da156a5938cb8a637deebb916c354b0e0171ae0389085dae69dce5dbe10a627468432f217aaa3aba74fbdc03f957284607ab658713f2c6bbfa320fe
@@ -58,7 +58,7 @@ module RailsBrotliCache
58
58
  options
59
59
  )
60
60
 
61
- uncompressed(payload)
61
+ uncompressed(payload, options)
62
62
  end
63
63
 
64
64
  def write_multi(hash, options = nil)
@@ -77,7 +77,7 @@ module RailsBrotliCache
77
77
  names = names.map { |name| cache_key(name) }
78
78
 
79
79
  Hash[core_store.read_multi(*names, options).map do |key, val|
80
- [source_cache_key(key), uncompressed(val)]
80
+ [source_cache_key(key), uncompressed(val, options)]
81
81
  end]
82
82
  end
83
83
 
@@ -119,8 +119,9 @@ module RailsBrotliCache
119
119
  private
120
120
 
121
121
  def compressed(value, options)
122
- return value if value.is_a?(Integer)
123
122
  options ||= {}
123
+
124
+ return value if value.is_a?(Integer)
124
125
  serialized = Marshal.dump(value)
125
126
 
126
127
  if serialized.bytesize >= COMPRESS_THRESHOLD && !options.fetch(:compress) == false
@@ -136,7 +137,9 @@ module RailsBrotliCache
136
137
  end
137
138
  end
138
139
 
139
- def uncompressed(payload)
140
+ def uncompressed(payload, options)
141
+ options ||= {}
142
+
140
143
  return nil unless payload.present?
141
144
 
142
145
  return payload if payload.is_a?(Integer)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsBrotliCache
4
- VERSION = "0.3.10"
4
+ VERSION = "0.3.11"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-brotli-cache
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.10
4
+ version: 0.3.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - pawurb