checkoff 0.3.2 → 0.4.0

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: 7b60fa3a74c9081153ae5c0f489da64684033ae6f675129d07aaf401dcc43170
4
- data.tar.gz: a382e7ad7163e6465e561eb427f2ddc5c73c5039de45028d306aec082212995a
3
+ metadata.gz: abb481b28efc4dc6131fdc028fe0bffb8c441dc92c95474e23455f7a1fed8ede
4
+ data.tar.gz: 98e270c7be0078e5efa19425affc4692c3343d093e5ab96d027eb5b643d8b141
5
5
  SHA512:
6
- metadata.gz: a3599189037cb4bc794f1acb098e927b8556d88bde21c49591e6e79b6cd203c74befad345c883a4c28e07edc73ca467601099a93f99b8b8abf4f28150df4aed6
7
- data.tar.gz: 747a97c032b4e40ead6c6e2d76ec6e571b0b37e2ec7e66cf7ed706d95061ef90e0c2666f3d974199801b98c4f5083d772e76ddacd0460d549c326dcbb036b791
6
+ metadata.gz: 2c6ddd7d5092290e0fbc953274f98c2b0b68262aef2201a378fa71a947152ee3c0d331c730127e5ba05616e7e9afc3261324a5d0b6babbaf63c4bd96115fcfa2
7
+ data.tar.gz: 3ba297866e0c3970e12a8f31b796359f58b93d02a2d7aae5aef04dd071e68a5d4d41a4c5c4e8b3ec5f38123b0f7072f1dd2ee98217fae9bd3d1a6fb2aa843012
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "result": {
3
- "covered_percent": 98.65
3
+ "covered_percent": 88.54
4
4
  }
5
5
  }
@@ -77,7 +77,8 @@ module Checkoff
77
77
  {
78
78
  per_page: 100,
79
79
  options: {
80
- fields: %w[name completed_at due_at due_on assignee_status tags],
80
+ fields: %w[name completed_at due_at due_on assignee_status tags
81
+ memberships.project.gid memberships.section.name],
81
82
  },
82
83
  }
83
84
  end
@@ -87,7 +88,7 @@ module Checkoff
87
88
  options[:completed_since] = '9999-12-01' if only_uncompleted
88
89
  options[:project] = project.gid
89
90
  options[:options][:fields] += extra_fields
90
- client.tasks.find_all(options).to_a
91
+ client.tasks.find_all(**options).to_a
91
92
  end
92
93
  cache_method :tasks_from_project, SHORT_CACHE_TIME
93
94
  end
@@ -21,23 +21,17 @@ module Checkoff
21
21
 
22
22
  def_delegators :@projects, :client
23
23
 
24
- def file_task_by_section(current_section, by_section, task)
25
- if task.name =~ /:$/
26
- current_section = task.name
27
- by_section[current_section] = []
28
- else
29
- by_section[current_section] ||= []
30
- by_section[current_section] << task
31
- end
32
- [current_section, by_section]
24
+ def file_task_by_section(by_section, task, project_gid)
25
+ membership = task.memberships.find { |m| m.project.gid == project_gid }
26
+ current_section = membership.section.name
27
+ by_section[current_section] ||= []
28
+ by_section[current_section] << task
33
29
  end
34
30
 
35
- def by_section(tasks)
36
- current_section = nil
31
+ def by_section(tasks, project_gid)
37
32
  by_section = {}
38
33
  tasks.each do |task|
39
- current_section, by_section = file_task_by_section(current_section,
40
- by_section, task)
34
+ file_task_by_section(by_section, task, project_gid)
41
35
  end
42
36
  by_section
43
37
  end
@@ -46,7 +40,7 @@ module Checkoff
46
40
  def tasks_by_section_for_project(project)
47
41
  raw_tasks = projects.tasks_from_project(project)
48
42
  active_tasks = projects.active_tasks(raw_tasks)
49
- by_section(active_tasks)
43
+ by_section(active_tasks, project.gid)
50
44
  end
51
45
 
52
46
  def tasks_by_section_for_project_and_assignee_status(project,
@@ -56,7 +50,7 @@ module Checkoff
56
50
  projects.active_tasks(raw_tasks)
57
51
  .group_by(&:assignee_status)
58
52
  active_tasks = by_assignee_status[assignee_status]
59
- by_section(active_tasks)
53
+ by_section(active_tasks, project.gid)
60
54
  end
61
55
 
62
56
  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.3.2'
4
+ VERSION = '0.4.0'
5
5
  end
@@ -1 +1 @@
1
- 457
1
+ 390
@@ -1 +1 @@
1
- 10
1
+ 3
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: checkoff
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vince Broz
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-10-11 00:00:00.000000000 Z
11
+ date: 2020-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport