na 1.2.21 → 1.2.22

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: 652b91a5481fa62e1bb36ae71256a38d3081ee43999c167d1f35dc5ebc1e8261
4
- data.tar.gz: 0deae6f4ade63260609e22b2aa0b7b8b2a668a77e487292b082c856c9a633f92
3
+ metadata.gz: ccb815bfd051b4cd15b198c14ff1bb1efcde847005d88aa4322d88aec4ac8d72
4
+ data.tar.gz: 75ce04d2a86f842668118e5e58497627c5616618479b7838f4f6fcd34baf910a
5
5
  SHA512:
6
- metadata.gz: d3f1cb74ed04440ae3f8b95d70f2ad1dbc263d57b539e6a00b0984c46b008a6567008ed8098506b1ab6c9a2d2aa2c040cb15b1ebebd1794e3d3a4a5bd375f733
7
- data.tar.gz: 30164f4a176f01b4978abaf7b5c3b3489925e535935802c5c0ce56947fb5baf96a36b9f05081073479cd3710a6b922bed698f2458644a99a270adf2b7781a1e3
6
+ metadata.gz: 2cee616b47b7ee5918d9062a48f38ff45ec4ee6a20fe3027b31c778d4fe7d08881ac5138498cc02b1e66c691c925a35f8b3d72a1ca23d034b48853ad7ac87540
7
+ data.tar.gz: d262fb01720b1b9daa30c26b75ef1771e047ba8879cc04ca66be6076a7c99aa143ed3d2a0b254785bee0c0f95fa76ab0cbf282199dc3fd0867c1ec12edc81df2
data/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ ### 1.2.22
2
+
3
+ 2023-06-05 10:35
4
+
5
+ #### NEW
6
+
7
+ - Global `--template PATH` option to define a template for new files, can be added to .na.rc
8
+
9
+ #### IMPROVED
10
+
11
+ - Help verbiage and examples
12
+
13
+ #### FIXED
14
+
15
+ - Variable assignment warnings
16
+
1
17
  ### 1.2.20
2
18
 
3
19
  2023-05-09 10:40
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- na (1.2.21)
4
+ na (1.2.22)
5
5
  chronic (~> 0.10, >= 0.10.2)
6
6
  gli (~> 2.21.0)
7
7
  mdless (~> 1.0, >= 1.0.32)
@@ -33,6 +33,7 @@ GEM
33
33
  PLATFORMS
34
34
  arm64-darwin-20
35
35
  arm64-darwin-21
36
+ x86_64-darwin-20
36
37
 
37
38
  DEPENDENCIES
38
39
  minitest (~> 5.14)
data/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
  _If you're one of the rare people like me who find this useful, feel free to
10
10
  [buy me some coffee][donate]._
11
11
 
12
- The current version of `na` is 1.2.20
12
+ The current version of `na` is 1.2.22
13
13
  .
14
14
 
15
15
  `na` ("next action") is a command line tool designed to make it easy to see what your next actions are for any project, right from the command line. It works with TaskPaper-formatted files (but any plain text format will do), looking for `@na` tags (or whatever you specify) in todo files in your current folder.
@@ -77,14 +77,14 @@ SYNOPSIS
77
77
  na [global options] command [command options] [arguments...]
78
78
 
79
79
  VERSION
80
- 1.2.21
80
+ 1.2.22
81
81
 
82
82
  GLOBAL OPTIONS
83
83
  -a, --add - Add a next action (deprecated, for backwards compatibility)
84
84
  --add_at=POSITION - Add all new/moved entries at [s]tart or [e]nd of target project (default: start)
85
85
  --[no-]color - Colorize output (default: enabled)
86
86
  --cwd_as=TYPE - Use current working directory as [p]roject, [t]ag, or [n]one (default: none)
87
- -d, --depth=DEPTH - Recurse to depth (default: 3)
87
+ -d, --depth=DEPTH - Recurse to depth (default: 1)
88
88
  --[no-]debug - Display verbose output
89
89
  --ext=EXT - File extension to consider a todo file (default: taskpaper)
90
90
  -f, --file=PATH - Use a single file as global todo, use --initconfig to make permanent (default: none)
@@ -93,6 +93,7 @@ GLOBAL OPTIONS
93
93
  -p, --priority=PRIORITY - Set a priority 0-5 (deprecated, for backwards compatibility) (default: none)
94
94
  -r, --[no-]recurse - Recurse 3 directories deep (deprecated, for backwards compatability)
95
95
  -t, --na_tag=TAG - Tag to consider a next action (default: na)
96
+ --template=PATH - Provide a template for new/blank todo files, use --initconfig to make permanent (default: none)
96
97
  --version - Display the program version
97
98
 
98
99
  COMMANDS
@@ -204,7 +205,7 @@ SYNOPSIS
204
205
  na [global options] find [command options] PATTERN
205
206
 
206
207
  DESCRIPTION
207
- Search tokens are separated by spaces. Actions matching all tokens in the pattern will be shown (partial matches allowed). Add a + before a token to make it required, e.g. `na find +feature +maybe`
208
+ Search tokens are separated by spaces. Actions matching all tokens in the pattern will be shown (partial matches allowed). Add a + before a token to make it required, e.g. `na find +feature +maybe`, add a - or ! to ignore matches containing that token.
208
209
 
209
210
  COMMAND OPTIONS
210
211
  -d, --depth=DEPTH - Recurse to depth (default: none)
@@ -226,6 +227,9 @@ EXAMPLES
226
227
  # Find all actions containing feature, idea, and swift
227
228
  na find feature idea swift
228
229
 
230
+ # Find all actions containing feature and idea but NOT swift
231
+ na find feature idea -swift
232
+
229
233
  # Find all actions containing the exact text "feature idea"
230
234
  na find -x feature idea
231
235
  ```
data/bin/na CHANGED
@@ -47,6 +47,10 @@ class App
47
47
  arg_name 'PATH'
48
48
  flag %i[f file]
49
49
 
50
+ desc 'Provide a template for new/blank todo files, use --initconfig to make permanent'
51
+ arg_name 'PATH'
52
+ flag %[template]
53
+
50
54
  desc 'Use current working directory as [p]roject, [t]ag, or [n]one'
51
55
  arg_name 'TYPE'
52
56
  flag %i[cwd_as], must_match: /^[ptn].*?$/i, default_value: 'none'
@@ -619,10 +623,12 @@ class App
619
623
 
620
624
  desc 'Find actions matching a search pattern'
621
625
  long_desc 'Search tokens are separated by spaces. Actions matching all tokens in the pattern will be shown
622
- (partial matches allowed). Add a + before a token to make it required, e.g. `na find +feature +maybe`'
626
+ (partial matches allowed). Add a + before a token to make it required, e.g. `na find +feature +maybe`,
627
+ add a - or ! to ignore matches containing that token.'
623
628
  arg_name 'PATTERN'
624
629
  command %i[find grep] do |c|
625
630
  c.example 'na find feature idea swift', desc: 'Find all actions containing feature, idea, and swift'
631
+ c.example 'na find feature idea -swift', desc: 'Find all actions containing feature and idea but NOT swift'
626
632
  c.example 'na find -x feature idea', desc: 'Find all actions containing the exact text "feature idea"'
627
633
 
628
634
  c.desc 'Interpret search pattern as regular expression'
@@ -1098,7 +1104,7 @@ class App
1098
1104
  c.example 'na tagged "+maybe,+priority<=3" --save maybelater', description: 'save a search called "maybelater"'
1099
1105
  c.example 'na saved maybelater', description: 'perform the search named "maybelater"'
1100
1106
  c.example 'na saved maybe',
1101
- description: 'perform the search named "maybelater", assuming no other searches match "may"'
1107
+ description: 'perform the search named "maybelater", assuming no other searches match "maybe"'
1102
1108
  c.example 'na maybe',
1103
1109
  description: 'na run with no command and a single argument automatically performs a matching saved search'
1104
1110
  c.example 'na saved', description: 'list available searches'
data/lib/na/action.rb CHANGED
@@ -24,7 +24,7 @@ module NA
24
24
  else
25
25
  ''
26
26
  end
27
- "(#{@file}:#{@line}) #{@project}:#{@parent.join('>')} | #{@action}#{@note}"
27
+ "(#{@file}:#{@line}) #{@project}:#{@parent.join('>')} | #{@action}#{note}"
28
28
  end
29
29
 
30
30
  def inspect
data/lib/na/colors.rb CHANGED
@@ -306,7 +306,7 @@ module NA
306
306
  %w[r g b].each do |e|
307
307
  t << parts[e].hex
308
308
  end
309
- color =
309
+
310
310
  "\e[#{is_bg ? '48' : '38'};2;#{t.join(';')}m"
311
311
  end
312
312
 
@@ -72,21 +72,25 @@ module NA
72
72
  ## @param target [String] The target path
73
73
  ## @param basename [String] The project base name
74
74
  ##
75
- def create_todo(target, basename)
75
+ def create_todo(target, basename, template: nil)
76
76
  File.open(target, 'w') do |f|
77
- content = <<~ENDCONTENT
78
- Inbox:
79
- #{basename}:
80
- \tFeature Requests:
81
- \tIdeas:
82
- \tBugs:
83
- Archive:
84
- Search Definitions:
85
- \tTop Priority @search(@priority = 5 and not @done)
86
- \tHigh Priority @search(@priority > 3 and not @done)
87
- \tMaybe @search(@maybe)
88
- \tNext @search(@#{NA.na_tag} and not @done and not project = \"Archive\")
89
- ENDCONTENT
77
+ if template && File.exist?(template)
78
+ content = IO.read(template)
79
+ else
80
+ content = <<~ENDCONTENT
81
+ Inbox:
82
+ #{basename}:
83
+ \tFeature Requests:
84
+ \tIdeas:
85
+ \tBugs:
86
+ Archive:
87
+ Search Definitions:
88
+ \tTop Priority @search(@priority = 5 and not @done)
89
+ \tHigh Priority @search(@priority > 3 and not @done)
90
+ \tMaybe @search(@maybe)
91
+ \tNext @search(@#{NA.na_tag} and not @done and not project = \"Archive\")
92
+ ENDCONTENT
93
+ end
90
94
  f.puts(content)
91
95
  end
92
96
  save_working_dir(target)
@@ -600,7 +604,6 @@ module NA
600
604
  content = file.read_file
601
605
  indent_level = 0
602
606
  parent = []
603
- last_line = 0
604
607
  in_action = false
605
608
  content.split("\n").each.with_index do |line, idx|
606
609
  if line.project?
data/lib/na/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Na
2
- VERSION = '1.2.21'
2
+ VERSION = '1.2.22'
3
3
  end
data/src/_README.md CHANGED
@@ -9,7 +9,7 @@
9
9
  _If you're one of the rare people like me who find this useful, feel free to
10
10
  [buy me some coffee][donate]._
11
11
 
12
- The current version of `na` is <!--VER-->1.2.20<!--END VER-->.
12
+ The current version of `na` is <!--VER-->1.2.21<!--END VER-->.
13
13
 
14
14
  `na` ("next action") is a command line tool designed to make it easy to see what your next actions are for any project, right from the command line. It works with TaskPaper-formatted files (but any plain text format will do), looking for `@na` tags (or whatever you specify) in todo files in your current folder.
15
15
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: na
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.21
4
+ version: 1.2.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra
@@ -246,7 +246,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
246
246
  - !ruby/object:Gem::Version
247
247
  version: '0'
248
248
  requirements: []
249
- rubygems_version: 3.2.16
249
+ rubygems_version: 3.2.15
250
250
  signing_key:
251
251
  specification_version: 4
252
252
  summary: A command line tool for adding and listing project todos