iron_cache 0.0.3 → 0.0.4

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/Gemfile.lock CHANGED
@@ -1,22 +1,20 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- iron_cache (0.0.1)
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.0)
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.2.0)
17
+ rest (0.3.0)
20
18
  rest-client
21
19
  rest-client
22
20
  rest-client (1.6.7)
@@ -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
@@ -46,8 +46,10 @@ module IronCache
46
46
 
47
47
  def delete(key, options={})
48
48
  path2 = "#{self.path(key, options)}"
49
- res, status = @client.delete(path2)
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
@@ -1,3 +1,3 @@
1
1
  module IronCache
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
data/test/quick_run.rb CHANGED
@@ -5,26 +5,28 @@ class QuickRun < TestBase
5
5
 
6
6
  def setup
7
7
  super
8
- @client.queue_name = 'ironmq-gem-quick'
8
+ @client.cache_name = 'ironcache-gem-quick'
9
9
  end
10
10
 
11
11
  def test_basics
12
- res = @client.items.post("hello world!")
13
- assert res.id
14
- assert res.msg
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.id
19
- assert res.body
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(res["id"])
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iron_cache
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: