todoloo 0.0.3 → 0.0.4
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/CHANGELOG +8 -0
- data/Rakefile +4 -0
- data/lib/todoloo/cli.rb +17 -3
- data/lib/todoloo/helpers.rb +11 -3
- data/lib/todoloo/task_list.rb +1 -0
- data/lib/todoloo/transformer.rb +1 -1
- data/lib/todoloo/version.rb +1 -1
- metadata +2 -3
- data/.direnv +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30e603e6f88a2ac0a52654b71d81714936db242648786c9bd1b0ac602cff03e6
|
4
|
+
data.tar.gz: 609ee891b2a8d01817c63725a4a4b4197c63e86cabeb5f44b32a8b4a470c224a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6f09e526d68283bc2ce77bdf9a2439f4d4a03bcb6b9dc199cdcd41356625fd7968eba57e6f2dade51a61aee5b280041e0e9ec82a2db99a093ce279006135ffd
|
7
|
+
data.tar.gz: 7e37cf807c222e8320e0af0eebaab9bd390beb2bb523c6174237a5f40d6a699e8d905e239a0c2b6e0ba917468885fd685d718526bb485fffa29d96cba867f5b5
|
data/CHANGELOG
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
Unreleased
|
2
2
|
|
3
|
+
0.0.4 - 13 August 2024
|
4
|
+
- Add more extensive CLI tests to catch some corner cases
|
5
|
+
- Fix `--exclude` flag not being repeatable
|
6
|
+
- Add `--pattern` flag for repeatable file matching pattern specification
|
7
|
+
- Add `--verbose` switch to opt-in for printing out scanned files
|
8
|
+
- Add `--output [FILENAME]` flag for specifying where to write the todos/tasks
|
9
|
+
- Fix remove file repeatitions when using `--pattern` that matches repeatedly
|
10
|
+
|
3
11
|
0.0.3 - 8 August 2024
|
4
12
|
- Add sorting support to `TaskList` and now sort CLI output by default
|
5
13
|
- Fix parsing for multiple tags, as in `TODO(a,b,c)`
|
data/Rakefile
CHANGED
data/lib/todoloo/cli.rb
CHANGED
@@ -3,14 +3,28 @@ require "thor"
|
|
3
3
|
class Todoloo::CLI < Thor
|
4
4
|
package_name "Todoloo"
|
5
5
|
|
6
|
+
DEFAULT_PATTERN = [
|
7
|
+
"**/*.rb",
|
8
|
+
"*.rb"
|
9
|
+
].freeze
|
10
|
+
|
6
11
|
desc "scan", "Scans all files that match the given globs and outputs a tasks.yml"
|
7
|
-
method_option :
|
12
|
+
method_option :pattern, type: :string, repeatable: true, aliases: "-p", desc: "Path globs to match; can be repeated"
|
13
|
+
method_option :exclude, type: :string, repeatable: true, aliases: "-e", desc: "List of path globs to exclude"
|
14
|
+
method_option :output, type: :string, aliases: "-o", default: "tasks.yml", desc: "Name of the output file"
|
15
|
+
method_option :verbose, type: :boolean, default: false
|
8
16
|
def scan
|
17
|
+
patterns = options.fetch(:pattern, DEFAULT_PATTERN)
|
18
|
+
|
9
19
|
Todoloo::FileScanner
|
10
|
-
.new(
|
20
|
+
.new(
|
21
|
+
patterns,
|
22
|
+
excludes: options.fetch(:exclude, []),
|
23
|
+
trace: options.fetch(:verbose)
|
24
|
+
)
|
11
25
|
.scan
|
12
26
|
.sort
|
13
|
-
.write(
|
27
|
+
.write(options.fetch(:output))
|
14
28
|
end
|
15
29
|
|
16
30
|
desc "io", "Reads input from stdio and writes to stdout"
|
data/lib/todoloo/helpers.rb
CHANGED
@@ -6,7 +6,9 @@ module Todoloo
|
|
6
6
|
# TODO We need to optimize how we traverse the file-system so that we can short-circuit the excludes instead
|
7
7
|
# of only filtering after finding them.
|
8
8
|
#
|
9
|
-
#
|
9
|
+
# TODO Optimize the seen_path handling
|
10
|
+
#
|
11
|
+
# @pattern [String, Array<String>]
|
10
12
|
# The file paths to glob
|
11
13
|
#
|
12
14
|
# @excludes [Array<String>]
|
@@ -14,9 +16,15 @@ module Todoloo
|
|
14
16
|
#
|
15
17
|
# @return [Enumerator<String>]
|
16
18
|
def glob_paths(pattern, excludes: [])
|
19
|
+
seen_paths = Set.new
|
20
|
+
|
17
21
|
Enumerator.new do |y|
|
18
|
-
Dir[pattern].lazy.each do |path|
|
19
|
-
|
22
|
+
Dir[*Array(pattern)].lazy.each do |path|
|
23
|
+
if !(seen_paths.include?(path) || excludes.any? { |e| File.fnmatch(e, path) })
|
24
|
+
y << path
|
25
|
+
end
|
26
|
+
|
27
|
+
seen_paths << path
|
20
28
|
end
|
21
29
|
end
|
22
30
|
end
|
data/lib/todoloo/task_list.rb
CHANGED
data/lib/todoloo/transformer.rb
CHANGED
data/lib/todoloo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: todoloo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Coetzee
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-08-
|
11
|
+
date: 2024-08-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -102,7 +102,6 @@ executables:
|
|
102
102
|
extensions: []
|
103
103
|
extra_rdoc_files: []
|
104
104
|
files:
|
105
|
-
- ".direnv"
|
106
105
|
- CHANGELOG
|
107
106
|
- CODE_OF_CONDUCT.md
|
108
107
|
- LICENSE.txt
|
data/.direnv
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
PATH_add bin
|