checkoff 0.59.0 → 0.60.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 +4 -4
- data/Gemfile.lock +13 -2
- data/lib/checkoff/internal/project_selector_evaluator.rb +9 -3
- data/lib/checkoff/internal/search_url/simple_param_converter.rb +9 -0
- data/lib/checkoff/internal/selector_classes/task.rb +23 -0
- data/lib/checkoff/internal/task_selector_evaluator.rb +9 -23
- data/lib/checkoff/version.rb +1 -1
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 560f8d3dadb4f15e7b3329091bd82e301b23dd479f558e1a637a04aa8bc2067b
         | 
| 4 | 
            +
              data.tar.gz: bdfbe8d442602eaa15bb0c995677d88ad4897b8b8f068f04e087ca28ed02d255
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 5044cbdbe5d31947c795bdf3ca9d90ab71614059779c1a3ac3a3c19430a227ca89a1ee9ff661b3c523eef9cc9b019843aae41c4240d321b91725efc7dacc1731
         | 
| 7 | 
            +
              data.tar.gz: ab7bf654fdd30941dfe00ad78351b6b5aa36275b36103b491954f953cf10a643a16d6895cb8c091db52b3586ea3fbe7c12f0be94beecd2498a83242a07d781ab
         | 
    
        data/Gemfile.lock
    CHANGED
    
    | @@ -12,7 +12,7 @@ GIT | |
| 12 12 | 
             
            PATH
         | 
| 13 13 | 
             
              remote: .
         | 
| 14 14 | 
             
              specs:
         | 
| 15 | 
            -
                checkoff (0. | 
| 15 | 
            +
                checkoff (0.60.0)
         | 
| 16 16 | 
             
                  activesupport
         | 
| 17 17 | 
             
                  asana (> 0.10.0)
         | 
| 18 18 | 
             
                  cache_method
         | 
| @@ -22,17 +22,24 @@ PATH | |
| 22 22 | 
             
            GEM
         | 
| 23 23 | 
             
              remote: https://rubygems.org/
         | 
| 24 24 | 
             
              specs:
         | 
| 25 | 
            -
                activesupport (7.0 | 
| 25 | 
            +
                activesupport (7.1.0)
         | 
| 26 | 
            +
                  base64
         | 
| 27 | 
            +
                  bigdecimal
         | 
| 26 28 | 
             
                  concurrent-ruby (~> 1.0, >= 1.0.2)
         | 
| 29 | 
            +
                  connection_pool (>= 2.2.5)
         | 
| 30 | 
            +
                  drb
         | 
| 27 31 | 
             
                  i18n (>= 1.6, < 2)
         | 
| 28 32 | 
             
                  minitest (>= 5.1)
         | 
| 33 | 
            +
                  mutex_m
         | 
| 29 34 | 
             
                  tzinfo (~> 2.0)
         | 
| 30 35 | 
             
                addressable (2.8.1)
         | 
| 31 36 | 
             
                  public_suffix (>= 2.0.2, < 6.0)
         | 
| 32 37 | 
             
                ansi (1.5.0)
         | 
| 33 38 | 
             
                ast (2.4.2)
         | 
| 34 39 | 
             
                backport (1.2.0)
         | 
| 40 | 
            +
                base64 (0.1.1)
         | 
| 35 41 | 
             
                benchmark (0.2.1)
         | 
| 42 | 
            +
                bigdecimal (3.1.4)
         | 
| 36 43 | 
             
                builder (3.2.4)
         | 
| 37 44 | 
             
                bump (0.10.0)
         | 
| 38 45 | 
             
                cache (0.4.1)
         | 
| @@ -43,11 +50,14 @@ GEM | |
| 43 50 | 
             
                childprocess (4.1.0)
         | 
| 44 51 | 
             
                coderay (1.1.3)
         | 
| 45 52 | 
             
                concurrent-ruby (1.2.2)
         | 
| 53 | 
            +
                connection_pool (2.4.1)
         | 
| 46 54 | 
             
                crack (0.4.5)
         | 
| 47 55 | 
             
                  rexml
         | 
| 48 56 | 
             
                dalli (3.2.6)
         | 
| 49 57 | 
             
                diff-lcs (1.5.0)
         | 
| 50 58 | 
             
                docile (1.4.0)
         | 
| 59 | 
            +
                drb (2.1.1)
         | 
| 60 | 
            +
                  ruby2_keywords
         | 
| 51 61 | 
             
                e2mmap (0.1.0)
         | 
| 52 62 | 
             
                fakeweb (1.3.0)
         | 
| 53 63 | 
             
                faraday (1.5.1)
         | 
| @@ -110,6 +120,7 @@ GEM | |
| 110 120 | 
             
                multi_json (1.15.0)
         | 
| 111 121 | 
             
                multi_xml (0.6.0)
         | 
| 112 122 | 
             
                multipart-post (2.1.1)
         | 
| 123 | 
            +
                mutex_m (0.1.2)
         | 
| 113 124 | 
             
                nokogiri (1.15.2)
         | 
| 114 125 | 
             
                  mini_portile2 (~> 2.8.2)
         | 
| 115 126 | 
             
                  racc (~> 1.4)
         | 
| @@ -18,9 +18,15 @@ module Checkoff | |
| 18 18 |  | 
| 19 19 | 
             
                private
         | 
| 20 20 |  | 
| 21 | 
            -
                 | 
| 22 | 
            -
                  Checkoff::SelectorClasses::Common | 
| 23 | 
            -
                ].freeze
         | 
| 21 | 
            +
                COMMON_FUNCTION_EVALUATORS = (Checkoff::SelectorClasses::Common.constants.map do |const|
         | 
| 22 | 
            +
                  Checkoff::SelectorClasses::Common.const_get(const)
         | 
| 23 | 
            +
                end - [Checkoff::SelectorClasses::Common::FunctionEvaluator]).freeze
         | 
| 24 | 
            +
             | 
| 25 | 
            +
                PROJECT_FUNCTION_EVALUATORS = (Checkoff::SelectorClasses::Project.constants.map do |const|
         | 
| 26 | 
            +
                  Checkoff::SelectorClasses::Project.const_get(const)
         | 
| 27 | 
            +
                end - [Checkoff::SelectorClasses::Project::FunctionEvaluator]).freeze
         | 
| 28 | 
            +
             | 
| 29 | 
            +
                FUNCTION_EVALUTORS = (COMMON_FUNCTION_EVALUATORS + PROJECT_FUNCTION_EVALUATORS).freeze
         | 
| 24 30 |  | 
| 25 31 | 
             
                # @return [Array<Class<ProjectSelectorClasses::FunctionEvaluator>>]
         | 
| 26 32 | 
             
                def function_evaluators
         | 
| @@ -70,6 +70,14 @@ module Checkoff | |
| 70 70 | 
             
                      end
         | 
| 71 71 | 
             
                    end
         | 
| 72 72 |  | 
| 73 | 
            +
                    # Handle 'portfolios.ids' search url param
         | 
| 74 | 
            +
                    class PortfoliosIds < SimpleParam
         | 
| 75 | 
            +
                      # @return [Array<String>]
         | 
| 76 | 
            +
                      def convert
         | 
| 77 | 
            +
                        { 'portfolios.any' => single_value.split('~').join(',') }.to_a.flatten
         | 
| 78 | 
            +
                      end
         | 
| 79 | 
            +
                    end
         | 
| 80 | 
            +
             | 
| 73 81 | 
             
                    # Handle 'any_projects.ids' search url param
         | 
| 74 82 | 
             
                    class AnyProjectsIds < SimpleParam
         | 
| 75 83 | 
             
                      # @return [Array<String>]
         | 
| @@ -188,6 +196,7 @@ module Checkoff | |
| 188 196 |  | 
| 189 197 | 
             
                    # @type [Hash<String, Class<SimpleParam::SimpleParam>>] the mapping from param name to class
         | 
| 190 198 | 
             
                    ARGS = {
         | 
| 199 | 
            +
                      'portfolios.ids' => SimpleParam::PortfoliosIds,
         | 
| 191 200 | 
             
                      'any_projects.ids' => SimpleParam::AnyProjectsIds,
         | 
| 192 201 | 
             
                      'not_projects.ids' => SimpleParam::NotProjectsIds,
         | 
| 193 202 | 
             
                      'completion' => SimpleParam::Completion,
         | 
| @@ -5,6 +5,29 @@ require_relative 'task/function_evaluator' | |
| 5 5 | 
             
            module Checkoff
         | 
| 6 6 | 
             
              module SelectorClasses
         | 
| 7 7 | 
             
                module Task
         | 
| 8 | 
            +
                  # :in_section_named? function
         | 
| 9 | 
            +
                  class InSectionNamedPFunctionEvaluator < FunctionEvaluator
         | 
| 10 | 
            +
                    def matches?
         | 
| 11 | 
            +
                      fn?(selector, :in_section_named?)
         | 
| 12 | 
            +
                    end
         | 
| 13 | 
            +
             | 
| 14 | 
            +
                    # @param _index [Integer]
         | 
| 15 | 
            +
                    def evaluate_arg?(_index)
         | 
| 16 | 
            +
                      false
         | 
| 17 | 
            +
                    end
         | 
| 18 | 
            +
             | 
| 19 | 
            +
                    # @sg-ignore
         | 
| 20 | 
            +
                    # @param task [Asana::Resources::Task]
         | 
| 21 | 
            +
                    # @param tag_name [String]
         | 
| 22 | 
            +
                    # @return [Boolean]
         | 
| 23 | 
            +
                    def evaluate(task, section_name)
         | 
| 24 | 
            +
                      section_names = task.memberships.map do |membership|
         | 
| 25 | 
            +
                        membership.fetch('section').fetch('name')
         | 
| 26 | 
            +
                      end
         | 
| 27 | 
            +
                      section_names.include? section_name
         | 
| 28 | 
            +
                    end
         | 
| 29 | 
            +
                  end
         | 
| 30 | 
            +
             | 
| 8 31 | 
             
                  # :tag function
         | 
| 9 32 | 
             
                  class TagPFunctionEvaluator < FunctionEvaluator
         | 
| 10 33 | 
             
                    def matches?
         | 
| @@ -18,29 +18,15 @@ module Checkoff | |
| 18 18 |  | 
| 19 19 | 
             
                private
         | 
| 20 20 |  | 
| 21 | 
            -
                 | 
| 22 | 
            -
                  Checkoff::SelectorClasses::Common | 
| 23 | 
            -
             | 
| 24 | 
            -
             | 
| 25 | 
            -
             | 
| 26 | 
            -
                  Checkoff::SelectorClasses:: | 
| 27 | 
            -
             | 
| 28 | 
            -
             | 
| 29 | 
            -
             | 
| 30 | 
            -
                  Checkoff::SelectorClasses::Common::AndFunctionEvaluator,
         | 
| 31 | 
            -
                  Checkoff::SelectorClasses::Common::OrFunctionEvaluator,
         | 
| 32 | 
            -
                  Checkoff::SelectorClasses::Task::DuePFunctionEvaluator,
         | 
| 33 | 
            -
                  Checkoff::SelectorClasses::Task::DueBetweenRelativePFunctionEvaluator,
         | 
| 34 | 
            -
                  Checkoff::SelectorClasses::Task::UnassignedPFunctionEvaluator,
         | 
| 35 | 
            -
                  Checkoff::SelectorClasses::Task::DueDateSetPFunctionEvaluator,
         | 
| 36 | 
            -
                  Checkoff::SelectorClasses::Task::FieldLessThanNDaysAgoPFunctionEvaluator,
         | 
| 37 | 
            -
                  Checkoff::SelectorClasses::Task::FieldGreaterThanOrEqualToNDaysFromTodayPFunctionEvaluator,
         | 
| 38 | 
            -
                  Checkoff::SelectorClasses::Task::CustomFieldLessThanNDaysFromNowFunctionEvaluator,
         | 
| 39 | 
            -
                  Checkoff::SelectorClasses::Task::CustomFieldGreaterThanOrEqualToNDaysFromNowFunctionEvaluator,
         | 
| 40 | 
            -
                  Checkoff::SelectorClasses::Task::LastStoryCreatedLessThanNDaysAgoFunctionEvaluator,
         | 
| 41 | 
            -
                  Checkoff::SelectorClasses::Common::StringLiteralEvaluator,
         | 
| 42 | 
            -
                  Checkoff::SelectorClasses::Task::EstimateExceedsDurationFunctionEvaluator,
         | 
| 43 | 
            -
                ].freeze
         | 
| 21 | 
            +
                COMMON_FUNCTION_EVALUATORS = (Checkoff::SelectorClasses::Common.constants.map do |const|
         | 
| 22 | 
            +
                  Checkoff::SelectorClasses::Common.const_get(const)
         | 
| 23 | 
            +
                end - [Checkoff::SelectorClasses::Common::FunctionEvaluator]).freeze
         | 
| 24 | 
            +
             | 
| 25 | 
            +
                TASK_FUNCTION_EVALUATORS = (Checkoff::SelectorClasses::Task.constants.map do |const|
         | 
| 26 | 
            +
                  Checkoff::SelectorClasses::Task.const_get(const)
         | 
| 27 | 
            +
                end - [Checkoff::SelectorClasses::Task::FunctionEvaluator]).freeze
         | 
| 28 | 
            +
             | 
| 29 | 
            +
                FUNCTION_EVALUTORS = (COMMON_FUNCTION_EVALUATORS + TASK_FUNCTION_EVALUATORS).freeze
         | 
| 44 30 |  | 
| 45 31 | 
             
                # @return [Array<Class<TaskSelectorClasses::FunctionEvaluator>>]
         | 
| 46 32 | 
             
                def function_evaluators
         | 
    
        data/lib/checkoff/version.rb
    CHANGED
    
    
    
        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. | 
| 4 | 
            +
              version: 0.60.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- | 
| 11 | 
            +
            date: 2023-10-05 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: activesupport
         |