checkoff 0.119.0 → 0.120.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: 1e003347c4270077540d8ab45c35a1901241c13c4be077301229242a85232230
4
- data.tar.gz: 9ae02faf012077dd032f662a364b91877860671dbf750bd85828f6eda737ac50
3
+ metadata.gz: 117e0d119a50af033c6f3b28fd27b12163547a3b236aa9ecc25440bc87f0107f
4
+ data.tar.gz: 1764ec654cb5b3d247a597c9630c0df5f5a94cca6614a6a914f5d293ba711ab4
5
5
  SHA512:
6
- metadata.gz: a1e6c012f8d278e652349a9f86953fd594057d6eb01289b661170781f50b62e145288f12dd353a6c622f92301465783e6c2abaa5f855e93808435f56cf40f778
7
- data.tar.gz: 0e7e3d03fa75ae11e39ab0c311c3e0d9f24cb6a63adaa3e9ecec58321a2c3ffe2234b775188da36bdeb7b3ef179a3c86ac0ad5821e688bb45d4e3923977c1b19
6
+ metadata.gz: ee2e30a3963d4ecb2677703a559c1e6452e40db3f55d536852f62a1d668f301df45e4ee584213124308063295628b28e0f10e7eaee9bdfb62846e8bf9d235fac
7
+ data.tar.gz: d2af0a7c6242e5a1b2e21582c354fbdc4596d63175aa2c0a59c27736a583c05b9bfeb852c212f7f82a7316908c2524edc20a51dab8566f40deaada016f40e061
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.120.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 if 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.120.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.120.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-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport