glob 0.4.0 → 0.4.1

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: 45093c60b816f8216b7f61ecf9a87d682ebed8e355812d5f182d951f5573fa50
4
- data.tar.gz: 7cbeef3c989d6b06217a127ef54fca2e04dc0e26f60fb0bca27fdc69a4cc24ed
3
+ metadata.gz: 0a7c2fc46f05a01010dc0b3d6541528e3ec339103adcdda5621265cbd10c0b77
4
+ data.tar.gz: c335a9778db574f36d1a3c0da2119f42ddec83b91e2d7024b4d265122149e493
5
5
  SHA512:
6
- metadata.gz: d0fa710b8631ec0b85e9d86fb55fb666e82a709946b9209621e7da54cf41c6417056daeeba007b1b977b239e79cb86261f1af9eebe30d00b8e1926cee05f9af2
7
- data.tar.gz: cb099c539ea6b9317ed8622a22c9eddd1bf25ca5ca058eb1b9a5d328aa63924c10ac825c5fcc8c3a63d4c962de1c31109d31fb03fa59412851552a531f41fbb9
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: ["2.7", "3.0", "3.1"]
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@v3
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
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "./lib/glob/version"
3
+ require_relative "lib/glob/version"
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "glob"
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
- @regex = Regexp.new("^#{pattern}")
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
@@ -51,7 +51,7 @@ module Glob
51
51
  end
52
52
 
53
53
  private def unescape(key)
54
- key.to_s.gsub(/\\\./, ".")
54
+ key.to_s.gsub("\\.", ".")
55
55
  end
56
56
 
57
57
  private def set_path_value(segments, target, value)
data/lib/glob/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Glob
4
- VERSION = "0.4.0"
4
+ VERSION = "0.4.1"
5
5
  end
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.0
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: 2022-12-06 00:00:00.000000000 Z
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.0
156
- changelog_uri: https://github.com/fnando/glob/tree/v0.4.0/CHANGELOG.md
157
- documentation_uri: https://github.com/fnando/glob/tree/v0.4.0/README.md
158
- license_uri: https://github.com/fnando/glob/tree/v0.4.0/LICENSE.md
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.3.26
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