na 1.1.24 → 1.1.26

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: 627281aeb89624e4b083114fe2247e459383a0a00517901003deb4d361e6b6ed
4
- data.tar.gz: 4c811e25d7b2a882c058bc04465d08777ba6275192b4b4f262a6be05ff927d7f
3
+ metadata.gz: abe0279bc67c68bbdd675f73c87ed92eaf9fd3b3527ea6160caeff51b95fc476
4
+ data.tar.gz: 355cd4c65381775e4b2fea514d855be15b557ba1961e59c272d0cddcefa172f4
5
5
  SHA512:
6
- metadata.gz: 3d8197e283363015d007cd04748f82452306724b172ea68a4928fe368c19ce842af4c16d0f1ed05d7e885a7f76f5757c1e95e58181a7b1e75295d146797d8a18
7
- data.tar.gz: 216f752c87e8143f0332309a4c6a00cff3c6d53f0645d189bc03acfe2f68319618a9c4fa9bae0fbeca23a74a7fd555cef17cd612676fca1ebc263af75c378b8d
6
+ metadata.gz: c434d27ed1659ce0a3879843150f17254a27ddfdb15fd1e223e826f4fdd4e45a58102fbc35cf89dfa8357c43a074eea40094b7e876ade3a2b08d95a2e1f95077
7
+ data.tar.gz: 4eab4522844ca97d70f9f6daa38a03dfcffd3ecaf9a0fcdb9a3532fcead64bd918676c1cf3c9f157b16ec667b1e4b206094b84e69e51f4751f0ca986b3395fe5
data/CHANGELOG.md CHANGED
@@ -1,3 +1,20 @@
1
+ ### 1.1.26
2
+
3
+ 2022-10-15 10:36
4
+
5
+ #### IMPROVED
6
+
7
+ - A parenthetical at the end of an action will be interpreted as a note. If --note is additionally supplied, entered note is concatenated to parenthetical note.
8
+ - Allow multi-line notes
9
+
10
+ ### 1.1.25
11
+
12
+ 2022-10-12 08:37
13
+
14
+ #### FIXED
15
+
16
+ - Unable to search for next action tag with `find` or `tagged`
17
+
1
18
  ### 1.1.24
2
19
 
3
20
  2022-10-12 08:27
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- na (1.1.24)
4
+ na (1.1.26)
5
5
  chronic (~> 0.10, >= 0.10.2)
6
6
  gli (~> 2.21.0)
7
7
  tty-reader (~> 0.9, >= 0.9.0)
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.1.24
12
+ The current version of `na` is 1.1.26
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.
@@ -59,7 +59,7 @@ SYNOPSIS
59
59
  na [global options] command [command options] [arguments...]
60
60
 
61
61
  VERSION
62
- 1.1.24
62
+ 1.1.26
63
63
 
64
64
  GLOBAL OPTIONS
65
65
  -a, --[no-]add - Add a next action (deprecated, for backwards compatibility)
@@ -122,6 +122,9 @@ EXAMPLES
122
122
 
123
123
  # Add a new action to the Inbox, set its @priority to 4, and prompt for an additional note
124
124
  na add "A bug I need to fix" -p 4 -n
125
+
126
+ # A parenthetical at the end of an action is interpreted as a note
127
+ na add "An action item (with a note)"
125
128
  ```
126
129
 
127
130
  ##### edit
data/bin/na CHANGED
@@ -133,6 +133,8 @@ class App
133
133
  c.example 'na add "A cool feature I thought of @idea"', desc: 'Add a new action to the Inbox, including a tag'
134
134
  c.example 'na add "A bug I need to fix" -p 4 -n',
135
135
  desc: 'Add a new action to the Inbox, set its @priority to 4, and prompt for an additional note'
136
+ c.example 'na add "An action item (with a note)"',
137
+ desc: 'A parenthetical at the end of an action is interpreted as a note'
136
138
 
137
139
  c.desc 'Prompt for additional notes'
138
140
  c.switch %i[n note], negatable: false
@@ -181,6 +183,13 @@ class App
181
183
  action = "#{action.gsub(/@priority\(\d+\)/, '')} @priority(#{options[:priority]})"
182
184
  end
183
185
 
186
+ note_rx = /^(.+)\((.*?)\)$/
187
+ split_note = if action =~ note_rx
188
+ n = Regexp.last_match(2)
189
+ action.sub!(note_rx, '\1').strip!
190
+ n
191
+ end
192
+
184
193
  na_tag = NA.na_tag
185
194
  if options[:x]
186
195
  na_tag = ''
@@ -191,17 +200,21 @@ class App
191
200
 
192
201
  action = "#{action.gsub(/#{na_tag}\b/, '')}#{na_tag}"
193
202
 
194
- note = if options[:note]
195
- if TTY::Which.exist?('gum')
196
- args = ['--placeholder "Enter a note, CTRL-d to save"']
197
- args << '--char-limit 0'
198
- args << '--width $(tput cols)'
199
- `gum write #{args.join(' ')}`.strip.split("\n")
200
- else
201
- puts NA::Color.template('{bm}Enter a note, {bw}CTRL-d{bm} to end editing{bw}')
202
- reader.read_multiline
203
- end
204
- end
203
+ line_note = if options[:note]
204
+ if TTY::Which.exist?('gum')
205
+ args = ['--placeholder "Enter a note, CTRL-d to save"']
206
+ args << '--char-limit 0'
207
+ args << '--width $(tput cols)'
208
+ `gum write #{args.join(' ')}`.strip.split("\n")
209
+ else
210
+ puts NA::Color.template('{bm}Enter a note, {bw}CTRL-d{bm} to end editing{bw}')
211
+ reader.read_multiline
212
+ end
213
+ end
214
+
215
+ note = split_note.nil? ? [] : [split_note]
216
+ note.concat(line_note) unless line_note.nil?
217
+ note = nil if note.empty?
205
218
 
