na 1.2.17 → 1.2.18

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: 230088b77bc3f8e3aa56fe5ba96505678d0ef3b809a38eccf96fb8be2109cf3d
4
- data.tar.gz: 87d16ea051d5c9c8e719777399cc4c3bb8ee3806c8ccbffaba80e1a429784844
3
+ metadata.gz: 580a58387aafdf48e220483783dff100a26f370e5ac685239dcf2cff416793cc
4
+ data.tar.gz: 04ec4cd4089b00ab65688e6fb88509971f01ef605b88956e9ecf4e523b175067
5
5
  SHA512:
6
- metadata.gz: 98e10fb95e67d9a86c89b34a5b21f5aefb61a66a239b205720a9ecf2979a5e57a39009c52cd17a12dde1a772e29b6ec3f3feb074d408ea233b5b64abb76d0494
7
- data.tar.gz: c7880dd277c7a82c12bc1781b5d1ed5be84b2eaf21a4e4dcbcc8ddd3d28820252cc3f67c57794b3239331a43ce81e303b087358d76ec32a40618d9bee3c4e367
6
+ metadata.gz: 4ff3cd0df2c68db3baa5022d5d9cb6dc7f61684aef2b50485cf4022ea4169dcc547b433fd2e42e454c21e29fb8dcd4f04fc7caaf9ae64de9e42dd0c57d4a882d
7
+ data.tar.gz: da239f2e39fbfbc514c321867b1068b1cc1e16e02e6b068cc1cd53024354baac2955442d0db8aed9ff495bb62ed68116f1f06ae6c0ddc0915cbe168ddc2a91b9
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ### 1.2.18
2
+
3
+ 2023-01-17 13:38
4
+
5
+ #### IMPROVED
6
+
7
+ - Format tags OmniFocus wouldn't recognize as @tags(TAG) in --nest output
8
+ - Include notes in --nest output
9
+
1
10
  ### 1.2.17
2
11
 
3
12
  2023-01-17 11:23
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- na (1.2.17)
4
+ na (1.2.18)
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.17
12
+ The current version of `na` is 1.2.18
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.17
80
+ 1.2.18
81
81
 
82
82
  GLOBAL OPTIONS
83
83
  -a, --[no-]add - Add a next action (deprecated, for backwards compatibility)
@@ -414,7 +414,7 @@ module NA
414
414
  current_parent = current_parent[par]
415
415
  end
416
416
 
417
- current_parent[:actions].push(a.action)
417
+ current_parent[:actions].push(a)
418
418
  end
419
419
  parents
420
420
  end
@@ -425,7 +425,27 @@ module NA
425
425
  children.each do |k, v|
426
426
  if k.to_s =~ /actions/
427
427
  indent += "\t"
428
- v.each { |a| out.push("#{indent}- #{a}")}
428
+
429
+ v.each do |a|
430
+ item = "#{indent}- #{a.action}"
431
+
432
+ unless a.tags.empty?
433
+ tags = []
434
+ a.tags.each do |k, v|
435
+ next if k =~ /^(due|flagged|done)$/
436
+
437
+ tag = k
438
+ tag += "-#{v}" unless v.nil? || v.empty?
439
+ tags.push(tag)
440
+ end
441
+
442
+ item += " @tags(#{tags.join(',')})" unless tags.empty?
443
+ end
444
+
445
+ item += "\n#{indent}\t#{a.note.join("\n#{indent}\t")}" if !a.note.empty?
446
+
447
+ out.push(item)
448
+ end
429
449
  else
430
450
  out.push("#{indent}#{k}:")
431
451
  out.concat(output_children(v, level + 1))
@@ -461,7 +481,7 @@ module NA
461
481
  out = []
462
482
  parent_files.each do |file, actions|
463
483
  projects = project_hierarchy(actions)
464
- out.push("#{file.sub(%r{^./}, '')}:")
484
+ out.push("#{file.sub(%r{^./}, '').shorten_path}:")
465
485
  out.concat(output_children(projects, 0))
466
486
  end
467
487
  puts out.join("\n")
data/lib/na/string.rb CHANGED
@@ -167,6 +167,15 @@ class ::String
167
167
  end
168
168
  end
169
169
 
170
+ ##
171
+ ## Replace home directory with tilde
172
+ ##
173
+ ## @return [String] shortened path
174
+ ##
175
+ def shorten_path
176
+ sub(/^#{ENV['HOME']}/, '~')
177
+ end
178
+
170
179
  private
171
180
 
172
181
  def matches_none(regexes)
data/lib/na/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Na
2
- VERSION = '1.2.17'
2
+ VERSION = '1.2.18'
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.16<!--END VER-->.
12
+ The current version of `na` is <!--VER-->1.2.17<!--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,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: na
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.17
4
+ version: 1.2.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra