checkoff 0.54.0 → 0.55.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: 2a26bf5e53147ab791087492c23a9a050c6bdeef1d0edadba9a4d3d4741c32bf
4
- data.tar.gz: 403940c20a3e08c11904192168fbd6d0df95b012cd17e025148a777223b0f30c
3
+ metadata.gz: e441dfbcef11d610f73873858235bd110aa27b730a40eca5c5a38aac3e27ff5c
4
+ data.tar.gz: 4810a4c39437830b9dd6a909102328d6f413600a30bf2fe92702d1a59fe4ae61
5
5
  SHA512:
6
- metadata.gz: a5421aa9a82b335176e2cd98e0bba600acbaa61cc5e8c45fd876c13eeb5d2d1d750740f56a92cf8f556d79faf7b8ac162452d7ff6d30dff9719df5ffeba4930f
7
- data.tar.gz: 8dd35cf8d9009cb1bf76fd0b662a0d5bbde874a25c7cad914424131dc8d5e508ce0e39f0c2ba690b2ff3936bda3076ea9b6ec1eff6416ea032cd24bb0b10da59
6
+ metadata.gz: '08ad245068e7a1278a90943eff26e239175aa2874b9db59b682448f3069f8d3e71bddae0f21cefcddf2f315a95cfc0094800759487953fb519be6af9935886d1'
7
+ data.tar.gz: 02c0f071c4d722f26014d2029e13794a26e15ab1396291177e80b8d4506e301bd33b2e3984296314e8a57bf522c589c1a9f4684810564f8f3b387b1e780bbbe3
data/.solargraph.yml CHANGED
@@ -3,6 +3,9 @@ include:
3
3
  - "**/*.rb"
4
4
  - ".git-hooks/**/*.rb"
5
5
  exclude:
6
+ - spec/**/*
7
+ - feature/**/*
8
+ - test/**/*
6
9
  - vendor/**/*
7
10
  - ".bundle/**/*"
8
11
  require: []
data/Gemfile.lock CHANGED
@@ -12,7 +12,7 @@ GIT
12
12
  PATH
13
13
  remote: .
14
14
  specs:
15
- checkoff (0.54.0)
15
+ checkoff (0.55.0)
16
16
  activesupport
17
17
  asana (> 0.10.0)
18
18
  cache_method
@@ -484,6 +484,38 @@ module Checkoff
484
484
  end
485
485
  end
486
486
 
487
+ # :last_story_created_less_than_n_days_ago function
488
+ class LastStoryCreatedLessThanNDaysAgoFunctionEvaluator < FunctionEvaluator
489
+ FUNCTION_NAME = :last_story_created_less_than_n_days_ago
490
+
491
+ def matches?
492
+ fn?(task_selector, FUNCTION_NAME)
493
+ end
494
+
495
+ def evaluate_arg?(_index)
496
+ false
497
+ end
498
+
499
+ # @param task [Asana::Resources::Task]
500
+ # @param num_days [Integer]
501
+ # @param excluding_resource_subtypes [Array<String>]
502
+ # @return [Boolean]
503
+ def evaluate(task, num_days, excluding_resource_subtypes)
504
+ # for whatever reason, .last on the enumerable does not impose ordering; .to_a does!
505
+
506
+ # @type [Array<Asana::Resources::Story>]
507
+ stories = task.stories.to_a.reject do |story|
508
+ excluding_resource_subtypes.include? story.resource_subtype
509
+ end
510
+ return true if stories.empty? # no stories == infinitely old!
511
+
512
+ last_story = stories.last
513
+ last_story_created_at = Time.parse(last_story.created_at)
514
+ n_days_ago = Time.now - (num_days * 24 * 60 * 60)
515
+ last_story_created_at < n_days_ago
516
+ end
517
+ end
518
+
487
519
  # String literals
488
520
  class StringLiteralEvaluator < FunctionEvaluator
489
521
  def matches?
@@ -567,6 +599,7 @@ module Checkoff
567
599
  Checkoff::TaskSelectorClasses::FieldGreaterThanOrEqualToNDaysFromTodayFunctionEvaluator,
568
600
  Checkoff::TaskSelectorClasses::CustomFieldLessThanNDaysFromNowFunctionEvaluator,
569
601
  Checkoff::TaskSelectorClasses::CustomFieldGreaterThanOrEqualToNDaysFromNowFunctionEvaluator,
602
+ Checkoff::TaskSelectorClasses::LastStoryCreatedLessThanNDaysAgoFunctionEvaluator,
570
603
  Checkoff::TaskSelectorClasses::StringLiteralEvaluator,
571
604
  Checkoff::TaskSelectorClasses::EstimateExceedsDurationFunctionEvaluator,
572
605
  ].freeze
@@ -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.54.0'
6
+ VERSION = '0.55.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.54.0
4
+ version: 0.55.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-09-14 00:00:00.000000000 Z
11
+ date: 2023-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport