na 1.1.23 → 1.1.24
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/Gemfile.lock +2 -1
- data/README.md +2 -2
- data/lib/na/next_action.rb +7 -7
- 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: 627281aeb89624e4b083114fe2247e459383a0a00517901003deb4d361e6b6ed
|
4
|
+
data.tar.gz: 4c811e25d7b2a882c058bc04465d08777ba6275192b4b4f262a6be05ff927d7f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d8197e283363015d007cd04748f82452306724b172ea68a4928fe368c19ce842af4c16d0f1ed05d7e885a7f76f5757c1e95e58181a7b1e75295d146797d8a18
|
7
|
+
data.tar.gz: 216f752c87e8143f0332309a4c6a00cff3c6d53f0645d189bc03acfe2f68319618a9c4fa9bae0fbeca23a74a7fd555cef17cd612676fca1ebc263af75c378b8d
|
data/CHANGELOG.md
CHANGED
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.24)
|
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.24
|
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.24
|
63
63
|
|
64
64
|
GLOBAL OPTIONS
|
65
65
|
-a, --[no-]add - Add a next action (deprecated, for backwards compatibility)
|
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|
|
@@ -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.23<!--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.24
|
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: []
|