na 1.2.98 → 1.2.100

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: 0f82dc36deae233300843fac7ccd81408a28e4f8c29266ef036df11c731ef94a
4
- data.tar.gz: 544b783521ff49f4e169fc7b4fb0be1523264217503d1685ef80d2aa2750a8fb
3
+ metadata.gz: 161cff6e82e373cadc9394d29ff0f85370bbf5534e670e92932967d2a0c0b84f
4
+ data.tar.gz: a12760bc81615804c838e1307d8f2a36540773029d8fe46fab009343c8d4edf8
5
5
  SHA512:
6
- metadata.gz: 5abe2d76e969c58010a3d566074c3fc7d80817657f6f59c3a2039f5f0fe53028dec707be05db546642644b85ac9043006e8d86d0dbb2189465943af60442421d
7
- data.tar.gz: 670c1efea7d6365266128bac5cc184001c3998056300cbb07fcde1a8b4cda8e9f1bf5e686acc14840b7fde9efcdea74b18c68fdf3dad334cdd0dbd393177d0cc
6
+ metadata.gz: 2a99a7da6f5bf56c317e97096fdd76b5e6001acf4008f82b8b3fd7e16c3063b15f89c96d32bbab9a630fa221620fb81cba4a48ab1f0ce94e4deb40ad0680049f
7
+ data.tar.gz: 3347cdfe0edb74a52434cb6efd54a7128f27186f50cf281ca70c112864d49224c4d8b72558058451cb60d25b15613fd117ba5e697c5c5f0eddb9f354d9919021
data/.rubocop_todo.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2026-02-24 10:37:38 UTC using RuboCop version 1.81.7.
3
+ # on 2026-02-27 15:51:35 UTC using RuboCop version 1.81.7.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
@@ -24,7 +24,7 @@ Lint/UnusedMethodArgument:
24
24
  # Offense count: 58
25
25
  # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
26
26
  Metrics/AbcSize:
27
- Max: 309
27
+ Max: 326
28
28
 
29
29
  # Offense count: 14
30
30
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
@@ -40,12 +40,12 @@ Metrics/BlockNesting:
40
40
  # Offense count: 6
41
41
  # Configuration parameters: CountComments, CountAsOne.
42
42
  Metrics/ClassLength:
43
- Max: 1495
43
+ Max: 1502
44
44
 
45
45
  # Offense count: 41
46
46
  # Configuration parameters: AllowedMethods, AllowedPatterns.
47
47
  Metrics/CyclomaticComplexity:
48
- Max: 91
48
+ Max: 97
49
49
 
50
50
  # Offense count: 63
51
51
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
@@ -55,7 +55,7 @@ Metrics/MethodLength:
55
55
  # Offense count: 5
56
56
  # Configuration parameters: CountComments, CountAsOne.
57
57
  Metrics/ModuleLength:
58
- Max: 1497
58
+ Max: 1504
59
59
 
60
60
  # Offense count: 5
61
61
  # Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
@@ -65,7 +65,7 @@ Metrics/ParameterLists:
65
65
  # Offense count: 39
66
66
  # Configuration parameters: AllowedMethods, AllowedPatterns.
67
67
  Metrics/PerceivedComplexity:
68
- Max: 104
68
+ Max: 110
69
69
 
70
70
  # Offense count: 1
71
71
  # Configuration parameters: ForbiddenDelimiters.
@@ -140,7 +140,7 @@ Style/YAMLFileRead:
140
140
  Exclude:
141
141
  - 'lib/na/theme.rb'
142
142
 
143
- # Offense count: 38
143
+ # Offense count: 40
144
144
  # This cop supports safe autocorrection (--autocorrect).
145
145
  # Configuration parameters: AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
146
146
  # URISchemes: http, https
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ### 1.2.100
2
+
3
+ 2026-02-27 09:53
4
+
5
+ #### FIXED
6
+
7
+ - Match unique nested projects by leaf name in add/update
8
+
1
9
  ### 1.2.98
2
10
 
3
11
  2026-02-24 11:26
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- na (1.2.98)
4
+ na (1.2.100)
5
5
  chronic (~> 0.10, >= 0.10.2)
6
6
  csv (~> 3.2)
7
7
  git (~> 3.0.0)
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.98.
12
+ The current version of `na` is 1.2.100.
13
13
 
14
14
 
15
15
  ### Table of contents
@@ -257,7 +257,7 @@ SYNOPSIS
257
257
  na [global options] command [command options] [arguments...]
258
258
 
259
259
  VERSION
260
- 1.2.98
260
+ 1.2.100
261
261
 
262
262
  GLOBAL OPTIONS
263
263
  -a, --add - Add a next action (deprecated, for backwards compatibility)
@@ -502,7 +502,17 @@ module NA
502
502
  # If move is set, update add.parent to the target project
503
503
  add.parent = target_proj.project.split(':') if move && target_proj
504
504
  project_path = add.parent.join(':')
505
- target_proj ||= projects.select { |proj| proj.project =~ /^#{project_path}$/i }.first
505
+ target_proj ||= projects.select { |proj| proj.project =~ /^#{Regexp.escape(project_path)}$/i }.first
506
+
507
+ if target_proj.nil? && !project_path.empty? && !project_path.include?(':')
508
+ # Fallback: if a bare leaf name was provided and it uniquely matches
509
+ # the final segment of an existing nested project, use that project
510
+ candidates = projects.select do |proj|
511
+ leaf = proj.project.to_s.split(':').last
512
+ leaf&.casecmp?(project_path)
513
+ end
514
+ target_proj = candidates.first if candidates.size == 1
515
+ end
506
516
 
507
517
  if target_proj.nil? && !project_path.empty?
508
518
  display_path = project_path.tr(':', '/')
@@ -515,7 +525,7 @@ module NA
515
525
  created_proj = insert_project(target, project_path)
516
526
  contents = target.read_file.split("\n")
517
527
  projects = find_projects(target)
518
- target_proj = projects.select { |proj| proj.project =~ /^#{project_path}$/i }.first || created_proj
528
+ target_proj = projects.select { |proj| proj.project =~ /^#{Regexp.escape(project_path)}$/i }.first || created_proj
519
529
  end
520
530
 
521
531
  add.parent = target_proj.project.split(':') if target_proj
data/lib/na/version.rb CHANGED
@@ -5,5 +5,5 @@
5
5
  module Na
6
6
  ##
7
7
  # Current version of the na gem.
8
- VERSION = '1.2.98'
8
+ VERSION = '1.2.100'
9
9
  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.97<!--END VER-->.
12
+ The current version of `na` is <!--VER-->1.2.98<!--END VER-->.
13
13
 
14
14
  <!--GITHUB-->
15
15
  ### Table of contents
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.98
4
+ version: 1.2.100
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra