checkoff 0.12.0 → 0.13.2

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: 28bce7b1402a371b87f03a468cb1678cd02f7631a2a8f195a544b2bccc4af26e
4
- data.tar.gz: f645e96e4526173f33e7b3140d9fec84b59330a4050819467a4456f0b9e10679
3
+ metadata.gz: 02474a060394a81034f63de6adf9753735b16be09b2a86756972dfa98d616a89
4
+ data.tar.gz: 6da399f3f010e90f1f009c5a7ab8af66c78325979a60faddfe97b77da9b9442f
5
5
  SHA512:
6
- metadata.gz: 1503cc4b41f8297a806b57311c2f7f3e0e6d7b93027109125c985b4dba056e2709fdcec43d5ca312f9778ba044d67c28e8a5c055a692b7067ebf442491de912e
7
- data.tar.gz: 1b30b11537a9608e84ec1434c67a47579e0d6d2a8a88ee79084de24efc39c18e8b10fc1af5be5ccf7b4aac17509b4b16d540d2f4f2304b61f3100b0006ff2af4
6
+ metadata.gz: 5637378bb6d83018437b6222cc5ded57addeeb17b4037aca23118fbde7279b8ae11c3e43ad58a39a32fcec40aa4f7133e2d1e330657c84d7a24bbe47f1f25f04
7
+ data.tar.gz: 5195be1aae3a95d31d3c6d8a6a0b9647aef6ef8401c662458368b726ddda4c3c67305b4fef3b6719892447580b958d461ae6c964d08a22e4317dfc27f1b14b95
data/.circleci/config.yml CHANGED
@@ -37,7 +37,9 @@ commands:
37
37
  sed -E -e 's/checkoff \([[:digit:]]+.[[:digit:]]+.[[:digit:]]+\)/checkoff (0.1.0)/g' \
38
38
  Gemfile.lock > Gemfile.lock.deversioned
39
39
  - restore_cache:
40
- key: gems-v4-{{ checksum "Gemfile.lock.deversioned" }}
40
+ key: gems-v1-{{ checksum "Gemfile.lock.deversioned" }}
41
+ - restore_cache:
42
+ key: wheels-v1-{{ checksum "requirements_dev.txt" }}
41
43
  - run:
42
44
  name: Initialize packages
43
45
  command: |
@@ -52,9 +54,13 @@ commands:
52
54
  exit 1
53
55
  fi
54
56
  - save_cache:
55
- key: gems-v4-{{ checksum "Gemfile.lock.deversioned" }}
57
+ key: gems-v1-{{ checksum "Gemfile.lock.deversioned" }}
56
58
  paths:
57
59
  - "vendor/bundle"
60
+ - save_cache:
61
+ key: wheels-v1-{{ checksum "requirements_dev.txt" }}
62
+ paths:
63
+ - "/home/circleci/.cache/pip/wheels"
58
64
  - run:
59
65
  name: Download new circleci tool
60
66
  command: |
@@ -78,7 +84,7 @@ commands:
78
84
  jobs:
79
85
  overcommit:
80
86
  docker:
81
- - image: apiology/circleci:latest
87
+ - image: apiology/circleci-ruby:latest
82
88
  steps:
83
89
  - when:
84
90
  condition:
@@ -93,7 +99,7 @@ jobs:
93
99
  build:
94
100
  working_directory: ~/checkoff
95
101
  docker:
96
- - image: apiology/circleci:latest
102
+ - image: apiology/circleci-ruby:latest
97
103
  steps:
98
104
  - set_up_environment
99
105
  - run_with_languages:
@@ -117,6 +123,7 @@ workflows:
117
123
  - main
118
124
  jobs:
119
125
  - build
126
+ - overcommit
120
127
  overcommit:
121
128
  jobs:
122
129
  - overcommit
data/.rubocop.yml CHANGED
@@ -45,6 +45,15 @@ Naming/MethodParameterName:
45
45
  - x # cartesian coordinates
46
46
  - y # cartesian coordinates
47
47
 
48
+ # by default (EnforcedStyle=NormalCase) this rule doesn't like
49
+ # things like check_1, check_2, etc and wants check1, check2, etc. I
50
+ # like the former.
51
+ #
52
+ # https://docs.rubocop.org/rubocop/cops_naming.html#namingvariablenumber
53
+ Naming/VariableNumber:
54
+ Enabled: true
55
+ EnforcedStyle: snake_case
56
+
48
57
  #
49
58
  # Add 'XX X' to the standard list
50
59
  #
data/DEVELOPMENT.md CHANGED
@@ -21,8 +21,10 @@ development. See the `.envrc` file for detail.
21
21
  To publish new version as a maintainer:
22
22
 
23
23
  ```sh
24
+ git checkout main && git pull
24
25
  git log "v$(bump current)..."
25
26
  # Set type_of_bump to patch, minor, or major
26
27
  bump --tag --tag-prefix=v ${type_of_bump:?}
27
28
  rake release
29
+ git push
28
30
  ```
data/Gemfile CHANGED
@@ -4,3 +4,16 @@ source 'https://rubygems.org'
4
4
 
5
5
  # Specify your gem's dependencies in checkoff.gemspec
6
6
  gemspec
7
+
8
+ # ruby-asana gem is pending key bugfixes for checkoff as of
9
+ # 2021-07-29:
10
+ #
11
+ # See
12
+ # https://github.com/Asana/ruby-asana/issues/109
13
+ # https://github.com/Asana/ruby-asana/issues/110
14
+ #
15
+ gem 'asana',
16
+ git: 'https://github.com/apiology/ruby-asana',
17
+ branch: 'checkoff_fixes'
18
+
19
+ # gem 'asana', path: '/Users/broz/src/ruby-asana'
data/Gemfile.lock CHANGED
@@ -1,7 +1,18 @@
1
+ GIT
2
+ remote: https://github.com/apiology/ruby-asana
3
+ revision: 83732f040728a4ef1cfc9ed61f65878dbee6aa23
4
+ branch: checkoff_fixes
5
+ specs:
6
+ asana (0.10.4)
7
+ faraday (~> 1.0)
8
+ faraday_middleware (~> 1.0)
9
+ faraday_middleware-multi_json (~> 0.0)
10
+ oauth2 (~> 1.4)
11
+
1
12
  PATH
2
13
  remote: .
3
14
  specs:
4
- checkoff (0.12.0)
15
+ checkoff (0.13.2)
5
16
  activesupport
6
17
  asana (> 0.10.0)
7
18
  cache_method
@@ -17,17 +28,13 @@ GEM
17
28
  minitest (>= 5.1)
18
29
  tzinfo (~> 2.0)
19
30
  zeitwerk (~> 2.3)
20
- asana (0.10.3)
21
- faraday (~> 1.0)
22
- faraday_middleware (~> 1.0)
23
- faraday_middleware-multi_json (~> 0.0)
24
- oauth2 (~> 1.4)
25
31
  ast (2.4.2)
26
32
  bump (0.10.0)
27
33
  cache (0.4.1)
28
34
  cache_method (0.2.7)
29
35
  cache (>= 0.2.1)
30
36
  childprocess (4.0.0)
37
+ coderay (1.1.3)
31
38
  concurrent-ruby (1.1.9)
32
39
  dalli (2.7.11)
33
40
  docile (1.4.0)
@@ -60,6 +67,7 @@ GEM
60
67
  parser (>= 2.5, != 2.5.1.1)
61
68
  iniparse (1.5.0)
62
69
  jwt (2.2.3)
70
+ method_source (1.0.0)
63
71
  minitest (5.14.4)
64
72
  minitest-profile (0.0.2)
65
73
  mocha (1.12.0)
@@ -77,23 +85,26 @@ GEM
77
85
  iniparse (~> 1.4)
78
86
  rexml (~> 3.2)
79
87
  parallel (1.20.1)
80
- parser (3.0.1.1)
88
+ parser (3.0.2.0)
81
89
  ast (~> 2.4.1)
90
+ pry (0.14.1)
91
+ coderay (~> 1.1)
92
+ method_source (~> 1.0)
82
93
  rack (2.2.3)
83
94
  rainbow (3.0.0)
84
95
  rake (13.0.3)
85
96
  regexp_parser (2.1.1)
86
97
  rexml (3.2.5)
87
- rubocop (1.15.0)
98
+ rubocop (1.18.4)
88
99
  parallel (~> 1.10)
89
100
  parser (>= 3.0.0.0)
90
101
  rainbow (>= 2.2.2, < 4.0)
91
102
  regexp_parser (>= 1.8, < 3.0)
92
103
  rexml
93
- rubocop-ast (>= 1.5.0, < 2.0)
104
+ rubocop-ast (>= 1.8.0, < 2.0)
94
105
  ruby-progressbar (~> 1.7)
95
106
  unicode-display_width (>= 1.4.0, < 3.0)
96
- rubocop-ast (1.5.0)
107
+ rubocop-ast (1.8.0)
97
108
  parser (>= 3.0.1.1)
98
109
  rubocop-minitest (0.12.1)
99
110
  rubocop (>= 0.90, < 2.0)
@@ -125,17 +136,19 @@ PLATFORMS
125
136
  x86_64-linux
126
137
 
127
138
  DEPENDENCIES
139
+ asana!
128
140
  bump
129
141
  bundler
130
142
  checkoff!
131
143
  minitest-profile
132
144
  mocha
133
145
  overcommit (>= 0.58.0)
146
+ pry
134
147
  rake (~> 13.0)
135
148
  rubocop
136
149
  rubocop-minitest
137
150
  rubocop-rake
138
- simplecov
151
+ simplecov (>= 0.18.0)
139
152
  simplecov-lcov
140
153
  undercover
141
154
 
