semq-client 1.0 → 1.1

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.
Files changed (2) hide show
  1. data/lib/semq_client.rb +15 -0
  2. metadata +5 -7
data/lib/semq_client.rb CHANGED
@@ -22,6 +22,21 @@ class SemqClient
22
22
  http.post(url.path, message)
23
23
  end
24
24
 
25
+ def clear
26
+ url = constructQueueUrl
27
+ req = Net::HTTP::Delete.new(url.path)
28
+ res = Net::HTTP.start(url.host, url.port) {|http|
29
+ http.request(req)
30
+ }
31
+ case res
32
+ when Net::HTTPSuccess
33
+ return true
34
+ else
35
+ return false
36
+ end
37
+ end
38
+
39
+
25
40
  private
26
41
 
27
42
  def constructQueueUrl
metadata CHANGED
@@ -1,12 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: semq-client
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
- - 0
9
- version: "1.0"
8
+ - 1
9
+ version: "1.1"
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ian Calvert
@@ -14,8 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-08-11 00:00:00 +01:00
18
- default_executable:
17
+ date: 2011-10-19 00:00:00 Z
19
18
  dependencies: []
20
19
 
21
20
  description: A simple client for using semq message servers. Supports push and pop methods to named queues. Pop can wait indefinitely, using long polling to remain lightweight.
@@ -28,7 +27,6 @@ extra_rdoc_files: []
28
27
 
29
28
  files:
30
29
  - lib/semq_client.rb
31
- has_rdoc: true
32
30
  homepage:
33
31
  licenses: []
34
32
 
@@ -58,7 +56,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
58
56
  requirements: []
59
57
 
60
58
  rubyforge_project:
61
- rubygems_version: 1.6.2
59
+ rubygems_version: 1.8.5
62
60
  signing_key:
63
61
  specification_version: 3
64
62
  summary: A ruby client for the semq message queue service.