herodot 0.1.4 → 0.1.5

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: f59dc91cb6f979870be52c198586134f7680f5ef
4
- data.tar.gz: 91776ea8750d0f0822dd3970af8b6ec57a0e9327
3
+ metadata.gz: e258c2416084f926cfba575ec00e7322687c5f27
4
+ data.tar.gz: 2a1ca6076c7d932772890a9411db5ed6d193f56d
5
5
  SHA512:
6
- metadata.gz: e3b8ac726c7e8a1fb0bb67d02aee9b9897c19c7112c9d5f328e8b2ff641893d11281e0c0ad287f15bd3195ec4056948b3b9d10a2505dc738790f63c0daa6560c
7
- data.tar.gz: 61c0c5e4b18bf3ee7e6808a22faa50c4a9faccafc504636fa9c66e69382fcd9a7026ddd3d14f384551e8ba2c6fb662e1f3c6d5a9ac6a38f00f18929ad4a00903
6
+ metadata.gz: 2503878d39d2b18a2c3aa537268e9e4a7649a9a440bc377017cb0e12c6a169f886d3d7fc91a87ef2e8058835f1081108ed97c02c93844b31747b696e27130434
7
+ data.tar.gz: d58e61d8188be9404e7197243115cf28566874761e29f9bc0bdf38b822bb5f9e15754b256e467a55b9b1975cacae135525290c2c031c5733f0bd432a344ca5d0
@@ -1,3 +1,3 @@
1
1
  module Herodot
2
- VERSION = '0.1.4'.freeze
2
+ VERSION = '0.1.5'.freeze
3
3
  end
@@ -45,13 +45,17 @@ class Herodot::Worklog
45
45
  dates.map do |date|
46
46
  time_sums = grouped[date].each_with_object({}) do |time, sums|
47
47
  id = time[:id]
48
- sums[id] ||= { time: 0, project: @branches.dig(id, :project), branch: @branches.dig(id, :branch) }
48
+ sums[id] ||= { time: 0, **branch(id) }
49
49
  sums[id][:time] += time[:time]
50
50
  end
51
51
  [date, time_sums]
52
52
  end
53
53
  end
54
54
 
55
+ def branch(id)
56
+ @branches.fetch(id, {})
57
+ end
58
+
55
59
  def dates
56
60
  @raw_logs.map { |log| log[:time].to_date }.uniq.sort
57
61
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: herodot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - bitcrowd