na 1.2.92 → 1.2.93
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 +4 -4
- data/CHANGELOG.md +8 -0
- data/Gemfile.lock +1 -1
- data/README.md +2 -2
- data/lib/na/todo.rb +28 -3
- data/lib/na/version.rb +1 -1
- data/src/_README.md +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d71185523bd5dc5bd29bca30dda53bedc598c7cd3df911aff0e6cfd6a1adb8cd
|
|
4
|
+
data.tar.gz: 388f8288110e0510397d9a7aa8fc75fc13305725c6dfdac10363274a4b2b6aef
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2b045eef10b1132aa64324d3e62f1910ac1e0754f60ee4b368ed85d841f594c5c2a960c908bd04966cdfc223752b54e2ee67a9f60b9960d684868daefcdbef0a
|
|
7
|
+
data.tar.gz: 8289a691269c86e829ae8e2abc48a97a0cf680240837f0fbdd48dbfe0f83feb65fb9fb729811253f22ab93215556b46321cfc3914b7dfb0fc8fbec1adf1b3cc7
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
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.
|
|
12
|
+
The current version of `na` is 1.2.93.
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
### Table of contents
|
|
@@ -116,7 +116,7 @@ SYNOPSIS
|
|
|
116
116
|
na [global options] command [command options] [arguments...]
|
|
117
117
|
|
|
118
118
|
VERSION
|
|
119
|
-
1.2.
|
|
119
|
+
1.2.93
|
|
120
120
|
|
|
121
121
|
GLOBAL OPTIONS
|
|
122
122
|
-a, --add - Add a next action (deprecated, for backwards compatibility)
|
data/lib/na/todo.rb
CHANGED
|
@@ -94,8 +94,11 @@ module NA
|
|
|
94
94
|
optional_tag.push({ tag: t })
|
|
95
95
|
end
|
|
96
96
|
end
|
|
97
|
+
# Track whether strings came from direct path (need escaping) or parse_search (already processed)
|
|
98
|
+
strings_from_direct_path = false
|
|
97
99
|
unless settings[:search].nil? || (settings[:search].respond_to?(:empty?) && settings[:search].empty?)
|
|
98
100
|
if settings[:regex] || settings[:search].is_a?(String)
|
|
101
|
+
strings_from_direct_path = true
|
|
99
102
|
if settings[:negate]
|
|
100
103
|
negated.push(settings[:search])
|
|
101
104
|
else
|
|
@@ -113,9 +116,31 @@ module NA
|
|
|
113
116
|
end
|
|
114
117
|
|
|
115
118
|
# Pre-compile regexes for better performance
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
+
# When regex is false and string came from direct path, escape special characters
|
|
120
|
+
# When regex is true, use as-is (it's already a regex pattern)
|
|
121
|
+
# Strings from parse_search are already processed by wildcard_to_rx, so use as-is
|
|
122
|
+
compile_regex = lambda do |rx|
|
|
123
|
+
if rx.is_a?(Regexp)
|
|
124
|
+
rx
|
|
125
|
+
elsif settings[:regex]
|
|
126
|
+
Regexp.new(rx, Regexp::IGNORECASE)
|
|
127
|
+
elsif strings_from_direct_path
|
|
128
|
+
Regexp.new(Regexp.escape(rx.to_s), Regexp::IGNORECASE)
|
|
129
|
+
else
|
|
130
|
+
# From parse_search, already processed by wildcard_to_rx
|
|
131
|
+
# Try to compile as-is, but if it fails, escape it (handles edge cases with special chars)
|
|
132
|
+
begin
|
|
133
|
+
Regexp.new(rx, Regexp::IGNORECASE)
|
|
134
|
+
rescue RegexpError
|
|
135
|
+
# If compilation fails, escape the string (fallback for edge cases)
|
|
136
|
+
Regexp.new(Regexp.escape(rx.to_s), Regexp::IGNORECASE)
|
|
137
|
+
end
|
|
138
|
+
end
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
optional = optional.map(&compile_regex)
|
|
142
|
+
required = required.map(&compile_regex)
|
|
143
|
+
negated = negated.map(&compile_regex)
|
|
119
144
|
|
|
120
145
|
files = if !settings[:file_path].nil?
|
|
121
146
|
[settings[:file_path]]
|
data/lib/na/version.rb
CHANGED
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.
|
|
12
|
+
The current version of `na` is <!--VER-->1.2.92<!--END VER-->.
|
|
13
13
|
|
|
14
14
|
<!--GITHUB-->
|
|
15
15
|
### Table of contents
|