na 1.2.65 → 1.2.66

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: 34efff84dbba9e86c4cfbd4fc0c36f0c153cb024e42a887a93012f41b18774ce
4
- data.tar.gz: 4db0cd0d3067c119ccdf34ae8481bc08c75acc3dd79dc30e11661b15530a0864
3
+ metadata.gz: e55a544aa2a32d81e208e30dc4e3c43cda1e6f91df7b27ee956a72fda328a575
4
+ data.tar.gz: 54f9bba1d550e62b6e2d509f2a3b69263b10049cea0f69b39cd304b6328ec7f7
5
5
  SHA512:
6
- metadata.gz: 78c9b862f5962fe23fb0a7452044d26f6eac92208634857b21881e1c74a7277ea086fa7d0e663b61b0883adc3f3f731cb12e4af92860aa4534f72373e0c2205c
7
- data.tar.gz: e8819f6ec109c3903c5c51b53e2009deb86a385f5465816825fad39c5794285a48cd693cb3876f2b43e7d39c6cb6006299896c76b6103884aed206127b422f95
6
+ metadata.gz: cfb11dacafe1d09ec339eb10b419c540fb42f45c0d4bf2492ddc23fabd7df4a7174268e4b9d054fa7b9c5c1e08bb22c6834b32b583ac874a8e2b28261bf7437e
7
+ data.tar.gz: 567acf2c48eb5e84ca4af54fe03aab6d6b4a1b6f74f446d0a723ce9e6ce2bf4f04c8ffa9e41ffbeba5f7e2ba23785a742db2c2dca656b783f40113fad9a03c74
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ### 1.2.66
2
+
3
+ 2024-06-23 10:56
4
+
5
+ #### IMPROVED
6
+
7
+ - When passing a query to `next`, prefer exact matches when available
8
+
1
9
  ### 1.2.64
2
10
 
3
11
  2024-06-22 12:06
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- na (1.2.65)
4
+ na (1.2.66)
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.64.
12
+ The current version of `na` is 1.2.66.
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
 
@@ -76,7 +76,7 @@ SYNOPSIS
76
76
  na [global options] command [command options] [arguments...]
77
77
 
78
78
  VERSION
79
- 1.2.65
79
+ 1.2.66
80
80
 
81
81
  GLOBAL OPTIONS
82
82
  -a, --add - Add a next action (deprecated, for backwards compatibility)
@@ -578,6 +578,9 @@ module NA
578
578
  end
579
579
 
580
580
  dirs = dirs.sort_by { |d| File.basename(d) }.uniq
581
+
582
+ dirs = find_exact_dir(dirs, search)
583
+
581
584
  if dirs.empty? && require_last
582
585
  NA.notify("#{NA.theme[:warning]}No matches, loosening search", debug: true)
583
586
  match_working_dir(search, distance: 2, require_last: false)
@@ -587,6 +590,18 @@ module NA
587
590
  end
588
591
  end
589
592
 
593
+ def find_exact_dir(dirs, search)
594
+ terms = search.filter { |s| !s[:negate] }.map { |t| t[:token] }.join(' ')
595
+ out = dirs
596
+ dirs.each do |dir|
597
+ if File.basename(dir).sub(/\.#{NA.extension}$/, '') =~ /^#{terms}$/
598
+ out = [dir]
599
+ break
600
+ end
601
+ end
602
+ out
603
+ end
604
+
590
605
  ##
591
606
  ## Save a todo file path to the database
592
607
  ##
data/lib/na/todo.rb CHANGED
@@ -94,7 +94,7 @@ module NA
94
94
  else
95
95
  NA.match_working_dir(settings[:query])
96
96
  end
97
- NA.notify("Files: #{files.join(', ')}", debug:true)
97
+ NA.notify("Files: #{files.join(', ')}", debug: true)
98
98
  files.each do |file|
99
99
  NA.save_working_dir(File.expand_path(file))
100
100
  content = file.read_file
data/lib/na/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Na
2
- VERSION = '1.2.65'
2
+ VERSION = '1.2.66'
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.63<!--END VER-->.
12
+ The current version of `na` is <!--VER-->1.2.65<!--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.65
4
+ version: 1.2.66
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-22 00:00:00.000000000 Z
11
+ date: 2024-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake