iron_mq 1.7.1 → 1.7.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  :major: 1
3
3
  :minor: 7
4
- :patch: 1
4
+ :patch: 2
5
5
  :build:
data/iron_mq.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "iron_mq"
8
- s.version = "1.7.1"
8
+ s.version = "1.7.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Travis Reeder"]
12
- s.date = "2012-06-08"
12
+ s.date = "2012-06-09"
13
13
  s.description = "Ruby client for IronMQ"
14
14
  s.email = "travis@iron.io"
15
15
  s.extra_rdoc_files = [
@@ -18,7 +18,7 @@ module IronMQ
18
18
  res = @client.parse_response(@client.get(path(options), options))
19
19
  ret = []
20
20
  res["messages"].each do |m|
21
- ret << Message.new(self, m)
21
+ ret << Message.new(self, m, options)
22
22
  end
23
23
  if options[:n] || options['n']
24
24
  return ret
@@ -71,6 +71,7 @@ module IronMQ
71
71
  end
72
72
 
73
73
  class ResponseBase
74
+
74
75
  def initialize(res)
75
76
  @data = res
76
77
  end
@@ -95,9 +96,10 @@ module IronMQ
95
96
 
96
97
  class Message < ResponseBase
97
98
 
98
- def initialize(messages, res)
99
+ def initialize(messages, res, options={})
99
100
  super(res)
100
101
  @messages = messages
102
+ @options = options
101
103
  end
102
104
 
103
105
 
@@ -106,7 +108,7 @@ module IronMQ
106
108
  end
107
109
 
108
110
  def delete
109
- @messages.delete(self.id)
111
+ @messages.delete(self.id, @options)
110
112
  end
111
113
  end
112
114
 
data/test/quick_run.rb CHANGED
@@ -11,11 +11,13 @@ class QuickRun < TestBase
11
11
  def test_basics
12
12
  res = @client.messages.post("hello world!")
13
13
  assert res.id
14
+ post_id = res.id
14
15
  assert res.msg
15
16
  p res
16
17
 
17
18
  res = @client.messages.get()
18
19
  assert res.id
20
+ assert res.id == post_id
19
21
  assert res.body
20
22
  p res
21
23
 
@@ -25,6 +27,21 @@ class QuickRun < TestBase
25
27
 
26
28
  res = @client.messages.get()
27
29
  p res
30
+ assert res.nil?
31
+
32
+ res = @client.messages.post("hello world!", :queue_name=>'test2')
33
+ assert res.id
34
+ assert res.msg
35
+ p res
36
+
37
+ res = @client.messages.get(:queue_name=>'test2')
38
+ assert res.id
39
+ assert res.body
40
+ p res
41
+
42
+ res = res.delete
43
+ p res
44
+
28
45
 
29
46
  end
30
47
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iron_mq
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.1
4
+ version: 1.7.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-08 00:00:00.000000000 Z
12
+ date: 2012-06-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: iron_core