large_object_store 1.3.4 → 1.4.0

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
- SHA1:
3
- metadata.gz: 7330eb4955ee45e4ff4fcad4580a6fcd2f55ad48
4
- data.tar.gz: e61edd740a283e28ec308600a271a095d199a44b
2
+ SHA256:
3
+ metadata.gz: b62700b782559354a063c7b1f27d1a40fed24618ac7203e62f433a33ded2b46e
4
+ data.tar.gz: cfe940d1f9cbecbf8bb4619afc7604775f80a215580af336e57e98f88595cd44
5
5
  SHA512:
6
- metadata.gz: 5a9e62798f1fcc24a298e5d36cf8896c99aed6d3070a0d62dfec72a2c2279949acf003030ed5bbdcd9bd442b30eef9fb56cb9d44b98821f1365024383345403c
7
- data.tar.gz: dfc7717490b507a35ad4020aca46d3dd07dc1d2d773b1b6245ea4da1d06d61de78e4f85420cff6fa47e3d8f112f6cb70b4e57211b6be94fbceec099e2c66cf29
6
+ metadata.gz: 875bfaffed85fb6b1d7476b9d82d8c588aedb93f01c7844bfd8518e311930b4ea466aa787ad75860d47f91614e17ce6cb3fcefb18db52855cf33df589ad1e4e6
7
+ data.tar.gz: 45b2baa7dbfb379f5b7d66e0c492aa2d7dff696b1e5d690942dfb53061c4fd1267eebe0eeca78446957309b9f1526405de38a416dcec5bff8c5a24451cbcafcd
data/Readme.md CHANGED
@@ -33,4 +33,4 @@ acemacu@gmail.com<br/>
33
33
  [Michael Grosser](https://github.com/grosser)<br/>
34
34
  michael@grosser.it<br/>
35
35
  License: MIT<br/>
36
- [![Build Status](https://travis-ci.org/anamartinez/large_object_store.png)](https://travis-ci.org/anamartinez/large_object_store)
36
+ [![CI](https://github.com/anamartinez/large_object_store/actions/workflows/actions.yml/badge.svg)](https://github.com/anamartinez/large_object_store/actions/workflows/actions.yml)
@@ -1,3 +1,3 @@
1
1
  module LargeObjectStore
2
- VERSION = "1.3.4"
2
+ VERSION = "1.4.0"
3
3
  end
@@ -14,15 +14,16 @@ module LargeObjectStore
14
14
  RAW = 2
15
15
  FLAG_RADIX = 32 # we can store 32 different states
16
16
 
17
- def self.wrap(store)
18
- RailsWrapper.new(store)
17
+ def self.wrap(store, **options)
18
+ RailsWrapper.new(store, options)
19
19
  end
20
20
 
21
21
  class RailsWrapper
22
22
  attr_reader :store
23
23
 
24
- def initialize(store)
24
+ def initialize(store, serializer: Marshal)
25
25
  @store = store
26
+ @serializer = serializer
26
27
  end
27
28
 
28
29
  def write(key, value, options = {})
@@ -110,7 +111,7 @@ module LargeObjectStore
110
111
  flag |= RAW
111
112
  value = value.to_s
112
113
  else
113
- value = Marshal.dump(value)
114
+ value = @serializer.dump(value)
114
115
  end
115
116
 
116
117
  if compress?(value, options)
@@ -126,7 +127,7 @@ module LargeObjectStore
126
127
  data = raw_data.dup
127
128
  flag = data.slice!(0, 1).to_i(FLAG_RADIX)
128
129
  data = Zlib::Inflate.inflate(data) if flag & COMPRESSED == COMPRESSED
129
- data = Marshal.load(data) if flag & RAW != RAW
130
+ data = @serializer.load(data) if flag & RAW != RAW
130
131
  data
131
132
  end
132
133
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: large_object_store
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.4
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ana Martinez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-27 00:00:00.000000000 Z
11
+ date: 2022-03-16 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: acemacu@gmail.com
@@ -31,15 +31,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - ">="
33
33
  - !ruby/object:Gem::Version
34
- version: '2.0'
34
+ version: '2.5'
35
35
  required_rubygems_version: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - ">="
38
38
  - !ruby/object:Gem::Version
39
39
  version: '0'
40
40
  requirements: []
41
- rubyforge_project:
42
- rubygems_version: 2.6.14
41
+ rubygems_version: 3.1.6
43
42
  signing_key:
44
43
  specification_version: 4
45
44
  summary: Store large objects in memcache or others