iron_cache 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +3 -5
- data/lib/iron_cache/client.rb +0 -12
- data/lib/iron_cache/items.rb +4 -2
- data/lib/iron_cache/version.rb +1 -1
- data/test/quick_run.rb +12 -10
- metadata +1 -1
data/Gemfile.lock
CHANGED
@@ -1,22 +1,20 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
iron_cache (0.0.
|
4
|
+
iron_cache (0.0.3)
|
5
5
|
iron_core
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
iron_core (0.1.
|
10
|
+
iron_core (0.1.3)
|
11
11
|
bundler (> 1.0.0)
|
12
|
-
json
|
13
12
|
rest
|
14
13
|
rest-client
|
15
|
-
json (1.7.1)
|
16
14
|
memcache-client (1.8.5)
|
17
15
|
mime-types (1.18)
|
18
16
|
rake (0.9.2.2)
|
19
|
-
rest (0.
|
17
|
+
rest (0.3.0)
|
20
18
|
rest-client
|
21
19
|
rest-client
|
22
20
|
rest-client (1.6.7)
|
data/lib/iron_cache/client.rb
CHANGED
@@ -48,18 +48,6 @@ module IronCache
|
|
48
48
|
return Caches.new(self)
|
49
49
|
end
|
50
50
|
|
51
|
-
|
52
|
-
def put(method, params={})
|
53
|
-
request_hash = {}
|
54
|
-
request_hash[:headers] = common_request_hash
|
55
|
-
request_hash[:body] = params.to_json
|
56
|
-
|
57
|
-
IronCore::Logger.debug 'IronCore', "PUT #{url + method} with params='#{request_hash.to_s}'"
|
58
|
-
|
59
|
-
@rest.put(url + method, request_hash)
|
60
|
-
end
|
61
|
-
|
62
|
-
|
63
51
|
end
|
64
52
|
|
65
53
|
class Error < StandardError
|
data/lib/iron_cache/items.rb
CHANGED
@@ -46,8 +46,10 @@ module IronCache
|
|
46
46
|
|
47
47
|
def delete(key, options={})
|
48
48
|
path2 = "#{self.path(key, options)}"
|
49
|
-
res
|
50
|
-
res
|
49
|
+
res = @client.delete(path2)
|
50
|
+
json = @client.parse_response(res, true)
|
51
|
+
#return Message.new(self, res)
|
52
|
+
return ResponseBase.new(json)
|
51
53
|
end
|
52
54
|
|
53
55
|
end
|
data/lib/iron_cache/version.rb
CHANGED
data/test/quick_run.rb
CHANGED
@@ -5,26 +5,28 @@ class QuickRun < TestBase
|
|
5
5
|
|
6
6
|
def setup
|
7
7
|
super
|
8
|
-
@client.
|
8
|
+
@client.cache_name = 'ironcache-gem-quick'
|
9
9
|
end
|
10
10
|
|
11
11
|
def test_basics
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
key = "x"
|
13
|
+
value = "hello world!"
|
14
|
+
res = @client.items.put(key, value)
|
15
15
|
p res
|
16
|
+
assert res.msg
|
16
17
|
|
17
|
-
res = @client.items.get()
|
18
|
-
assert res.
|
19
|
-
assert res.
|
18
|
+
res = @client.items.get(key)
|
19
|
+
assert res.value
|
20
|
+
assert res.value == value
|
20
21
|
p res
|
21
22
|
|
22
|
-
res = @client.items.delete(
|
23
|
-
assert res.msg
|
23
|
+
res = @client.items.delete(key)
|
24
24
|
p res
|
25
|
+
assert res.msg
|
25
26
|
|
26
|
-
res = @client.items.get()
|
27
|
+
res = @client.items.get(key)
|
27
28
|
p res
|
29
|
+
assert res.nil?
|
28
30
|
|
29
31
|
end
|
30
32
|
|