coordinator 0.0.12 → 0.0.13
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/base.rb +7 -0
- data/lib/coordinator/version.rb +1 -1
- data/test/unit/base_test.rb +14 -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: 1a6f186704baaa5be4569f4b82a00a9d2bf46683
|
4
|
+
data.tar.gz: b54daff3d8f3354601e95503d99367dcf6748dbf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7cfbedf5fe4f2d2525e5dd00d52917f64da6c45f168ed282d80d1ceae995f42aaa037c4292de565564bdde00146416718a052805f45f8e67e1a23ead8c22ab9e
|
7
|
+
data.tar.gz: a7c9b7e0f295735e82ff4b316fda3c98efa0b1cbf8d73f62dc1e868aa50d069ce7c3ae3798ef3845a259dfa7f7fd1755ef81fdfb95b53cc6da391abab3e65c3a
|
data/lib/coordinator/base.rb
CHANGED
@@ -36,6 +36,13 @@ module Coordinator
|
|
36
36
|
queue_for_skill(skill).details
|
37
37
|
end
|
38
38
|
|
39
|
+
def info_all
|
40
|
+
@queues.inject({}) do |hash, queue|
|
41
|
+
hash[queue.skill] = info(queue.skill)
|
42
|
+
hash
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
39
46
|
def position(skill, task)
|
40
47
|
index = queue_for_skill(skill).items.index(task)
|
41
48
|
index ? index + 1 : -1
|
data/lib/coordinator/version.rb
CHANGED
data/test/unit/base_test.rb
CHANGED
@@ -66,6 +66,20 @@ describe 'Coordinator::Base' do
|
|
66
66
|
end
|
67
67
|
end
|
68
68
|
|
69
|
+
describe 'info_all' do
|
70
|
+
it 'returns a hash with details for each queue' do
|
71
|
+
@coordinator.add_task("high", "high task")
|
72
|
+
@coordinator.add_task("medium", "medium task 1")
|
73
|
+
@coordinator.add_task("medium", "medium task 2")
|
74
|
+
@coordinator.add_task("low", "medium task 2")
|
75
|
+
info = @coordinator.info_all
|
76
|
+
|
77
|
+
assert_equal @coordinator.info("high"), info["high"]
|
78
|
+
assert_equal @coordinator.info("medium"), info["medium"]
|
79
|
+
assert_equal @coordinator.info("low"), info["low"]
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
69
83
|
describe 'length_all' do
|
70
84
|
it 'returns the total amount of tasks across all queues' do
|
71
85
|
@coordinator.add_task("medium", 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.13
|
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-09-
|
11
|
+
date: 2014-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http
|