cache_keeper 0.6.0 → 0.6.1

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
  SHA256:
3
- metadata.gz: e3d6e043fb7e1bc65aaf6ca5c4e35db60822b27d41e8055f53cf24d1624e9374
4
- data.tar.gz: 040cd7ceb6ab94ff67c940d3378b29e076b62cf0d10c8ff40c4f0c90a3b3be02
3
+ metadata.gz: 919ef367b49336174acda56328421939872f1921ec23d349fedca66e23a01815
4
+ data.tar.gz: 2cdf9e582968a16557b06534a28d77298957b1474a04c552fffa7e130015b6e4
5
5
  SHA512:
6
- metadata.gz: 6bb884305464e91b0a0eb2aaa329cf884db1dd6305bea38e49d910eb9e4ba99d280b27049d3d8e0bca09862b2244357f6461e6e865c0b7b90d96b575431f1dcb
7
- data.tar.gz: 930b08b46a524b2eaab7f50956d0b883e763eb460011c6158709841feddecb8f9dfbefa80ee17e9499b2faf52d201af3452f98cd8c70c7f1fb4e9c46647c5f01
6
+ metadata.gz: 72094507997a5a056faa3e61438f1725d7e9787bf4ce4b710a1d071c55a9e93f576c5ff680d88940838a69f38aef1ef9b6aad9e43f74f7e8a5104180d5d910cb
7
+ data.tar.gz: 585089805bde2aa9ec878d4c0e01ed1eb5f73d9a28fb98e51e1b83e34ea4db1de3f274849d6f6427e25e7263d2c3a7f945277ebaec67643823ba78f1e6566dc3
data/README.md CHANGED
@@ -59,6 +59,8 @@ CacheKeeper will compose cache keys from the name of the method and the instance
59
59
 
60
60
  ```ruby
61
61
  class NebulaNoodleTwister
62
+ include CacheKeeper::Caching
63
+
62
64
  caches :twist_noodles, :dish_of_the_day, key: ->(method_name) { [:recoding, id, method_name] }
63
65
  caches :synchronize_taste_buds, key: -> { [:recoding, id, :synchronize_taste_buds] }
64
66
  caches :space_soup_simulation, key: :space_soup_simulation
@@ -71,6 +73,8 @@ CacheKeeper needs to pass the instance on which the cached method is called alon
71
73
 
72
74
  ```ruby
73
75
  class QuantumQuackerator
76
+ include CacheKeeper::Caching
77
+
74
78
  # Generate a new instance using an empty initializer (QuantumQuackerator.new)
75
79
  # Useful for controllers and for POROs with no arguments
76
80
  caches :quackify_particles, serializer: :new_instance
@@ -1,9 +1,9 @@
1
1
  class CacheKeeper::MarshalSerializer < ActiveJob::Serializers::ObjectSerializer
2
2
  def serialize(target)
3
- super("dump" => Marshal.dump(target).force_encoding("ISO-8859-1").encode("UTF-8"))
3
+ super("dump" => Base64.encode64(Marshal.dump(target)))
4
4
  end
5
5
 
6
6
  def deserialize(json)
7
- Marshal.load(json["dump"].encode("ISO-8859-1").force_encoding("ASCII-8BIT"))
7
+ Marshal.load Base64.decode64(json["dump"])
8
8
  end
9
9
  end
@@ -1,3 +1,3 @@
1
1
  module CacheKeeper
2
- VERSION = "0.6.0"
2
+ VERSION = "0.6.1"
3
3
  end
@@ -5,7 +5,7 @@ class CacheKeeper::MarshalSerializerTest < ActiveSupport::TestCase
5
5
  target = Recording.new
6
6
  serialized = serializer.serialize(target)
7
7
 
8
- assert_equal serialized["dump"], Marshal.dump(target).force_encoding("ISO-8859-1").encode("UTF-8")
8
+ assert_equal serialized["dump"], Base64.encode64(Marshal.dump(target))
9
9
  end
10
10
 
11
11
  test "deserializes the marshal dump" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cache_keeper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Zamuner