fast_ignore 0.17.0 → 0.17.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/fast_ignore/gitignore_rule_builder.rb +17 -1
- data/lib/fast_ignore/gitignore_rule_scanner.rb +12 -4
- data/lib/fast_ignore/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88853f2613fe610772a13666845d500a4b377bbf5606e3fba3bd8842d66c17a2
|
4
|
+
data.tar.gz: c158117c0234816a067b3e68d7686e247bf18ea81e39b3c339fcf06ecc4026ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a409a69b31021dedca95858ebed16abb4a36efbb758067dcab41bd6cbeb988acf0a62d4324f31cbb68ba4787efca4564cfc51721a50dc710f3357923775cc6e2
|
7
|
+
data.tar.gz: 4f0e0a8f900d6c0d008850eb8899c1c4446914149697539b9f708620054b614b310305e83df8743a3d5fb558a82ac08f0d48e44450486ad5de966943916a6ac2
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
# v0.17.1
|
2
|
+
- fix handling of backward character classes `[z-a]`
|
3
|
+
previously this raised a RegexpError, but git just considered it to be identical to `[z]`, now we match the git behaviour (but why would you ever do this?, i only found it because of the fuzz spec in the `leftovers` gem)
|
4
|
+
|
1
5
|
# v0.17.0
|
2
6
|
- allow overriding `exists:` in `allowed?`
|
3
7
|
- allow setting `include_directories: true` in `allowed?`
|
@@ -108,8 +108,8 @@ class FastIgnore
|
|
108
108
|
unmatchable_rule! if @s.character_class_end?
|
109
109
|
|
110
110
|
until @s.character_class_end?
|
111
|
+
next if process_character_class_range
|
111
112
|
next if process_backslash
|
112
|
-
next @re.append_character_class_dash if @s.dash?
|
113
113
|
next if @re.append_escaped(@s.character_class_literal)
|
114
114
|
|
115
115
|
unmatchable_rule!
|
@@ -118,6 +118,22 @@ class FastIgnore
|
|
118
118
|
@re.append_character_class_close
|
119
119
|
end
|
120
120
|
|
121
|
+
def process_character_class_range
|
122
|
+
start = @s.character_class_range_start
|
123
|
+
return unless start
|
124
|
+
|
125
|
+
start = start.delete_prefix('\\')
|
126
|
+
|
127
|
+
@re.append_escaped(start)
|
128
|
+
|
129
|
+
finish = @s.character_class_range_end.delete_prefix('\\')
|
130
|
+
|
131
|
+
return true unless start < finish
|
132
|
+
|
133
|
+
@re.append_character_class_dash
|
134
|
+
@re.append_escaped(finish)
|
135
|
+
end
|
136
|
+
|
121
137
|
def process_end
|
122
138
|
blank! if nothing_emitted?
|
123
139
|
|
@@ -46,12 +46,20 @@ class FastIgnore
|
|
46
46
|
skip(/\?/)
|
47
47
|
end
|
48
48
|
|
49
|
-
def
|
50
|
-
|
49
|
+
def character_class_literal
|
50
|
+
matched if scan(/[^\]\\][^\]\\-]*(?!-)/)
|
51
51
|
end
|
52
52
|
|
53
|
-
def
|
54
|
-
matched if scan(/[
|
53
|
+
def character_class_range_start
|
54
|
+
matched if scan(/(\\.|[^\\\]])(?=-(\\.|[^\\\]]))/)
|
55
|
+
end
|
56
|
+
|
57
|
+
def character_class_range_end
|
58
|
+
# we already confirmed this was going to match
|
59
|
+
# with the lookahead in character_class_range_start
|
60
|
+
skip(/-/)
|
61
|
+
scan(/(\\.|[^\\\]])/)
|
62
|
+
matched
|
55
63
|
end
|
56
64
|
|
57
65
|
def literal
|
data/lib/fast_ignore/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fast_ignore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.17.
|
4
|
+
version: 0.17.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dana Sherson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-03-
|
11
|
+
date: 2022-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -218,7 +218,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
218
218
|
- !ruby/object:Gem::Version
|
219
219
|
version: '0'
|
220
220
|
requirements: []
|
221
|
-
rubygems_version: 3.
|
221
|
+
rubygems_version: 3.1.6
|
222
222
|
signing_key:
|
223
223
|
specification_version: 4
|
224
224
|
summary: Parse gitignore files, quickly
|