rufus-cloche 0.1.8 → 0.1.9
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.
- data/CHANGELOG.txt +5 -0
- data/lib/rufus/cloche.rb +2 -1
- data/rufus-cloche.gemspec +2 -2
- data/test/test.rb +16 -0
- metadata +2 -2
data/CHANGELOG.txt
CHANGED
data/lib/rufus/cloche.rb
CHANGED
|
@@ -42,7 +42,7 @@ module Rufus
|
|
|
42
42
|
#
|
|
43
43
|
class Cloche
|
|
44
44
|
|
|
45
|
-
VERSION = '0.1.
|
|
45
|
+
VERSION = '0.1.9'
|
|
46
46
|
|
|
47
47
|
attr_reader :dir
|
|
48
48
|
|
|
@@ -90,6 +90,7 @@ module Rufus
|
|
|
90
90
|
cur = do_get(file)
|
|
91
91
|
|
|
92
92
|
return cur if cur && cur['_rev'] != doc['_rev']
|
|
93
|
+
return true if cur.nil? && doc['_rev'] != -1
|
|
93
94
|
|
|
94
95
|
doc['_rev'] = doc['_rev'] + 1
|
|
95
96
|
|
data/rufus-cloche.gemspec
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
Gem::Specification.new do |s|
|
|
7
7
|
s.name = %q{rufus-cloche}
|
|
8
|
-
s.version = "0.1.
|
|
8
|
+
s.version = "0.1.9"
|
|
9
9
|
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
11
11
|
s.authors = ["John Mettraux"]
|
|
12
|
-
s.date = %q{2009-12-
|
|
12
|
+
s.date = %q{2009-12-29}
|
|
13
13
|
s.description = %q{
|
|
14
14
|
A very stupid JSON hash store.
|
|
15
15
|
|
data/test/test.rb
CHANGED
|
@@ -91,6 +91,22 @@ class ClocheTest < Test::Unit::TestCase
|
|
|
91
91
|
assert_equal 1, h['_rev']
|
|
92
92
|
end
|
|
93
93
|
|
|
94
|
+
def test_put_gone
|
|
95
|
+
|
|
96
|
+
@c.put(
|
|
97
|
+
{ '_id' => 'john', 'type' => 'person', 'eyes' => 'green' })
|
|
98
|
+
@c.delete(
|
|
99
|
+
{ '_id' => 'john', 'type' => 'person', '_rev' => 0 })
|
|
100
|
+
|
|
101
|
+
assert_nil @c.get('person', 'john')
|
|
102
|
+
|
|
103
|
+
r = @c.put(
|
|
104
|
+
{ '_id' => 'john', 'type' => 'person', 'eyes' => 'blue', '_rev' => 0 })
|
|
105
|
+
|
|
106
|
+
assert_equal true, r
|
|
107
|
+
assert_nil @c.get('person', 'john')
|
|
108
|
+
end
|
|
109
|
+
|
|
94
110
|
def test_delete_missing
|
|
95
111
|
|
|
96
112
|
r = @c.delete({ '_id' => 'john', 'type' => 'person', 'eyes' => 'green', '_rev' => 7 })
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rufus-cloche
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.9
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- John Mettraux
|
|
@@ -9,7 +9,7 @@ autorequire:
|
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
11
|
|
|
12
|
-
date: 2009-12-
|
|
12
|
+
date: 2009-12-29 00:00:00 +09:00
|
|
13
13
|
default_executable:
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|