checkoff 0.38.0 → 0.39.1

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: fb28394467995eb9df10b9fa896614dca20ef97b0759c2945bb3baaf98ba0d56
4
- data.tar.gz: 3b565699736d8956d83a94e8c93d910ecfac4f7f65280e27303d0da8dd3fd6ff
3
+ metadata.gz: dde98e951a53086231de929b8eab46e11ab7056e853879da48363a17e36c9404
4
+ data.tar.gz: c3e8bd5a59452d1e3cbaa5776b1b36b9ea9097062cee836dbc54b42c2b400e36
5
5
  SHA512:
6
- metadata.gz: 3cfeaa16ebe32cda3959dfce64b72382e743d5dcf40a2d1771c2b2d725594f8d505f094139163bca7e6059908b02d5811260c75b7670126a1bcdf22fb306c9f6
7
- data.tar.gz: 9066df52dadb002a5b8bd34a7a1fc852d1e45b4543202e21995dee9e491703357ba305b612c5772d5c9c0153e5c7245c9304988e0f5751b608bfbe03e420d214
6
+ metadata.gz: 9c673008ef9a2985c5ffa0b22bbda49199c4b072bd6c90c2642bf318d5a1fa455b85677016e046cd0f10aada9cff0507f1ba4b53317d5407a13c746e8a625247
7
+ data.tar.gz: f1eba99cad086db81ba4b69a28cefd754ac4c98d3a9016ed191e065481011b5971194be2c80a303d55daa48c195ef4506d7ae3c364719cc707faab05c259e1b5
@@ -49,7 +49,7 @@ module Overcommit
49
49
  message = error.sub("#{file_path}:#{lineno} - ",
50
50
  "#{file_path}:#{lineno}: ")
51
51
  # Emit the errors in the specified format
52
- Overcommit::Hook::Message.new(:error, file, lineno, message)
52
+ Overcommit::Hook::Message.new(:error, file, lineno.to_i, message)
53
53
  end
54
54
  end
55
55
  end
data/.overcommit.yml CHANGED
@@ -25,7 +25,6 @@ PreCommit:
25
25
  quiet: true
26
26
  RuboCop:
27
27
  enabled: true
28
- on_warn: fail # Treat all warnings as failures
29
28
  command: ['bundle', 'exec', 'rubocop']
30
29
  include:
31
30
  - '**/*.gemspec'
@@ -36,6 +35,7 @@ PreCommit:
36
35
  - '**/Rakefile'
37
36
  - 'bin/*'
38
37
  - 'exe/*'
38
+ problem_on_unmodified_line: warn
39
39
  exclude:
40
40
  - db/migrate/*.rb
41
41
  - db/schema.rb
@@ -60,7 +60,7 @@ PreCommit:
60
60
  enabled: true
61
61
  SolargraphTypecheck:
62
62
  enabled: true
63
- on_warn: fail
63
+ problem_on_unmodified_line: warn
64
64
  include:
65
65
  - '**/*.rb'
66
66
  Punchlist:
data/.rubocop.yml CHANGED
@@ -5,6 +5,10 @@ Layout/LineLength:
5
5
  Layout/MultilineMethodCallIndentation:
6
6
  EnforcedStyle: indented
7
7
 
8
+ Lint/EmptyClass:
9
+ # some workarounds for circular dependencies require empty classes
10
+ AllowComments: true
11
+
8
12
  Lint/UnusedMethodArgument:
9
13
  AllowUnusedKeywordArguments: true
10
14
 
@@ -79,6 +83,11 @@ Style/StringLiterals:
79
83
  - double_quotes
80
84
  ConsistentQuotesInMultiline: true
81
85
 
86
+ # Solargraph needs to see a class inherited from Struct to recognize
87
+ # what's going on
88
+ Style/StructInheritance:
89
+ Enabled: false
90
+
82
91
  # I like trailing commas in arrays and hashes. They let me insert new
83
92
  # elements and see them as one line in a diff, not two.
84
93
  Style/TrailingCommaInArrayLiteral:
data/Gemfile.lock CHANGED
@@ -12,7 +12,7 @@ GIT
12
12
  PATH
13
13
  remote: .
14
14
  specs:
15
- checkoff (0.38.0)
15
+ checkoff (0.39.1)
16
16
  activesupport
17
17
  asana (> 0.10.0)
18
18
  cache_method
@@ -74,7 +74,7 @@ GEM
74
74
  multi_json
75
75
  gli (2.21.0)
76
76
  hashdiff (1.0.1)
77
- i18n (1.13.0)
77
+ i18n (1.14.0)
78
78
  concurrent-ruby (~> 1.0)
