checkoff 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a75e010929b7dcb752bf9cffd0f424039cb4c54da94e44af30a8b8627f13eefb
4
- data.tar.gz: f2410a5287cf99a90f23ed7052a18f09553a652b87b575a2b665e7717c0193fa
3
+ metadata.gz: 7b1f3d6529d89f32c97dd4d8a1f1b83d3bbcb49381878a0cfdc829d888f92f38
4
+ data.tar.gz: b8d51699db4f09ed1ccd73ef880599d6a0eb16c5db099f8f7a4f14b838986034
5
5
  SHA512:
6
- metadata.gz: b7f458362faa147dc0c6d6097b4c3e912ce73c9a5de729fdfedd61bb691b7f0825b35dbce99ad5e06e7b82a1945a576fde09455fb94655a4748995d251da62e2
7
- data.tar.gz: 3e47840ed4da82d9859876773436ad678f44b02e9b8aa1de34ed7f2de6b0a1ea4cb4b25738c627bc2d7bca1de27ced995e9b57e6f6af3e52badf499bdf5f4cd5
6
+ metadata.gz: 35721e0504bafa225ba9ce30f5986bee48ebac72eb1b662517446b16336ec59299e135629eead8a65d1c949853795f14d4efe1a174d5584774b115eeafeab020
7
+ data.tar.gz: 79e75059b2a1268fc4cb5399d1d5455ef124203afe44d564aa2979ba9c631bedc30cd11c95bb1ee43f48884f39bbb77c033b587ee65e5a4694bf6b46bb793749
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "result": {
3
- "covered_percent": 85.99
3
+ "covered_percent": 83.9
4
4
  }
5
5
  }
@@ -23,6 +23,10 @@ module Checkoff
23
23
 
24
24
  def file_task_by_section(by_section, task, project_gid)
25
25
  membership = task.memberships.find { |m| m.project.gid == project_gid }
26
+ if membership.nil?
27
+ raise "Could not find task in project_gid #{project_gid}: #{task}"
28
+ end
29
+
26
30
  current_section = membership.section.name
27
31
  by_section[current_section] ||= []
28
32
  by_section[current_section] << task
@@ -43,6 +47,27 @@ module Checkoff
43
47
  by_section(active_tasks, project.gid)
44
48
  end
45
49
 
50
+ def legacy_file_task_by_section(current_section, by_section, task)
51
+ if task.name =~ /:$/
52
+ current_section = task.name
53
+ by_section[current_section] = []
54
+ else
55
+ by_section[current_section] ||= []
56
+ by_section[current_section] << task
57
+ end
58
+ [current_section, by_section]
59
+ end
60
+
61
+ def legacy_by_section(tasks)
62
+ current_section = nil
63
+ by_section = {}
64
+ tasks.each do |task|
65
+ current_section, by_section =
66
+ legacy_file_task_by_section(current_section, by_section, task)
67
+ end
68
+ by_section
69
+ end
70
+
46
71
  def tasks_by_section_for_project_and_assignee_status(project,
47
72
  assignee_status)
48
73
  raw_tasks = projects.tasks_from_project(project)
@@ -50,7 +75,7 @@ module Checkoff
50
75
  projects.active_tasks(raw_tasks)
51
76
  .group_by(&:assignee_status)
52
77
  active_tasks = by_assignee_status[assignee_status]
53
- by_section(active_tasks, project.gid)
78
+ legacy_by_section(active_tasks)
54
79
  end
55
80
 
56
81
  def project_or_raise(workspace_name, project_name)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Checkoff
4
- VERSION = '0.5.0'
4
+ VERSION = '0.5.1'
5
5
  end
@@ -1 +1 @@
1
- 389
1
+ 409
@@ -1 +1 @@
1
- 2
1
+ 1
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: checkoff
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vince Broz