boss_queue 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/boss_queue.gemspec +1 -1
- data/lib/boss_queue/boss_queue.rb +5 -1
- data/spec/boss_queue_spec.rb +1 -0
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.5
|
data/boss_queue.gemspec
CHANGED
@@ -40,7 +40,7 @@ class BossQueue
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def self.work
|
43
|
-
queue = AWS::SQS.new.queues[self.
|
43
|
+
queue = AWS::SQS.new.queues[self.sqs_queue]
|
44
44
|
queue.receive_message do |job_id|
|
45
45
|
# When a block is given, each message is yielded to the block and then deleted as long as the block exits normally - http://docs.aws.amazon.com/AWSRubySDK/latest/frames.html
|
46
46
|
job = BossQueue::Job.shard(table_name).find_by_id(job_id.body)
|
@@ -80,6 +80,10 @@ class BossQueue
|
|
80
80
|
job
|
81
81
|
end
|
82
82
|
|
83
|
+
def self.sqs_queue # :nodoc:
|
84
|
+
AWS::SQS.new.queues[AWS::SQS.new.queues.url_for(self.queue_name)]
|
85
|
+
end
|
86
|
+
|
83
87
|
def self.environment # :nodoc:
|
84
88
|
@@environment ||= if Module.const_get('Rails')
|
85
89
|
Rails.env
|
data/spec/boss_queue_spec.rb
CHANGED
@@ -208,6 +208,7 @@ describe "BossQueue module" do
|
|
208
208
|
describe "#work" do
|
209
209
|
before(:each) do
|
210
210
|
@queue = double('queue')
|
211
|
+
AWS::SQS.stub_chain(:new, :queues, :url_for).and_return('queue_url')
|
211
212
|
AWS::SQS.stub_chain(:new, :queues, :[]).and_return(@queue)
|
212
213
|
|
213
214
|
@sqs_message = double('message')
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: boss_queue
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -160,7 +160,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
160
160
|
version: '0'
|
161
161
|
segments:
|
162
162
|
- 0
|
163
|
-
hash: -
|
163
|
+
hash: -4609173769032882397
|
164
164
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
165
165
|
none: false
|
166
166
|
requirements:
|