79
79
  imagen (0.1.8)
80
80
  parser (>= 2.5, != 2.5.1.1)
@@ -99,9 +99,14 @@ module Checkoff
99
99
  # handle 'subtask' search url param
100
100
  class Subtask < SimpleParam
101
101
  def convert
102
- return ['is_subtask', false] if single_value == 'is_not_subtask'
103
-
104
- raise "Teach me how to handle #{key} = #{values}"
102
+ case single_value
103
+ when 'is_not_subtask'
104
+ ['is_subtask', false]
105
+ when 'is_subtask'
106
+ ['is_subtask', true]
107
+ else
108
+ raise "Teach me how to handle #{key} = #{values}"
109
+ end
105
110
  end
106
111
  end
107
112
 
@@ -39,6 +39,10 @@ module Checkoff
39
39
 
40
40
  # Given a workspace name and project name, then provide a Hash of
41
41
  # tasks with section name -> task list of the uncompleted tasks
42
+ # @param workspace_name [String]
43
+ # @param project_name [String, Symbol]
44
+ # @param extra_fields [Array<String>]
45
+ # @return [Hash{[String, nil] => Array<Asana::Resources::Task>}]
42
46
  def tasks_by_section(workspace_name, project_name, extra_fields: [])
43
47
  project = project_or_raise(workspace_name, project_name)
44
48
  if project_name == :my_tasks
@@ -64,6 +68,10 @@ module Checkoff
64
68
  cache_method :tasks, SHORT_CACHE_TIME
65
69
 
66
70
  # Pulls just names of tasks from a given section.
71
+ # @param workspace_name [String]
72
+ # @param project_name [String, Symbol]
73
+ # @param section_name [String, nil]
74
+ # @return [Array<String>]
67
75
  def section_task_names(workspace_name, project_name, section_name)
68
76
  tasks = tasks(workspace_name, project_name, section_name)
69
77
  tasks.map(&:name)
@@ -88,6 +96,8 @@ module Checkoff
88
96
 
89
97
  # Given a project object, pull all tasks, then provide a Hash of
90
98
  # tasks with section name -> task list of the uncompleted tasks
99
+ # @param project [Asana::Resources::Project]
100
+ # @return [Hash<[String,nil], Array<Asana::Resources::Task>>]
91
101
  def tasks_by_section_for_project(project, extra_fields: [])
92
102
  raw_tasks = projects.tasks_from_project(project, extra_fields: extra_fields)
93
103
  active_tasks = projects.active_tasks(raw_tasks)
@@ -102,6 +112,9 @@ module Checkoff
102
112
  end
103
113
 
104
114
  # Given a list of tasks, pull a Hash of tasks with section name -> task list
115
+ # @param tasks [Array<Asana::Resources::Task>]
116
+ # @param project_gid [String]
117
+ # @return [Hash<[String,nil], Array<Asana::Resources::Task>>]
105
118
  def by_section(tasks, project_gid)
106
119
  by_section = {}
107
120
  sections = client.sections.get_sections_for_project(project_gid: project_gid)
@@ -27,6 +27,8 @@ module Checkoff
27
27
  end
28
28
 
29
29
  # pulls a Hash of subtasks broken out by section
30
+ # @param tasks [Array<Asana::Resources::Task>]
31
+ # @return [Hash<[nil,String], Array<Asana::Resources::Task>>]
30
32
  def by_section(tasks)
31
33
  current_section = nil
32
34
  by_section = { nil => [] }
@@ -14,7 +14,6 @@ require_relative 'tasks'
14
14
  module Checkoff
15
15
  # Filter lists of tasks using declarative selectors.
16
16
  class TaskSelectors
17
- # @type [Integer]
18
17
  MINUTE = 60
19
18
  HOUR = MINUTE * 60
20
19
  DAY = 24 * HOUR
@@ -30,8 +29,10 @@ module Checkoff
30
29
  @tasks = tasks
31
30
  end
32
31
 
32
+ # @param [Asana::Resources::Task] task
33
33
  # @param [Hash<Symbol, Object>] task_selector Filter based on
34
34
  # description. Examples: {tag: 'foo'} {:not {tag: 'foo'} (:tag 'foo')
35
+ # @return [Boolean]
35
36
  def filter_via_task_selector(task, task_selector)
36
37
  evaluator = TaskSelectorEvaluator.new(task: task, tasks: tasks)
37
38
  evaluator.evaluate(task_selector)
@@ -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.38.0'
6
+ VERSION = '0.39.1'
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.38.0
4
+ version: 0.39.1
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-05-29 00:00:00.000000000 Z
11
+ date: 2023-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport