checkoff 0.8.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
data/lib/checkoff/cli.rb CHANGED
@@ -12,6 +12,7 @@ require_relative 'sections'
12
12
 
13
13
  module Checkoff
14
14
  # Provide ability for CLI to pull Asana items
15
+ # rubocop:disable Metrics/ClassLength
15
16
  class CLI
16
17
  attr_reader :sections, :stderr
17
18
 
@@ -86,6 +87,7 @@ module Checkoff
86
87
  subargs.task_name = args[2]
87
88
  end
88
89
 
90
+ # rubocop:disable Metrics/MethodLength
89
91
  def parse_args(args)
90
92
  mode = args[0]
91
93
  subargs = OpenStruct.new
@@ -99,6 +101,7 @@ module Checkoff
99
101
  end
100
102
  [mode, subargs]
101
103
  end
104
+ # rubocop:enable Metrics/MethodLength
102
105
 
103
106
  def output_help
104
107
  stderr.puts 'View tasks:'
@@ -135,4 +138,5 @@ module Checkoff
135
138
  end
136
139
  end
137
140
  end
141
+ # rubocop:enable Metrics/ClassLength
138
142
  end
@@ -49,10 +49,10 @@ module Checkoff
49
49
  end
50
50
 
51
51
  def my_tasks(workspace_name)
52
- my_tasks = @config.fetch(:my_tasks)
53
- gid = my_tasks[workspace_name] unless my_tasks.nil?
54
- raise "Please define [:my_tasks][#{workspace_name}] in config file" if my_tasks.nil? || gid.nil?
55
-
52
+ workspace = @workspaces.workspace_by_name(workspace_name)
53
+ result = client.user_task_lists.get_user_task_list_for_user(user_gid: 'me',
54
+ workspace: workspace.gid)
55
+ gid = result.gid
56
56
  projects.find_by_id(gid)
57
57
  end
58
58
 
@@ -4,6 +4,7 @@ require 'forwardable'
4
4
 
5
5
  module Checkoff
6
6
  # Query different sections of Asana projects
7
+ # rubocop:disable Metrics/ClassLength
7
8
  class Sections
8
9
  MINUTE = 60
9
10
  LONG_CACHE_TIME = MINUTE * 15
@@ -81,7 +82,7 @@ module Checkoff
81
82
  raw_tasks = projects.tasks_from_project(project)
82
83
  by_assignee_status =
83
84
  projects.active_tasks(raw_tasks)
84
- .group_by(&:assignee_status)
85
+ .group_by(&:assignee_status)
85
86
  active_tasks = by_assignee_status[assignee_status]
86
87
  legacy_by_section(active_tasks)
87
88
  end
@@ -110,14 +111,16 @@ module Checkoff
110
111
  def user_task_list_by_section(workspace_name, project_name)
111
112
  verify_legacy_user_task_list!(workspace_name)
112
113
 
114
+ project = projects.project(workspace_name, project_name)
113
115
  if project_name == :my_tasks
114
- legacy_tasks_by_section_for_project(project_name)
116
+ legacy_tasks_by_section_for_project(project)
115
117
  else
