checkoff 0.119.0 → 0.121.0

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
  SHA256:
3
- metadata.gz: 1e003347c4270077540d8ab45c35a1901241c13c4be077301229242a85232230
4
- data.tar.gz: 9ae02faf012077dd032f662a364b91877860671dbf750bd85828f6eda737ac50
3
+ metadata.gz: adb0889f94b23a7b635cd7cf9a2b45e8e927a23e0ab7086f986126807cc7fc87
4
+ data.tar.gz: ea19c8cc593548a8e26f53526c609635b4e889b7a5748eb7563e860ab5714401
5
5
  SHA512:
6
- metadata.gz: a1e6c012f8d278e652349a9f86953fd594057d6eb01289b661170781f50b62e145288f12dd353a6c622f92301465783e6c2abaa5f855e93808435f56cf40f778
7
- data.tar.gz: 0e7e3d03fa75ae11e39ab0c311c3e0d9f24cb6a63adaa3e9ecec58321a2c3ffe2234b775188da36bdeb7b3ef179a3c86ac0ad5821e688bb45d4e3923977c1b19
6
+ metadata.gz: a4032ebf8d43d16b13d5012e37ab3d979ad9bf7738a25e3c0e8d13abe7b49582d581995c71304538468974e3ccda121fad8b1c4f2189d553eca8447beff26fac
7
+ data.tar.gz: 2a7ba839c8334e58729a483b3014e92d67ea519bedf8c6b85d7e893fec59bd695f306463b2ccd92af039d17408faf24ca924422d57bfc58df1f3526a59b1d120
data/Gemfile.lock CHANGED
@@ -12,7 +12,7 @@ GIT
12
12
  PATH
13
13
  remote: .
14
14
  specs:
15
- checkoff (0.119.0)
15
+ checkoff (0.121.0)
16
16
  activesupport
17
17
  asana (> 0.10.0)
18
18
  cache_method
@@ -265,11 +265,17 @@ module Checkoff
265
265
  fn?(selector, FUNCTION_NAME)
266
266
  end
267
267
 
268
+ def evaluate_arg?(_index)
269
+ false
270
+ end
271
+
268
272
  # @param task [Asana::Resources::Task]
273
+ # @param limit_to_portfolio_name [String, nil]
269
274
  #
270
275
  # @return [Boolean]
271
- def evaluate(task)
272
- !@timelines.last_task_milestone_depends_on_this_task?(task)
276
+ def evaluate(task, limit_to_portfolio_name = nil)
277
+ !@timelines.last_task_milestone_depends_on_this_task?(task,
278
+ limit_to_portfolio_name: limit_to_portfolio_name)
273
279
  end
274
280
  end
275
281
  end
@@ -27,17 +27,20 @@ module Checkoff
27
27
  # @param workspaces [Checkoff::Workspaces]
28
28
  # @param sections [Checkoff::Sections]
29
29
  # @param tasks [Checkoff::Tasks]
30
+ # @param portfolios [Checkoff::Portfolios]
30
31
  # @param clients [Checkoff::Clients]
31
32
  # @param client [Asana::Client]
32
33
  def initialize(config: Checkoff::Internal::ConfigLoader.load(:asana),
33
34
  workspaces: Checkoff::Workspaces.new(config: config),
34
35
  sections: Checkoff::Sections.new(config: config),
35
36
  tasks: Checkoff::Tasks.new(config: config),
37
+ portfolios: Checkoff::Portfolios.new(config: config),
36
38
  clients: Checkoff::Clients.new(config: config),
37
39
  client: clients.client)
38
40
  @workspaces = workspaces
39
41
  @sections = sections
40
42
  @tasks = tasks
43
+ @portfolios = portfolios
41
44
  @client = client
42
45
  end
43
46
 
@@ -59,9 +62,19 @@ module Checkoff
59
62
  end
60
63
 
61
64
  # @param task [Asana::Resources::Task]
62
- def last_task_milestone_depends_on_this_task?(task)
65
+ # @param limit_to_portfolio_name [String, nil]
66
+ def last_task_milestone_depends_on_this_task?(task, limit_to_portfolio_name: nil)
67
+ unless limit_to_portfolio_name.nil?
68
+ limit_to_projects = @portfolios.projects_in_portfolio(@workspaces.default_workspace.name,
69
+ limit_to_portfolio_name)
70
+ end
71
+
63
72
  all_dependent_task_gids = @tasks.all_dependent_tasks(task).map(&:gid)
64
73
  task.memberships.all? do |membership_data|
74
+ unless limit_to_portfolio_name.nil?
75
+ project_gid = membership_data.fetch('project').fetch('gid')
76
+ next true unless limit_to_projects.map(&:gid).include? project_gid
77
+ end
65
78
  # @type [Hash{String => String}]
66
79
  section_data = membership_data.fetch('section')
67
80
  # @type [String]
@@ -3,5 +3,5 @@
3
3
  # Command-line and gem client for Asana (unofficial)
4
4
  module Checkoff
5
5
  # Version of library
6
- VERSION = '0.119.0'
6
+ VERSION = '0.121.0'
7
7
  end
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.119.0
4
+ version: 0.121.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: 2023-10-31 00:00:00.000000000 Z
11
+ date: 2023-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport