na 1.2.56 → 1.2.58

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: 29b9842202dfc46dbeae88e652762169c8fdf0df60b06992008961b2dba33119
4
- data.tar.gz: 6d34243a7a858b5821b3240b1a550758812c8163ee0fba8854665aa21604b666
3
+ metadata.gz: bdea3ecffbd78f7d0ee482fe116b807af691545779283add0cbda732f253c019
4
+ data.tar.gz: 50370bccecc6bb02db420e2d64b54c90b350c07136e58a96d904a5bc3d897bb7
5
5
  SHA512:
6
- metadata.gz: d603bad6634138a8b5bd3f1306d7c36a3b4ec0ea53542b43169bbe3f8904dbff65c8173cb0f086f4251218875fd3880ba3803e64a9c411709ec941a7801715f5
7
- data.tar.gz: d7126bc4d633b4d062cbb1177e300bf0ef308b548c03da01f58c055217b1f21e08f2641721d4e10730d3f5682a007795a2c7fc0ad66eeb7da32b9b78cef9a796
6
+ metadata.gz: 587d1f01d6019f0bfc6c81b45458864ff1be36e917a50c2c891dea7f43cd2bb8fe1ed16cd3c4692768b47760119162291fd161d9901dedf63cbdca6fea891e71
7
+ data.tar.gz: ce38f3f8210b4e5345c0dcc4edbd1c6935ca47068de13be456091163bade869d8cf0ea414f0281187a777ad3928522062f2f5a8d5948de71dadce22f17ff51fc
data/CHANGELOG.md CHANGED
@@ -1,3 +1,23 @@
1
+ ### 1.2.58
2
+
3
+ 2023-09-12 14:11
4
+
5
+ #### NEW
6
+
7
+ - `na next --all` to display next actions from all known todo files (any directory)
8
+
9
+ #### IMPROVED
10
+
11
+ - Middle truncate directory names longer than 1/3 of the screen width
12
+
13
+ ### 1.2.57
14
+
15
+ 2023-09-11 16:43
16
+
17
+ #### FIXED
18
+
19
+ - Error when no todo files are located
20
+
1
21
  ### 1.2.56
2
22
 
3
23
  2023-09-11 11:33
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- na (1.2.56)
4
+ na (1.2.58)
5
5
  chronic (~> 0.10, >= 0.10.2)
6
6
  gli (~> 2.21.0)
7
7
  mdless (~> 1.0, >= 1.0.32)
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.56
12
+ The current version of `na` is 1.2.58
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,7 +77,7 @@ SYNOPSIS
77
77
  na [global options] command [command options] [arguments...]
78
78
 
79
79
  VERSION
80
- 1.2.56
80
+ 1.2.58
81
81
 
82
82
  GLOBAL OPTIONS
83
83
  -a, --add - Add a next action (deprecated, for backwards compatibility)
@@ -284,6 +284,7 @@ DESCRIPTION
284
284
  Next actions are actions which contain the next action tag (default @na), do not contain @done, and are not in the Archive project. Arguments will target a todo file from history, whether it's in the current directory or not. Todo file queries can include path components separated by / or :, and may use wildcards (`*` to match any text, `?` to match a single character). Multiple queries allowed (separate arguments or separated by comma).
285
285
 
286
286
  COMMAND OPTIONS
287
+ --all - Show next actions from all known todo files (in any directory)
287
288
  -d, --depth=DEPTH - Recurse to depth (default: none)
288
289
  --[no-]done - Include @done actions
289
290
  --exact - Search query is exact text match (not tokens)
@@ -397,6 +398,7 @@ DESCRIPTION
397
398
  Next actions are actions which contain the next action tag (default @na), do not contain @done, and are not in the Archive project. Arguments will target a todo file from history, whether it's in the current directory or not. Todo file queries can include path components separated by / or :, and may use wildcards (`*` to match any text, `?` to match a single character). Multiple queries allowed (separate arguments or separated by comma).
398
399
 
399
400
  COMMAND OPTIONS
401
+ --all - Show next actions from all known todo files (in any directory)
400
402
  -d, --depth=DEPTH - Recurse to depth (default: none)
401
403
  --[no-]done - Include @done actions
402
404
  --exact - Search query is exact text match (not tokens)
data/bin/commands/next.rb CHANGED
@@ -19,6 +19,9 @@ class App
19
19
  c.arg_name 'DEPTH'
20
20
  c.flag %i[d depth], type: :integer, must_match: /^[1-9]$/
21
21
 
22
+ c.desc 'Show next actions from all known todo files (in any directory)'
23
+ c.switch %i[all], negatable: false, default_value: false
24
+
22
25
  c.desc 'Display matches from a known todo file'
23
26
  c.arg_name 'TODO_FILE'
24
27
  c.flag %i[in todo], multiple: true
@@ -121,6 +124,7 @@ class App
121
124
  end
122
125
 
123
126
  args.concat(options[:in])
127
+ args << '*' if options[:all]
124
128
  if args.count.positive?
125
129
  all_req = args.join(' ') !~ /(?<=[, ])[+!-]/
126
130
 
@@ -137,9 +141,7 @@ class App
137
141
  end
138
142
  end
139
143
 
140
- search_for_done = false
141
- tags.each { |tag| search_for_done = true if tag[:tag] =~ /done/ }
142
- options[:done] = true if search_for_done
144
+ options[:done] = true if tags.any? { |tag| tag[:tag] =~ /done/ }
143
145
 
144
146
  search_tokens = nil
145
147
  if options[:exact]
@@ -174,7 +176,7 @@ class App
174
176
  search: search_tokens,
175
177
  project: options[:project],
176
178
  require_na: require_na })
177
- if todo.files.empty?
179
+ if todo.files.empty? && tokens
178
180
  NA.notify("#{NA.theme[:error]}No matches found for #{tokens[0][:token]}.
179
181
  Run `na todos` to see available todo files.")
180
182
  end
@@ -654,7 +654,6 @@ module NA
654
654
  File.open(db, 'w') { |f| f.puts }
655
655
  []
656
656
  end
657
-
658
657
  end
659
658
 
660
659
  def move_deprecated_backups
data/lib/na/string.rb CHANGED
@@ -90,7 +90,7 @@ class ::String
90
90
  ## @return Colorized string
91
91
  ##
92
92
  def highlight_filename
93
- dir = File.dirname(self).shorten_path
93
+ dir = File.dirname(self).shorten_path.trunc_middle(TTY::Screen.columns / 3)
94
94
  file = NA.include_ext ? File.basename(self) : File.basename(self, ".#{NA.extension}")
95
95
  "#{NA.theme[:dirname]}#{dir}/#{NA.theme[:filename]}#{file}{x}"
96
96
  end
@@ -148,6 +148,16 @@ class ::String
148
148
  string
149
149
  end
150
150
 
151
+ def trunc_middle(max)
152
+ return self unless length > max
153
+
154
+ half = (max / 2).floor - 3
155
+ chars = split('')
156
+ pre = chars.slice(0, half)
157
+ post = chars.reverse.slice(0, half).reverse
158
+ "#{pre.join('')}[...]#{post.join('')}"
159
+ end
160
+
151
161
  def wrap(width, indent)
152
162
  return "\n#{self}" if width <= 80
153
163
 
data/lib/na/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Na
2
- VERSION = '1.2.56'
2
+ VERSION = '1.2.58'
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.55<!--END VER-->.
12
+ The current version of `na` is <!--VER-->1.2.57<!--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.2.56
4
+ version: 1.2.58
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-11 00:00:00.000000000 Z
11
+ date: 2023-09-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake