large_object_store 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 61880698dc7a3f62cc1eb51390815aa9166e8aa9
4
+ data.tar.gz: a76a3eb5076124cdf839fa99a5b4afcaf6ac51b7
5
+ SHA512:
6
+ metadata.gz: fc8d52947cd7313d49a3135042b1e832574d86f57b9e6bfc262eb8134a9a73c37bbfaa28dbf828bba404611ea4e734bc09dfd685183cf307ba74ec842bf8bf36
7
+ data.tar.gz: 59bf1b2aac7827f387f672e97da33218ed00ae35f3bf92cea3c3aaddbd9e316adb2d68f25d3cd3b06ada7deb12f49a8873603df26cd3a75137832cf7977bd6c0
data/.travis.yml CHANGED
@@ -1,4 +1,3 @@
1
1
  rvm:
2
- - ree
3
2
  - 1.9.2
4
3
  - 1.9.3
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- large_object_store (1.0.0)
4
+ large_object_store (1.1.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,3 +1,3 @@
1
1
  module LargeObjectStore
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
@@ -17,7 +17,7 @@ module LargeObjectStore
17
17
 
18
18
  def write(key, value, options = {})
19
19
  value = Marshal.dump(value)
20
-
20
+
21
21
  # store number of pages
22
22
  pages = (value.size / LIMIT.to_f).ceil
23
23
 
@@ -63,5 +63,9 @@ module LargeObjectStore
63
63
  write(key, value, options)
64
64
  value
65
65
  end
66
+
67
+ def delete(key)
68
+ @store.delete("#{key}_0")
69
+ end
66
70
  end
67
71
  end
@@ -29,10 +29,15 @@ class TestCache
29
29
  def keys
30
30
  @data.keys
31
31
  end
32
+
33
+ def delete(key)
34
+ @data.delete(key)
35
+ end
32
36
  end
33
37
 
34
38
  describe LargeObjectStore do
35
- let(:store) { LargeObjectStore.wrap(TestCache.new) }
39
+ let(:cache) { TestCache.new }
40
+ let(:store) { LargeObjectStore.wrap(cache) }
36
41
 
37
42
  it "has a VERSION" do
38
43
  LargeObjectStore::VERSION.should =~ /^[\.\da-z]+$/
@@ -114,4 +119,13 @@ describe LargeObjectStore do
114
119
  store.read("a").should == false
115
120
  end
116
121
  end
122
+
123
+ describe "#delete" do
124
+ it "removes all keys" do
125
+ store.write("a", "a"*5_000_000)
126
+ store.read("a").should_not == nil
127
+ store.delete("a")
128
+ store.read("a").should == nil
129
+ end
130
+ end
117
131
  end
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: large_object_store
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
5
- prerelease:
4
+ version: 1.1.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Ana Martinez
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-05-21 00:00:00.000000000 Z
11
+ date: 2014-02-06 00:00:00.000000000 Z
13
12
  dependencies: []
14
13
  description:
15
14
  email: acemacu@gmail.com
@@ -31,26 +30,25 @@ files:
31
30
  homepage: http://github.com/anamartinez/large_object_store
32
31
  licenses:
33
32
  - MIT
33
+ metadata: {}
34
34
  post_install_message:
35
35
  rdoc_options: []
36
36
  require_paths:
37
37
  - lib
38
38
  required_ruby_version: !ruby/object:Gem::Requirement
39
- none: false
40
39
  requirements:
41
- - - ! '>='
40
+ - - '>='
42
41
  - !ruby/object:Gem::Version
43
42
  version: '0'
44
43
  required_rubygems_version: !ruby/object:Gem::Requirement
45
- none: false
46
44
  requirements:
47
- - - ! '>='
45
+ - - '>='
48
46
  - !ruby/object:Gem::Version
49
47
  version: '0'
50
48
  requirements: []
51
49
  rubyforge_project:
52
- rubygems_version: 1.8.25
50
+ rubygems_version: 2.2.2
53
51
  signing_key:
54
- specification_version: 3
52
+ specification_version: 4
55
53
  summary: Store large objects in memcache or others
56
54
  test_files: []