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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f57530d2f47e8f82ab96f074dfcc9f7f2a08409b
4
- data.tar.gz: bf2be6add48183ecd18bc27a84f2a8f6ce2762ba
3
+ metadata.gz: 1a6f186704baaa5be4569f4b82a00a9d2bf46683
4
+ data.tar.gz: b54daff3d8f3354601e95503d99367dcf6748dbf
5
5
  SHA512:
6
- metadata.gz: 8fc9c5ae89732c5b00a7908f9b1cd049bf73b2a900bb52f60d1fdbfe9a45a0a84045f07d24463aba820d40c206b2a0c437eeceaa3790367fcccb9047a6c9d26f
7
- data.tar.gz: 17da52136062072f28cdb1cbe2af22bb947599ae8a8a00a1ec799672eef28bbde600fcbcec135bbf0c76e5e613e50e9b673a5109ccb41b4b1cc10bf4154a4790
6
+ metadata.gz: 7cfbedf5fe4f2d2525e5dd00d52917f64da6c45f168ed282d80d1ceae995f42aaa037c4292de565564bdde00146416718a052805f45f8e67e1a23ead8c22ab9e
7
+ data.tar.gz: a7c9b7e0f295735e82ff4b316fda3c98efa0b1cbf8d73f62dc1e868aa50d069ce7c3ae3798ef3845a259dfa7f7fd1755ef81fdfb95b53cc6da391abab3e65c3a
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Coordinator
2
- VERSION = "0.0.12"
2
+ VERSION = "0.0.13"
3
3
  end
@@ -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.12
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-10 00:00:00.000000000 Z
11
+ date: 2014-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http