na 1.2.8 → 1.2.10

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: a5d95b5e069cbe51ad597f9af95744a84590e9513d28dd53c5710c477c59e19e
4
- data.tar.gz: bbaefe5d4151348443260a940f143e83d5514967886caa8d4a0e5848f01860a1
3
+ metadata.gz: 848e54e708d4cbd9f5ef710e25b5c0b877cde54f6dc7f85f9cf4f0ffefb6bb6b
4
+ data.tar.gz: 6ecc93bec183a94a12f1f6ac870647a9d89120df09f3e859bab812a9c5cd9327
5
5
  SHA512:
6
- metadata.gz: 9747348a856378659ab51925aace1eb7f0e056003e6f3a06bc53cb23c3f954f3b2cbd60b4c598db4e2e537052be665eda10871718f2aa517b19d9ef28a2ab82a
7
- data.tar.gz: 7d2dff9e215a1e05a70aa31a0abb10d98d8a2937936192c74a6f952c195e292b8f24bffd5968a0d2190b7f0548ffaaeb699c10066781566f68950ca62a0314d7
6
+ metadata.gz: fe0da137c601074516d58dc7add5dfc6dc5cabef2decd7e61ac0af59bd63b4c5effe306654e0fd18e434bd57af454242c5f3db6256f6c7c5f834274f1ef2b533
7
+ data.tar.gz: 183cfecfdeeddad0105b27fda2dd826bbe4172a6b22c7e40ece42d9a86fd18fc95d7e35c34bd07fecc64c920562857d279fa7c42926fec432e2ef8312c5678fb
data/CHANGELOG.md CHANGED
@@ -1,3 +1,20 @@
1
+ ### 1.2.10
2
+
3
+ 2022-10-29 15:59
4
+
5
+ #### FIXED
6
+
7
+ - Better handling of tokenized search for todo matching with multiple arguments
8
+ - Guard for error parsing project name
9
+
10
+ ### 1.2.9
11
+
12
+ 2022-10-29 10:50
13
+
14
+ #### FIXED
15
+
16
+ - Na next with a todo search wasn't requiring a match
17
+
1
18
  ### 1.2.8
2
19
 
3
20
  2022-10-28 11:52
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- na (1.2.8)
4
+ na (1.2.10)
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.8
12
+ The current version of `na` is 1.2.10
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.8
80
+ 1.2.10
81
81
 
82
82
  GLOBAL OPTIONS
83
83
  -a, --[no-]add - Add a next action (deprecated, for backwards compatibility)
data/bin/na CHANGED
@@ -119,7 +119,7 @@ class App
119
119
 
120
120
  args.concat(options[:in])
121
121
  if args.count.positive?
122
- all_req = false
122
+ all_req = args.join(' ') !~ /[+!\-]/
123
123
 
124
124
  tokens = []
125
125
  args.each do |arg|
@@ -127,7 +127,7 @@ class App
127
127
  m = a.match(/^(?<req>[+\-!])?(?<tok>.*?)$/)
128
128
  tokens.push({
129
129
  token: m['tok'],
130
- required: all_req || (!m['req'].nil? && m['req'] == '+'),
130
+ required: !m['req'].nil? && m['req'] == '+',
131
131
  negate: !m['req'].nil? && m['req'] =~ /[!\-]/
132
132
  })
133
133
  end
@@ -265,6 +265,7 @@ module NA
265
265
  target_proj = nil
266
266
 
267
267
  if project
268
+ project.sub!(/:$/, '')
268
269
  target_proj = projects.select { |pr| pr.project =~ /#{project.gsub(/:/, '.*?:.*?')}/i }.first
269
270
  if target_proj.nil?
270
271
  res = NA.yn(NA::Color.template("{y}Project {bw}#{project}{xy} doesn't exist, add it"), default: true)
@@ -290,6 +291,7 @@ module NA
290
291
  projects.select { |proj| proj.project =~ /^#{action.parent.join(':')}$/ }.first
291
292
  end
292
293
 
294
+ NA.notify("{r}Error parsing project #{target_proj}", exit_code: 1) if target_proj.nil?
293
295
 
294
296
  indent = "\t" * target_proj.indent
295
297
  note = note.split("\n") unless note.is_a?(Array)
@@ -758,12 +760,12 @@ module NA
758
760
 
759
761
  dirs = file.read_file.split("\n")
760
762
 
761
- optional = search.map { |t| t[:token] }
763
+ optional = search.filter { |s| !s[:negate] }.map { |t| t[:token] }
762
764
  required = search.filter { |s| s[:required] }.map { |t| t[:token] }
763
765
  negated = search.filter { |s| s[:negate] }.map { |t| t[:token] }
764
766
 
765
- optional.push('*') if required.count.zero? && negated.count.positive?
766
- if required == negated
767
+ optional.push('*') if optional.count.zero? && required.count.zero? && negated.count.positive?
768
+ if optional == negated
767
769
  required = ['*']
768
770
  optional = ['*']
769
771
  end
data/lib/na/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Na
2
- VERSION = '1.2.8'
2
+ VERSION = '1.2.10'
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.7<!--END VER-->.
12
+ The current version of `na` is <!--VER-->1.2.9<!--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.8
4
+ version: 1.2.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-28 00:00:00.000000000 Z
11
+ date: 2022-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake