glob 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby-tests.yml +2 -2
- data/CHANGELOG.md +4 -0
- data/glob.gemspec +1 -1
- data/lib/glob/matcher.rb +3 -2
- data/lib/glob/object.rb +1 -1
- data/lib/glob/version.rb +1 -1
- data/test/glob_test.rb +11 -0
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a7c2fc46f05a01010dc0b3d6541528e3ec339103adcdda5621265cbd10c0b77
|
4
|
+
data.tar.gz: c335a9778db574f36d1a3c0da2119f42ddec83b91e2d7024b4d265122149e493
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 756f0564e9e192ce4c975bfdfcd299acffceab70f47b4e34c49d3180cc0887e6933a0b87ee3583ac37fadd3401e420b0e43f7e8776f072b8ae91e154b51b3adc
|
7
|
+
data.tar.gz: ba1fe966b7cfef2f0d8d78e417132ea1b60466b4732002519bd398822115fe8751e7d8525050cee72be3f4375320861240510a2fb75deb4eb3ba7aa7bd605f71
|
@@ -19,12 +19,12 @@ jobs:
|
|
19
19
|
strategy:
|
20
20
|
fail-fast: false
|
21
21
|
matrix:
|
22
|
-
ruby: ["
|
22
|
+
ruby: ["3.0", "3.1", "3.2", "3.3"]
|
23
23
|
gemfile:
|
24
24
|
- Gemfile
|
25
25
|
|
26
26
|
steps:
|
27
|
-
- uses: actions/checkout@
|
27
|
+
- uses: actions/checkout@v4
|
28
28
|
|
29
29
|
- uses: actions/cache@v3
|
30
30
|
with:
|
data/CHANGELOG.md
CHANGED
@@ -11,6 +11,10 @@ Prefix your message with one of the following:
|
|
11
11
|
- [Security] in case of vulnerabilities.
|
12
12
|
-->
|
13
13
|
|
14
|
+
## v0.4.1 - 2024-01-03
|
15
|
+
|
16
|
+
- [Fixed] Fix partial matching when not using `*`.
|
17
|
+
|
14
18
|
## v0.4.0 - 2022-12-05
|
15
19
|
|
16
20
|
- [Changed] `Glob::Query` has been renamed to `Glob::Object`.
|
data/glob.gemspec
CHANGED
data/lib/glob/matcher.rb
CHANGED
@@ -10,8 +10,9 @@ module Glob
|
|
10
10
|
|
11
11
|
pattern = Regexp.escape(path.gsub(/^!/, ""))
|
12
12
|
.gsub(/(\\{.*?\\})/) {|match| process_group(match) }
|
13
|
-
.gsub(
|
14
|
-
|
13
|
+
.gsub("\\*", "[^.]+")
|
14
|
+
anchor = path.end_with?("*") ? "" : "$"
|
15
|
+
@regex = Regexp.new("^#{pattern}#{anchor}")
|
15
16
|
end
|
16
17
|
|
17
18
|
def match?(other)
|
data/lib/glob/object.rb
CHANGED
data/lib/glob/version.rb
CHANGED
data/test/glob_test.rb
CHANGED
@@ -3,6 +3,17 @@
|
|
3
3
|
require "test_helper"
|
4
4
|
|
5
5
|
class GlobTest < Minitest::Test
|
6
|
+
test "with partial matching" do
|
7
|
+
glob = Glob.new(
|
8
|
+
en: {editor: "editor", edit: "edit"},
|
9
|
+
pt: {editor: "editor", edit: "edit"}
|
10
|
+
)
|
11
|
+
|
12
|
+
glob << "*.edit"
|
13
|
+
|
14
|
+
assert_equal ["en.edit", "pt.edit"], glob.paths
|
15
|
+
end
|
16
|
+
|
6
17
|
test "with rejecting filter" do
|
7
18
|
glob = Glob.new(
|
8
19
|
en: {
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glob
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nando Vieira
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -152,10 +152,10 @@ metadata:
|
|
152
152
|
rubygems_mfa_required: 'true'
|
153
153
|
homepage_uri: https://github.com/fnando/glob
|
154
154
|
bug_tracker_uri: https://github.com/fnando/glob/issues
|
155
|
-
source_code_uri: https://github.com/fnando/glob/tree/v0.4.
|
156
|
-
changelog_uri: https://github.com/fnando/glob/tree/v0.4.
|
157
|
-
documentation_uri: https://github.com/fnando/glob/tree/v0.4.
|
158
|
-
license_uri: https://github.com/fnando/glob/tree/v0.4.
|
155
|
+
source_code_uri: https://github.com/fnando/glob/tree/v0.4.1
|
156
|
+
changelog_uri: https://github.com/fnando/glob/tree/v0.4.1/CHANGELOG.md
|
157
|
+
documentation_uri: https://github.com/fnando/glob/tree/v0.4.1/README.md
|
158
|
+
license_uri: https://github.com/fnando/glob/tree/v0.4.1/LICENSE.md
|
159
159
|
post_install_message:
|
160
160
|
rdoc_options: []
|
161
161
|
require_paths:
|
@@ -171,7 +171,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
171
171
|
- !ruby/object:Gem::Version
|
172
172
|
version: '0'
|
173
173
|
requirements: []
|
174
|
-
rubygems_version: 3.
|
174
|
+
rubygems_version: 3.4.19
|
175
175
|
signing_key:
|
176
176
|
specification_version: 4
|
177
177
|
summary: Create a list of hash paths that match a given pattern. You can also generate
|