cloudq_client 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/cloudq/complete.rb +19 -0
- data/lib/cloudq/request.rb +24 -0
- data/lib/cloudq/version.rb +1 -1
- data/lib/cloudq.rb +4 -0
- metadata +7 -7
@@ -0,0 +1,19 @@
|
|
1
|
+
module Cloudq
|
2
|
+
class Complete < Base
|
3
|
+
def job(job_id)
|
4
|
+
remove(job_id)
|
5
|
+
end
|
6
|
+
|
7
|
+
private
|
8
|
+
|
9
|
+
def remove(job_id)
|
10
|
+
RestClient.delete [url, job_id].join('/')
|
11
|
+
end
|
12
|
+
|
13
|
+
def url
|
14
|
+
[Cloudq::Connection.url, @queue].join('/')
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Cloudq
|
2
|
+
class Request < Base
|
3
|
+
def job
|
4
|
+
get
|
5
|
+
end
|
6
|
+
|
7
|
+
private
|
8
|
+
|
9
|
+
def get
|
10
|
+
resp = RestClient.get url
|
11
|
+
if resp.code == 200
|
12
|
+
result = JSON.parse(resp)
|
13
|
+
return nil if result['status'] == 'empty'
|
14
|
+
result
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def url
|
19
|
+
[Cloudq::Connection.url, @queue].join('/')
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
|
data/lib/cloudq/version.rb
CHANGED
data/lib/cloudq.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloudq_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 7
|
10
|
+
version: 0.0.7
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Tom Wilson
|
@@ -15,8 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
19
|
-
default_executable:
|
18
|
+
date: 2012-06-12 00:00:00 Z
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
22
21
|
name: rspec
|
@@ -89,15 +88,16 @@ extra_rdoc_files: []
|
|
89
88
|
|
90
89
|
files:
|
91
90
|
- lib/cloudq/base.rb
|
91
|
+
- lib/cloudq/complete.rb
|
92
92
|
- lib/cloudq/connection.rb
|
93
93
|
- lib/cloudq/consume.rb
|
94
94
|
- lib/cloudq/publish.rb
|
95
|
+
- lib/cloudq/request.rb
|
95
96
|
- lib/cloudq/version.rb
|
96
97
|
- lib/cloudq/worker.rb
|
97
98
|
- lib/cloudq.rb
|
98
99
|
- LICENSE
|
99
100
|
- readme.md
|
100
|
-
has_rdoc: true
|
101
101
|
homepage: http://github.com/twilson63/cloudq_client
|
102
102
|
licenses: []
|
103
103
|
|
@@ -129,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
129
129
|
requirements: []
|
130
130
|
|
131
131
|
rubyforge_project:
|
132
|
-
rubygems_version: 1.
|
132
|
+
rubygems_version: 1.8.10
|
133
133
|
signing_key:
|
134
134
|
specification_version: 3
|
135
135
|
summary: A Ruby Interface to the Cloudq
|