206
219
  if options[:file]
207
220
  target = File.expand_path(options[:file])
data/lib/na/action.rb CHANGED
@@ -58,7 +58,7 @@ module NA
58
58
  file_tpl = "#{template[:file]}#{file} {x}"
59
59
  filename = NA::Color.template(file_tpl)
60
60
 
61
- action = NA::Color.template("#{template[:action]}#{@action}{x}")
61
+ action = NA::Color.template("#{template[:action]}#{@action.sub(/ @#{NA.na_tag}\b/, '')}{x}")
62
62
  action = action.highlight_tags(color: template[:tags],
63
63
  parens: template[:value_parens],
64
64
  value: template[:values],
@@ -153,7 +153,8 @@ module NA
153
153
  # Insert the action at the top of the target project
154
154
  content.sub!(/^([ \t]*)#{project}:(.*?)$/i) do
155
155
  m = Regexp.last_match
156
- note = note.nil? ? '' : "\n#{m[1]}\t\t#{note.join('').strip}"
156
+ indent = "\n#{m[1]}\t\t"
157
+ note = note.nil? ? '' : "#{indent}#{note.join(indent).strip}"
157
158
  "#{m[1]}#{project.cap_first}:#{m[2]}\n#{m[1]}\t- #{action}#{note}"
158
159
  end
159
160
 
@@ -276,7 +277,7 @@ module NA
276
277
  elsif line =~ /^[ \t]*- / && line !~ / @done/
277
278
  next if require_na && line !~ /@#{NA.na_tag}\b/
278
279
 
279
- action = line.sub(/^[ \t]*- /, '').sub(/ @#{NA.na_tag}\b/, '')
280
+ action = line.sub(/^[ \t]*- /, '')
280
281
  new_action = NA::Action.new(file, File.basename(file, ".#{NA.extension}"), parent.dup, action)
281
282
 
282
283
  has_search = !optional.empty? || !required.empty? || !negated.empty?
data/lib/na/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Na
2
- VERSION = '1.1.24'
2
+ VERSION = '1.1.26'
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.1.23<!--END VER-->.
12
+ The current version of `na` is <!--VER-->1.1.25<!--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,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: na
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.24
4
+ version: 1.1.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-12 00:00:00.000000000 Z
11
+ date: 2022-10-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -90,22 +90,22 @@ dependencies:
90
90
  name: tty-reader
91
91
  requirement: !ruby/object:Gem::Requirement
92
92
  requirements:
93
- - - ">="
94
- - !ruby/object:Gem::Version
95
- version: 0.9.0
96
93
  - - "~>"
97
94
  - !ruby/object:Gem::Version
98
95
  version: '0.9'
96
+ - - ">="
97
+ - !ruby/object:Gem::Version
98
+ version: 0.9.0
99
99
  type: :runtime
100
100
  prerelease: false
101
101
  version_requirements: !ruby/object:Gem::Requirement
102
102
  requirements:
103
- - - ">="
104
- - !ruby/object:Gem::Version
105
- version: 0.9.0
106
103
  - - "~>"
107
104
  - !ruby/object:Gem::Version
108
105
  version: '0.9'
106
+ - - ">="
107
+ - !ruby/object:Gem::Version
108
+ version: 0.9.0
109
109
  - !ruby/object:Gem::Dependency
110
110
  name: tty-screen
111
111
  requirement: !ruby/object:Gem::Requirement
@@ -130,22 +130,22 @@ dependencies:
130
130
  name: tty-which
131
131
  requirement: !ruby/object:Gem::Requirement
132
132
  requirements:
133
- - - ">="
134
- - !ruby/object:Gem::Version
135
- version: 0.5.0
136
133
  - - "~>"
137
134
  - !ruby/object:Gem::Version
138
135
  version: '0.5'
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: 0.5.0
139
139
  type: :runtime
140
140
  prerelease: false
141
141
  version_requirements: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - ">="
144
- - !ruby/object:Gem::Version
145
- version: 0.5.0
146
143
  - - "~>"
147
144
  - !ruby/object:Gem::Version
148
145
  version: '0.5'
146
+ - - ">="
147
+ - !ruby/object:Gem::Version
148
+ version: 0.5.0
149
149
  - !ruby/object:Gem::Dependency
150
150
  name: chronic
151
151
  requirement: !ruby/object:Gem::Requirement
@@ -203,7 +203,7 @@ homepage: https://brettterpstra.com/projects/na/
203
203
  licenses:
204
204
  - MIT
205
205
  metadata: {}
206
- post_install_message:
206
+ post_install_message:
207
207
  rdoc_options:
208
208
  - "--title"
209
209
  - na
@@ -225,8 +225,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
225
225
  - !ruby/object:Gem::Version
226
226
  version: '0'
227
227
  requirements: []
228
- rubygems_version: 3.0.3.1
229
- signing_key:
228
+ rubygems_version: 3.2.16
229
+ signing_key:
230
230
  specification_version: 4
231
231
  summary: A command line tool for adding and listing project todos
232
232
  test_files: []