fraggle 1.0.0.pre.2 → 1.0.0.pre.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +8 -2
- data/lib/fraggle/connection.rb +0 -1
- data/lib/fraggle/response.rb +16 -0
- data/lib/fraggle/version.rb +1 -1
- metadata +4 -4
data/README.md
CHANGED
@@ -36,6 +36,8 @@
|
|
36
36
|
e.path # => "/foo"
|
37
37
|
e.value # => "bar"
|
38
38
|
e.rev # => 123
|
39
|
+
e.set? # => true
|
40
|
+
e.del? # => false
|
39
41
|
|
40
42
|
do_something_with(e)
|
41
43
|
|
@@ -46,7 +48,7 @@
|
|
46
48
|
end
|
47
49
|
|
48
50
|
## Setting a key (this will trigger the watch above)
|
49
|
-
req = c.set(
|
51
|
+
req = c.set("/foo", "zomg!", 0) do |e|
|
50
52
|
# Success!
|
51
53
|
end.error do |e|
|
52
54
|
if e.mismatch?
|
@@ -59,12 +61,16 @@
|
|
59
61
|
# Knowning when a command is done is useful in some cases.
|
60
62
|
# Use the `done` callback for those situations.
|
61
63
|
ents = []
|
62
|
-
|
64
|
+
c.getdir("/test") do |e|
|
63
65
|
ents << e
|
64
66
|
end.done do
|
65
67
|
p ents
|
66
68
|
end
|
67
69
|
|
70
|
+
c.get("/nothere") do |e|
|
71
|
+
e.missing? # => true
|
72
|
+
end
|
73
|
+
|
68
74
|
end
|
69
75
|
|
70
76
|
## Consistency
|
data/lib/fraggle/connection.rb
CHANGED
data/lib/fraggle/response.rb
CHANGED
@@ -5,6 +5,8 @@ module Fraggle
|
|
5
5
|
|
6
6
|
VALID = 1
|
7
7
|
DONE = 2
|
8
|
+
SET = 4
|
9
|
+
DEL = 8
|
8
10
|
|
9
11
|
attr_accessor :disconnected
|
10
12
|
|
@@ -18,6 +20,20 @@ module Fraggle
|
|
18
20
|
(flags & DONE) > 0
|
19
21
|
end
|
20
22
|
|
23
|
+
def set?
|
24
|
+
return false if !flags
|
25
|
+
(flags & SET) > 0
|
26
|
+
end
|
27
|
+
|
28
|
+
def set?
|
29
|
+
return false if !flags
|
30
|
+
(flags & DEL) > 0
|
31
|
+
end
|
32
|
+
|
33
|
+
def missing?
|
34
|
+
rev == 0
|
35
|
+
end
|
36
|
+
|
21
37
|
def ok?
|
22
38
|
err_code.nil?
|
23
39
|
end
|
data/lib/fraggle/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fraggle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 1923831951
|
5
5
|
prerelease: 6
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
9
|
- 0
|
10
10
|
- pre
|
11
|
-
-
|
12
|
-
version: 1.0.0.pre.
|
11
|
+
- 3
|
12
|
+
version: 1.0.0.pre.3
|
13
13
|
platform: ruby
|
14
14
|
authors:
|
15
15
|
- Blake Mizerany
|
@@ -17,7 +17,7 @@ autorequire:
|
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
19
|
|
20
|
-
date: 2011-04-
|
20
|
+
date: 2011-04-26 00:00:00 -07:00
|
21
21
|
default_executable:
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|