coordinator 0.0.10 → 0.0.11
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.
- checksums.yaml +4 -4
- data/lib/coordinator/queue.rb +2 -1
- data/lib/coordinator/version.rb +1 -1
- data/test/unit/queue_test.rb +7 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a50fe82e05aa838a2e83128cdae98480b8affd6
|
4
|
+
data.tar.gz: 9b206dde729cc0b783f02ab160f4c684b8191355
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf60ae757af09e7ae69be4b042a4359f1fa43afb0cd99e7f73c15e9febfb1f69d005e19a0bec81b8db0bf181cc18edfc1782dc30659374c9642692f6761636b1
|
7
|
+
data.tar.gz: ccc63e3039946241838f5cb8e93a3672a8ad85740018ddc46236c751f3d5e11a1f423399fa318f15a38e27c2c0edfb3f9c687fde49ca86ab588b21886cf725d5
|
data/lib/coordinator/queue.rb
CHANGED
@@ -4,10 +4,11 @@ module Coordinator
|
|
4
4
|
|
5
5
|
def initialize(skill, capacity=nil, &block)
|
6
6
|
@skill = skill
|
7
|
-
self.capacity = capacity if capacity
|
8
7
|
@custom_block = block if block_given?
|
9
8
|
|
10
9
|
super(skill)
|
10
|
+
|
11
|
+
self.capacity = capacity if capacity
|
11
12
|
end
|
12
13
|
|
13
14
|
def next_task(skills)
|
data/lib/coordinator/version.rb
CHANGED
data/test/unit/queue_test.rb
CHANGED
@@ -6,6 +6,13 @@ describe "Coordinator::Queue" do
|
|
6
6
|
Redis.current.flushall
|
7
7
|
end
|
8
8
|
|
9
|
+
describe 'initialize' do
|
10
|
+
it 'can capacity when option argument is passed in' do
|
11
|
+
@queue = Coordinator::Queue.new("high", 500)
|
12
|
+
assert_equal 500, @queue.capacity
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
9
16
|
describe 'next_task' do
|
10
17
|
it 'returns task when eligible' do
|
11
18
|
@queue.push(1)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: coordinator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tyler Mercier
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-08-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http
|