data/README.md CHANGED
@@ -1,7 +1,4 @@
1
- Command-line and gem client for Asana (unofficial)
2
-
3
- [![Circle CI](https://circleci.com/gh/apiology/checkoff.svg?style=svg)](https://circleci.com/gh/apiology/checkoff)
4
- [![Travis CI](https://travis-ci.org/apiology/checkoff.svg?branch=main)](https://travis-ci.org/apiology/checkoff)
1
+ [![CircleCI](https://circleci.com/gh/apiology/checkoff.svg?style=svg)](https://circleci.com/gh/apiology/checkoff)
5
2
 
6
3
  Command-line and gem client for Asana (unofficial)
7
4
 
data/checkoff.gemspec CHANGED
@@ -15,8 +15,10 @@ Gem::Specification.new do |spec|
15
15
  spec.license = 'MIT license'
16
16
  spec.required_ruby_version = '>= 2.6'
17
17
 
18
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
19
- f.match(%r{^(test|spec|features)/})
18
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
19
+ `git ls-files -z`.split("\x0").reject do |f|
20
+ f.match(%r{^(test|spec|features)/})
21
+ end
20
22
  end
21
23
  spec.bindir = 'exe'
22
24
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
@@ -36,11 +38,13 @@ Gem::Specification.new do |spec|
36
38
  # magit doesn't seem to want to use the bundled version at the moment,
37
39
  # so let's favor the more recent version...
38
40
  spec.add_development_dependency 'overcommit', ['>=0.58.0']
41
+ spec.add_development_dependency 'pry'
39
42
  spec.add_development_dependency 'rake', '~> 13.0'
40
43
  spec.add_development_dependency 'rubocop'
41
44
  spec.add_development_dependency 'rubocop-minitest'
42
45
  spec.add_development_dependency 'rubocop-rake'
43
- spec.add_development_dependency 'simplecov'
46
+ # ensure version with branch coverage
47
+ spec.add_development_dependency 'simplecov', ['>=0.18.0']
44
48
  spec.add_development_dependency 'simplecov-lcov'
45
49
  spec.add_development_dependency 'undercover'
46
50
  end
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "result": {
3
- "line": 97.0,
4
- "branch": 80.95
3
+ "line": 99.72,
4
+ "branch": 94.44
5
5
  }
6
6
  }
data/fix.sh CHANGED
@@ -95,7 +95,7 @@ ensure_ruby_build_requirements() {
95
95
  # been release here: https://www.ruby-lang.org/en/downloads/
96
96
  ensure_ruby_versions() {
97
97
  # You can find out which feature versions are still supported / have
98
- # been release here: https://www.python.org/downloads/
98
+ # been release here: https://www.ruby-lang.org/en/downloads/
99
99
  ruby_versions="$(latest_ruby_version 2.6)"
100
100
 
101
101
  echo "Latest Ruby versions: ${ruby_versions}"
@@ -227,6 +227,8 @@ ensure_python_build_requirements() {
227
227
  ensure_dev_library openssl/ssl.h openssl libssl-dev
228
228
  ensure_dev_library ffi.h libffi libffi-dev
229
229
  ensure_dev_library sqlite3.h sqlite3 libsqlite3-dev
230
+ ensure_dev_library lzma.h xz liblzma-dev
231
+ ensure_dev_library readline.h readline libreadline-dev
230
232
  }
231
233
 
232
234
  # You can find out which feature versions are still supported / have
@@ -234,7 +236,7 @@ ensure_python_build_requirements() {
234
236
  ensure_python_versions() {
235
237
  # You can find out which feature versions are still supported / have
236
238
  # been release here: https://www.python.org/downloads/
237
- python_versions="$(latest_python_version 3.9)"
239
+ python_versions="$(latest_python_version 3.10)"
238
240
 
239
241
  echo "Latest Python versions: ${python_versions}"
240
242
 
@@ -271,7 +273,7 @@ ensure_pyenv_virtualenvs() {
271
273
  pyenv local "${virtualenv_name}" ${python_versions} mylibs
272
274
  }
273
275
 
274
- ensure_pip() {
276
+ ensure_pip_and_wheel() {
275
277
  # Make sure we have a pip with the 20.3 resolver, and after the
276
278
  # initial bugfix release
277
279
  major_pip_version=$(pip --version | cut -d' ' -f2 | cut -d '.' -f 1)
@@ -279,6 +281,8 @@ ensure_pip() {
279
281
  then
280
282
  pip install 'pip>=20.3.1'
281
283
  fi
284
+ # wheel is helpful for being able to cache long package builds
285
+ pip show wheel >/dev/null 2>&1 || pip install wheel
282
286
  }
283
287
 
284
288
  ensure_python_requirements() {
@@ -325,7 +329,7 @@ ensure_python_versions
325
329
 
326
330
  ensure_pyenv_virtualenvs
327
331
 
328
- ensure_pip
332
+ ensure_pip_and_wheel
329
333
 
330
334
  ensure_python_requirements
331
335
 
data/lib/checkoff/cli.rb CHANGED
@@ -12,6 +12,112 @@ require_relative 'tasks'
12
12
  require_relative 'sections'
13
13
 
14
14
  module Checkoff
15
+ # Move tasks from one place to another
16
+ class MvSubcommand
17
+ def validate_and_assign_from_location(from_workspace_arg, from_project_arg, from_section_arg)
18
+ if from_workspace_arg == :default_workspace
19
+ # Figure out what to do here - we accept a default
20
+ # workspace gid and default workspace_gid arguments elsewhere.
21
+ # however, there are undefaulted workspace_name arguments as
22
+ # well...
23
+ raise NotImplementedError, 'Not implemented: Teach me how to look up default workspace name'
24
+ end
25
+
26
+ @from_workspace_name = from_workspace_arg
27
+ @from_project_name = project_arg_to_name(from_project_arg)
28
+ @from_section_name = from_section_arg
29
+ end
30
+
31
+ def create_to_project_name(to_project_arg)
32
+ if to_project_arg == :source_project
33
+ from_project_name
34
+ else
35
+ project_arg_to_name(to_project_arg)
36
+ end
37
+ end
38
+
39
+ def create_to_section_name(to_section_arg)
40
+ if to_section_arg == :source_section
41
+ from_section_name
42
+ else
43
+ to_section_arg
44
+ end
45
+ end
46
+
47
+ def validate_and_assign_to_location(to_workspace_arg, to_project_arg, to_section_arg)
48
+ @to_workspace_name = to_workspace_arg
49
+ @to_workspace_name = from_workspace_name if to_workspace_arg == :source_workspace
50
+ @to_project_name = create_to_project_name(to_project_arg)
51
+ @to_section_name = create_to_section_name(to_section_arg)
52
+
53
+ return unless from_workspace_name != to_workspace_name
54
+
55
+ raise NotImplementedError, 'Not implemented: Teach me how to move tasks between workspaces'
56
+ end
57
+
58
+ def initialize(from_workspace_arg:,
59
+ from_project_arg:,
60
+ from_section_arg:,
61
+ to_workspace_arg:,
62
+ to_project_arg:,
63
+ to_section_arg:,
64
+ config: Checkoff::ConfigLoader.load(:asana),
65
+ projects: Checkoff::Projects.new(config: config),
66
+ sections: Checkoff::Sections.new(config: config),
67
+ logger: $stderr)
68
+ validate_and_assign_from_location(from_workspace_arg, from_project_arg, from_section_arg)
69
+ validate_and_assign_to_location(to_workspace_arg, to_project_arg, to_section_arg)
70
+
71
+ @projects = projects
72
+ @sections = sections
73
+ @logger = logger
74
+ end
75
+
76
+ def move_tasks(tasks, to_project, to_section)
77
+ tasks.each do |task|
78
+ # a. check if already in correct project and section (TODO)
79
+ # b. if not, put it there
80
+ @logger.puts "Moving #{task.name} to #{to_section.name}..."
81
+ task.add_project(project: to_project.gid, section: to_section.gid)
82
+ end
83
+ end
84
+
85
+ def fetch_tasks(from_workspace_name, from_project_name, from_section_name)
86
+ if from_section_name == :all_sections
87
+ raise NotImplementedError, 'Not implemented: Teach me how to move all sections of a project'
88
+ end
89
+
90
+ sections.tasks(from_workspace_name, from_project_name, from_section_name)
91
+ end
92
+
93
+ def run
94
+ # 0. Look up project and section gids
95
+ to_project = projects.project_or_raise(to_workspace_name, to_project_name)
96
+ to_section = sections.section_or_raise(to_workspace_name, to_project_name, to_section_name)
97
+
98
+ # 1. Get list of tasks which match
99
+ tasks = fetch_tasks(from_workspace_name, from_project_name, from_section_name)
100
+ # 2. for each task,
101
+ move_tasks(tasks, to_project, to_section)
102
+ # 3. tell the user we're done'
103
+ @logger.puts 'Done moving tasks'
104
+ end
105
+
106
+ private
107
+
108
+ attr_reader :from_workspace_name, :from_project_name, :from_section_name,
109
+ :to_workspace_name, :to_project_name, :to_section_name,
110
+ :projects, :sections
111
+
112
+ def project_arg_to_name(project_arg)
113
+ if project_arg.start_with? ':'
114
+ project_arg[1..].to_sym
115
+ else
116
+ project_arg
117
+ end
118
+ end
119
+ end
120
+
15
121
  # CLI subcommand that shows tasks in JSON form
16
122
  class ViewSubcommand
17
123
  def initialize(workspace_name, project_name, section_name,
@@ -151,5 +257,50 @@ module Checkoff
151
257
  puts ViewSubcommand.new(workspace_name, project_name, section_name, task_name).run
152
258
  end
153
259
  end
260
+
261
+ desc 'Move tasks from one section to another within a project'
262
+
263
+ # rubocop:disable Metrics/BlockLength
264
+ command :mv do |c|
265
+ c.flag :from_workspace,
266
+ type: String,
267
+ default_value: :default_workspace,
268
+ desc: 'Workspace to move tasks from'
269
+ c.flag :from_project,
270
+ type: String,
271
+ required: true,
272
+ desc: 'Project to move tasks from'
273
+ c.flag :from_section,
274
+ type: String,
275
+ default_value: :all_sections,
276
+ desc: 'Section to move tasks from'
277
+ c.flag :to_workspace,
278
+ type: String,
279
+ default_value: :source_workspace,
280
+ desc: 'Workspace to move tasks to'
281
+ c.flag :to_project,
282
+ type: String,
283
+ default_value: :source_project,
284
+ desc: 'Section to move tasks to'
285
+ c.flag :to_section,
286
+ type: String,
287
+ default_value: :source_section,
288
+ desc: 'Section to move tasks to'
289
+ c.action do |_global_options, options, _args|
290
+ from_workspace = options.fetch('from_workspace')
291
+ from_project = options.fetch('from_project')
292
+ from_section = options.fetch('from_section')
293
+ to_workspace = options.fetch('to_workspace')
294
+ to_project = options.fetch('to_project')
295
+ to_section = options.fetch('to_section')
296
+ MvSubcommand.new(from_workspace_arg: from_workspace,
297
+ from_project_arg: from_project,
298
+ from_section_arg: from_section,
299
+ to_workspace_arg: to_workspace,
300
+ to_project_arg: to_project,
301
+ to_section_arg: to_section).run
302
+ end
303
+ end
304
+ # rubocop:enable Metrics/BlockLength
154
305
  end
155
306
  end
@@ -59,6 +59,14 @@ module Checkoff
59
59
  end
60
60
  cache_method :project, LONG_CACHE_TIME
61
61
 
62
+ def project_or_raise(workspace_name, project_name)
63
+ project = project(workspace_name, project_name)
64
+ raise "Could not find project #{project_name} under workspace #{workspace_name}." if project.nil?
65
+
66
+ project
67
+ end
68
+ cache_method :project_or_raise, LONG_CACHE_TIME
69
+
62
70
  # find uncompleted tasks in a list
63
71
  def active_tasks(tasks)
64
72
  tasks.select { |task| task.completed_at.nil? }
@@ -95,5 +103,6 @@ module Checkoff
95
103
  gid = result.gid
96
104
  projects.find_by_id(gid)
97
105
  end
106
+ cache_method :my_tasks, LONG_CACHE_TIME
98
107
  end
99
108
  end
@@ -44,12 +44,10 @@ module Checkoff
44
44
  extra_fields: [])
45
45
  section = section_or_raise(workspace_name, project_name, section_name)
46
46
  options = projects.task_options
47
- # asana-0.10.3 gem doesn't support per_page - not sure if API
48
- # itself does
49
- options.delete(:per_page)
50
47
  options[:options][:fields] += extra_fields
51
- client.tasks.get_tasks_for_section(section_gid: section.gid,
52
- **options).to_a
48
+ options[:completed_since] = '9999-12-01' if only_uncompleted
49
+ client.tasks.get_tasks(section: section.gid,
50
+ **options)
53
51
  end
54
52
  cache_method :tasks, SHORT_CACHE_TIME
55
53
 
@@ -60,6 +58,18 @@ module Checkoff
60
58
  end
61
59
  cache_method :section_task_names, SHORT_CACHE_TIME
62
60
 
61
+ def section_or_raise(workspace_name, project_name, section_name)
62
+ section = section(workspace_name, project_name, section_name)
63
+ if section.nil?
64
+ valid_sections = sections_or_raise(workspace_name, project_name).map(&:name)
65
+
66
+ raise "Could not find section #{section_name} under project #{project_name} " \
67
+ "under workspace #{workspace_name}. Valid sections: #{valid_sections}"
68
+ end
69
+ section
70
+ end
71
+ cache_method :section_or_raise, LONG_CACHE_TIME
72
+
63
73
  private
64
74
 
65
75
  # Given a project object, pull all tasks, then provide a Hash of
@@ -105,16 +115,5 @@ module Checkoff
105
115
  sections = sections_or_raise(workspace_name, project_name)
106
116
  sections.find { |section| section.name.chomp(':') == section_name.chomp(':') }
107
117
  end
108
-
109
- def section_or_raise(workspace_name, project_name, section_name)
110
- section = section(workspace_name, project_name, section_name)
111
- if section.nil?
112
- valid_sections = sections_or_raise(workspace_name, project_name).map(&:name)
113
-
114
- raise "Could not find section #{section_name} under project #{project_name} " \
115
- "under workspace #{workspace_name}. Valid sections: #{valid_sections}"
116
- end
117
- section
118
- end
119
118
  end
120
119
  end
@@ -11,6 +11,16 @@ module Checkoff
11
11
 
12
12
  extend Forwardable
13
13
 
14
+ def initialize(config: Checkoff::ConfigLoader.load(:asana),
15
+ projects: Checkoff::Projects.new(config: config))
16
+ @projects = projects
17
+ end
18
+
19
+ # true if the subtask passed in is actually a section header for subtasks
20
+ def subtask_section?(task)
21
+ task.name.end_with?(':')
22
+ end
23
+
14
24
  # pulls a Hash of subtasks broken out by section
15
25
  def by_section(tasks)
16
26
  current_section = nil
@@ -30,8 +40,10 @@ module Checkoff
30
40
 
31
41
  private
32
42
 
43
+ attr_reader :projects
44
+
33
45
  def file_task_by_section(current_section, by_section, task)
34
- if task.name =~ /:$/
46
+ if subtask_section?(task)
35
47
  current_section = task.name
36
48
  by_section[current_section] = []
37
49
  else
@@ -31,7 +31,8 @@ module Checkoff
31
31
  projects.tasks_from_project(project,
32
32
  only_uncompleted: only_uncompleted)
33
33
  else
34
- @sections.tasks(workspace_name, project_name, section_name)
34
+ @sections.tasks(workspace_name, project_name, section_name,
35
+ only_uncompleted: only_uncompleted)
35
36
  end
36
37
  tasks.find { |task| task.name == task_name }
37
38
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Checkoff
4
4
  # Version of library
5
- VERSION = '0.12.0'
5
+ VERSION = '0.13.2'
6
6
  end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ desc 'Load up checkoff in pry'
4
+ task :console do |_t|
5
+ exec 'pry -I lib -r checkoff'
6
+ end
data/rakelib/default.rake CHANGED
@@ -1,3 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ desc 'Standard build'
3
4
  task default: :localtest
data/rakelib/repl.rake ADDED
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ desc 'Load up checkoff in pry'
4
+ task repl: [:console]
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.12.0
4
+ version: 0.13.2
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-07-22 00:00:00.000000000 Z
11
+ date: 2021-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -150,6 +150,20 @@ dependencies:
150
150
  - - ">="
151
151
  - !ruby/object:Gem::Version
152
152
  version: 0.58.0
153
+ - !ruby/object:Gem::Dependency
154
+ name: pry
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
153
167
  - !ruby/object:Gem::Dependency
154
168
  name: rake
155
169
  requirement: !ruby/object:Gem::Requirement
@@ -212,14 +226,14 @@ dependencies:
212
226
  requirements:
213
227
  - - ">="
214
228
  - !ruby/object:Gem::Version
215
- version: '0'
229
+ version: 0.18.0
216
230
  type: :development
217
231
  prerelease: false
218
232
  version_requirements: !ruby/object:Gem::Requirement
219
233
  requirements:
220
234
  - - ">="
221
235
  - !ruby/object:Gem::Version
222
- version: '0'
236
+ version: 0.18.0
223
237
  - !ruby/object:Gem::Dependency
224
238
  name: simplecov-lcov
225
239
  requirement: !ruby/object:Gem::Requirement
@@ -311,11 +325,13 @@ files:
311
325
  - metrics/shellcheck_high_water_mark
312
326
  - rakelib/citest.rake
313
327
  - rakelib/clear_metrics.rake
328
+ - rakelib/console.rake
314
329
  - rakelib/default.rake
315
330
  - rakelib/gem_tasks.rake
316
331
  - rakelib/localtest.rake
317
332
  - rakelib/overcommit.rake
318
333
  - rakelib/quality.rake
334
+ - rakelib/repl.rake
319
335
  - rakelib/test.rake
320
336
  - rakelib/undercover.rake
321
337
  - requirements_dev.txt