116
- legacy_tasks_by_section_for_project_and_assignee_status(project_name,
118
+ legacy_tasks_by_section_for_project_and_assignee_status(project,
117
119
  ASSIGNEE_STATUS_BY_PROJECT_NAME.fetch(project_name))
118
120
  end
119
121
  end
120
122
 
123
+ # rubocop:disable Metrics/MethodLength
121
124
  def tasks_by_section(workspace_name, project_name)
122
125
  project = project_or_raise(workspace_name, project_name)
123
126
  case project_name
@@ -134,6 +137,7 @@ module Checkoff
134
137
  end
135
138
  end
136
139
  cache_method :tasks_by_section, SHORT_CACHE_TIME
140
+ # rubocop:enable Metrics/MethodLength
137
141
 
138
142
  # XXX: Rename to section_tasks
139
143
  def tasks(workspace_name, project_name, section_name)
@@ -183,4 +187,5 @@ module Checkoff
183
187
  end
184
188
  cache_method :project_task_names, SHORT_CACHE_TIME
185
189
  end
190
+ # rubocop:enable Metrics/ClassLength
186
191
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Checkoff
4
- VERSION = '0.8.0'
4
+ VERSION = '0.9.0'
5
5
  end
@@ -0,0 +1 @@
1
+ yamllint==1.26.0
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.8.0
4
+ version: 0.9.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: 2021-03-01 00:00:00.000000000 Z
11
+ date: 2021-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -67,7 +67,7 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: bundler
70
+ name: bump
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ">="
@@ -81,7 +81,7 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: minitest-profile
84
+ name: bundler
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - ">="
@@ -95,7 +95,7 @@ dependencies:
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
- name: mocha
98
+ name: minitest-profile
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - ">="
@@ -109,7 +109,7 @@ dependencies:
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
- name: overcommit
112
+ name: mocha
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - ">="
@@ -123,19 +123,19 @@ dependencies:
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
- name: quality
126
+ name: overcommit
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - "~>"
129
+ - - ">="
130
130
  - !ruby/object:Gem::Version
131
- version: '38'
131
+ version: '0'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - "~>"
136
+ - - ">="
137
137
  - !ruby/object:Gem::Version
138
- version: '38'
138
+ version: '0'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: rake
141
141
  requirement: !ruby/object:Gem::Requirement
@@ -164,6 +164,48 @@ dependencies:
164
164
  - - ">="
165
165
  - !ruby/object:Gem::Version
166
166
  version: '3.4'
167
+ - !ruby/object:Gem::Dependency
168
+ name: rubocop
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
181
+ - !ruby/object:Gem::Dependency
182
+ name: rubocop-minitest
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - ">="
186
+ - !ruby/object:Gem::Version
187
+ version: '0'
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - ">="
193
+ - !ruby/object:Gem::Version
194
+ version: '0'
195
+ - !ruby/object:Gem::Dependency
196
+ name: rubocop-rake
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - ">="
200
+ - !ruby/object:Gem::Version
201
+ version: '0'
202
+ type: :development
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - ">="
207
+ - !ruby/object:Gem::Version
208
+ version: '0'
167
209
  - !ruby/object:Gem::Dependency
168
210
  name: simplecov
169
211
  requirement: !ruby/object:Gem::Requirement
@@ -188,24 +230,30 @@ extra_rdoc_files: []
188
230
  files:
189
231
  - ".circleci/config.yml"
190
232
  - ".envrc"
233
+ - ".git-hooks/pre-commit/circle_ci.rb"
191
234
  - ".gitignore"
192
235
  - ".overcommit.yml"
193
236
  - ".rubocop.yml"
194
237
  - ".ruby-version"
195
- - ".travis.yml"
238
+ - ".yamllint.yml"
196
239
  - CODE_OF_CONDUCT.md
197
240
  - Gemfile
198
- - LICENSE.txt
241
+ - Gemfile.lock
242
+ - LICENSE
199
243
  - Makefile
200
244
  - README.md
201
245
  - Rakefile
246
+ - bin/bump
202
247
  - bin/checkoff
203
248
  - bin/console
249
+ - bin/rake
204
250
  - bin/setup
205
251
  - checkoff.gemspec
206
252
  - coverage/.last_run.json
253
+ - docs/cookiecutter_input.json
207
254
  - docs/example_project.png
208
255
  - exe/checkoff
256
+ - fix.sh
209
257
  - lib/checkoff.rb
210
258
  - lib/checkoff/cli.rb
211
259
  - lib/checkoff/config_loader.rb
@@ -216,11 +264,8 @@ files:
216
264
  - lib/checkoff/version.rb
217
265
  - lib/checkoff/workspaces.rb
218
266
  - lib/tasks/ci.rake
219
- - lib/tasks/clear_metrics.rake
220
267
  - lib/tasks/default.rake
221
268
  - lib/tasks/feature.rake
222
- - lib/tasks/localtest.rake
223
- - lib/tasks/quality.rake
224
269
  - lib/tasks/spec.rake
225
270
  - lib/tasks/test.rake
226
271
  - metrics/bigfiles_high_water_mark
@@ -240,7 +285,8 @@ files:
240
285
  - metrics/rubocop_high_water_mark
241
286
  - metrics/scalastyle_high_water_mark
242
287
  - metrics/shellcheck_high_water_mark
243
- homepage: http://github.com/apiology/checkoff
288
+ - requirements_dev.txt
289
+ homepage: https://github.com/apiology/checkoff
244
290
  licenses:
245
291
  - MIT
246
292
  metadata: {}
data/.travis.yml DELETED
@@ -1,22 +0,0 @@
1
- language: ruby
2
- cache: bundler
3
- before_install:
4
- # https://bundler.io/blog/2019/05/14/
5
- # solutions-for-cant-find-gem-bundler-with-executable-bundle.html
6
- - gem update --system
7
- - gem install bundler
8
- rvm:
9
- # JRuby error with native code build - possibly can be overcome?
10
- # checking for main() in -lstdc++... RuntimeError: The compiler failed to generate
11
- # https://travis-ci.com/apiology/pronto-punchlist/jobs/264907931
12
- # - jruby-head
13
-
14
- # These are currently pending ruby-asana fixes:
15
- #
16
- # https://github.com/Asana/ruby-asana/pull/99
17
- #
18
- # - ruby-head
19
- # - ruby-3.0
20
- - ruby-2.7
21
- - ruby-2.6
22
- - ruby-2.5
@@ -1,8 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- desc 'Rebaseline quality thresholds to last commit'
4
- task :clear_metrics do |_t|
5
- ret =
6
- system('git checkout coverage/.last_run.json metrics/*_high_water_mark')
7
- raise unless ret
8
- end
@@ -1,4 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- desc 'Standard build when running on a workstation'
4
- task localtest: %i[clear_metrics test quality]
@@ -1,9 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'quality/rake/task'
4
-
5
- Quality::Rake::Task.new do |task|
6
- task.skip_tools = %w[reek cane eslint jscs pycodestyle rails_best_practices flake8]
7
- task.output_dir = 'metrics'
8
- task.exclude_files = ['docs/example_project.png', '.rubocop.yml']
9
- end