na 1.1.25 → 1.1.26

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: 62880dc0ab0313e02a68a0a7f40b36698a1d726000b38ade8681688b63f0c803
4
- data.tar.gz: '0078690a38f209a84d3ee4cce9d75c189ac771d9db63c283bb815eb44518038b'
3
+ metadata.gz: abe0279bc67c68bbdd675f73c87ed92eaf9fd3b3527ea6160caeff51b95fc476
4
+ data.tar.gz: 355cd4c65381775e4b2fea514d855be15b557ba1961e59c272d0cddcefa172f4
5
5
  SHA512:
6
- metadata.gz: f02db71885150be723a415da09fac878d0f4621ca91c58cc9eca11c3748a74406e54ca6f9cc16ed63ea8008325bd60ec8b694940c765ff19013e412465afb67f
7
- data.tar.gz: ebb292d4689aaa942146f00c451faee7ecc8994e7feef0a9b498f7ab70cfbd97fcafcc80cf7f4e25a44837932f60f4f5bf891fec29b754a5f5f4d20fcef21a5f
6
+ metadata.gz: c434d27ed1659ce0a3879843150f17254a27ddfdb15fd1e223e826f4fdd4e45a58102fbc35cf89dfa8357c43a074eea40094b7e876ade3a2b08d95a2e1f95077
7
+ data.tar.gz: 4eab4522844ca97d70f9f6daa38a03dfcffd3ecaf9a0fcdb9a3532fcead64bd918676c1cf3c9f157b16ec667b1e4b206094b84e69e51f4751f0ca986b3395fe5
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
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
+
1
10
  ### 1.1.25
2
11
 
3
12
  2022-10-12 08:37
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- na (1.1.25)
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.25
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.25
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])
@@ -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
 
data/lib/na/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Na
2
- VERSION = '1.1.25'
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.24<!--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.25
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: []