na 1.1.23 → 1.1.25
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -0
- data/Gemfile.lock +2 -1
- data/README.md +2 -2
- data/lib/na/action.rb +1 -1
- data/lib/na/next_action.rb +8 -8
- data/lib/na/string.rb +8 -0
- data/lib/na/version.rb +1 -1
- data/src/README.md +1 -1
- metadata +18 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 62880dc0ab0313e02a68a0a7f40b36698a1d726000b38ade8681688b63f0c803
|
4
|
+
data.tar.gz: '0078690a38f209a84d3ee4cce9d75c189ac771d9db63c283bb815eb44518038b'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f02db71885150be723a415da09fac878d0f4621ca91c58cc9eca11c3748a74406e54ca6f9cc16ed63ea8008325bd60ec8b694940c765ff19013e412465afb67f
|
7
|
+
data.tar.gz: ebb292d4689aaa942146f00c451faee7ecc8994e7feef0a9b498f7ab70cfbd97fcafcc80cf7f4e25a44837932f60f4f5bf891fec29b754a5f5f4d20fcef21a5f
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,19 @@
|
|
1
|
+
### 1.1.25
|
2
|
+
|
3
|
+
2022-10-12 08:37
|
4
|
+
|
5
|
+
#### FIXED
|
6
|
+
|
7
|
+
- Unable to search for next action tag with `find` or `tagged`
|
8
|
+
|
9
|
+
### 1.1.24
|
10
|
+
|
11
|
+
2022-10-12 08:27
|
12
|
+
|
13
|
+
#### FIXED
|
14
|
+
|
15
|
+
- Force utf-8 encoding when reading files, should fix invalid byte sequence errors
|
16
|
+
|
1
17
|
### 1.1.23
|
2
18
|
|
3
19
|
2022-10-07 10:02
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
na (1.1.
|
4
|
+
na (1.1.25)
|
5
5
|
chronic (~> 0.10, >= 0.10.2)
|
6
6
|
gli (~> 2.21.0)
|
7
7
|
tty-reader (~> 0.9, >= 0.9.0)
|
@@ -30,6 +30,7 @@ GEM
|
|
30
30
|
|
31
31
|
PLATFORMS
|
32
32
|
arm64-darwin-20
|
33
|
+
arm64-darwin-21
|
33
34
|
|
34
35
|
DEPENDENCIES
|
35
36
|
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.1.
|
12
|
+
The current version of `na` is 1.1.25
|
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.
|
62
|
+
1.1.25
|
63
63
|
|
64
64
|
GLOBAL OPTIONS
|
65
65
|
-a, --[no-]add - Add a next action (deprecated, for backwards compatibility)
|
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],
|
data/lib/na/next_action.rb
CHANGED
@@ -144,7 +144,7 @@ module NA
|
|
144
144
|
## @param note [String] The note
|
145
145
|
##
|
146
146
|
def add_action(file, project, action, note = nil)
|
147
|
-
content =
|
147
|
+
content = file.read_file
|
148
148
|
# Insert the target project at the top if it doesn't exist
|
149
149
|
unless content =~ /^[ \t]*#{project}:/i
|
150
150
|
content = "#{project.cap_first}:\n#{content}"
|
@@ -255,7 +255,7 @@ module NA
|
|
255
255
|
|
256
256
|
files.each do |file|
|
257
257
|
save_working_dir(File.expand_path(file))
|
258
|
-
content =
|
258
|
+
content = file.read_file
|
259
259
|
indent_level = 0
|
260
260
|
parent = []
|
261
261
|
content.split("\n").each do |line|
|
@@ -276,7 +276,7 @@ module NA
|
|
276
276
|
elsif line =~ /^[ \t]*- / && line !~ / @done/
|
277
277
|
next if require_na && line !~ /@#{NA.na_tag}\b/
|
278
278
|
|
279
|
-
action = line.sub(/^[ \t]*- /, '')
|
279
|
+
action = line.sub(/^[ \t]*- /, '')
|
280
280
|
new_action = NA::Action.new(file, File.basename(file, ".#{NA.extension}"), parent.dup, action)
|
281
281
|
|
282
282
|
has_search = !optional.empty? || !required.empty? || !negated.empty?
|
@@ -330,7 +330,7 @@ module NA
|
|
330
330
|
db_file = 'tdlist.txt'
|
331
331
|
file = File.join(db_dir, db_file)
|
332
332
|
if File.exist?(file)
|
333
|
-
dirs =
|
333
|
+
dirs = file.read_file.split("\n")
|
334
334
|
dirs.delete_if { |f| !File.exist?(f) }
|
335
335
|
File.open(file, 'w') { |f| f.puts dirs.join("\n") }
|
336
336
|
end
|
@@ -341,7 +341,7 @@ module NA
|
|
341
341
|
dirs = match_working_dir(query)
|
342
342
|
else
|
343
343
|
file = database_path
|
344
|
-
content = File.exist?(file) ?
|
344
|
+
content = File.exist?(file) ? file.read_file.strip : ''
|
345
345
|
notify('{br}Database empty', exit_code: 1) if content.empty?
|
346
346
|
|
347
347
|
dirs = content.split(/\n/)
|
@@ -373,7 +373,7 @@ module NA
|
|
373
373
|
def load_searches
|
374
374
|
file = database_path(file: 'saved_searches.yml')
|
375
375
|
if File.exist?(file)
|
376
|
-
searches = YAML.safe_load(
|
376
|
+
searches = YAML.safe_load(file.read_file)
|
377
377
|
else
|
378
378
|
searches = {
|
379
379
|
'soon' => 'tagged "due<in 2 days,due>yesterday"',
|
@@ -459,7 +459,7 @@ module NA
|
|
459
459
|
file = database_path
|
460
460
|
notify('{r}No na database found', exit_code: 1) unless File.exist?(file)
|
461
461
|
|
462
|
-
dirs =
|
462
|
+
dirs = file.read_file.split("\n")
|
463
463
|
|
464
464
|
optional = search.map { |t| t[:token] }
|
465
465
|
required = search.filter { |s| s[:required] }.map { |t| t[:token] }
|
@@ -478,7 +478,7 @@ module NA
|
|
478
478
|
##
|
479
479
|
def save_working_dir(todo_file)
|
480
480
|
file = database_path
|
481
|
-
content = File.exist?(file) ?
|
481
|
+
content = File.exist?(file) ? file.read_file : ''
|
482
482
|
dirs = content.split(/\n/)
|
483
483
|
dirs.push(File.expand_path(todo_file))
|
484
484
|
dirs.sort!.uniq!
|
data/lib/na/string.rb
CHANGED
@@ -2,6 +2,14 @@
|
|
2
2
|
|
3
3
|
# String helpers
|
4
4
|
class ::String
|
5
|
+
def read_file
|
6
|
+
file = File.expand_path(self)
|
7
|
+
raise "Missing file #{file}" unless File.exist?(file)
|
8
|
+
|
9
|
+
# IO.read(file).force_encoding('ASCII-8BIT').encode('UTF-8', invalid: :replace, undef: :replace, replace: '?')
|
10
|
+
IO.read(file).force_encoding('utf-8')
|
11
|
+
end
|
12
|
+
|
5
13
|
##
|
6
14
|
## Determine indentation level of line
|
7
15
|
##
|
data/lib/na/version.rb
CHANGED
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.
|
12
|
+
The current version of `na` is <!--VER-->1.1.24<!--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.
|
4
|
+
version: 1.1.25
|
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-
|
11
|
+
date: 2022-10-12 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'
|
96
93
|
- - ">="
|
97
94
|
- !ruby/object:Gem::Version
|
98
95
|
version: 0.9.0
|
96
|
+
- - "~>"
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '0.9'
|
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'
|
106
103
|
- - ">="
|
107
104
|
- !ruby/object:Gem::Version
|
108
105
|
version: 0.9.0
|
106
|
+
- - "~>"
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
version: '0.9'
|
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'
|
136
133
|
- - ">="
|
137
134
|
- !ruby/object:Gem::Version
|
138
135
|
version: 0.5.0
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0.5'
|
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'
|
146
143
|
- - ">="
|
147
144
|
- !ruby/object:Gem::Version
|
148
145
|
version: 0.5.0
|
146
|
+
- - "~>"
|
147
|
+
- !ruby/object:Gem::Version
|
148
|
+
version: '0.5'
|
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.
|
229
|
-
signing_key:
|
228
|
+
rubygems_version: 3.0.3.1
|
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: []
|