eac_ruby_utils 0.118.1 → 0.119.0
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/lib/eac_ruby_utils/version.rb +1 -1
- data/lib/eac_ruby_utils/wildcards.rb +26 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d71d34fe45cdb062a5f3974813666aef60b02ba8134e8b5eaf235467d328691
|
4
|
+
data.tar.gz: 64087fb892acc2127b9558179c13161d6a7a91837bf297c0cc8375de76a1be8d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d1e1dfe4a2ac6c4364aab93ef1291d0f78ff4508ebae94e147b95b8101ca04086f9c61adb64f2d622d23081e36e5ff648c58430d5fa8e3895d43b33d77821fe
|
7
|
+
data.tar.gz: 0a8b6b6575623856a12c50fbd9b918fecd5713c6de188f8f4d3392004ea3e81e8131faa6ba0a84bdd080dda3ead1f1d044d5746b02019586cb072c65aa4b9aed
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module EacRubyUtils
|
4
|
+
# The `Wildcards` class provides pattern matching with wildcards using regular expressions.
|
5
|
+
class Wildcards
|
6
|
+
# Initializes a new instance of the `Wildcards` class with the specified pattern.
|
7
|
+
#
|
8
|
+
# @param pattern [String] The pattern to match against.
|
9
|
+
def initialize(pattern)
|
10
|
+
@pattern = pattern
|
11
|
+
end
|
12
|
+
|
13
|
+
# Matches the given string against the pattern.
|
14
|
+
#
|
15
|
+
# @param string [String] The string to match.
|
16
|
+
# @return [Boolean] Returns `true` if the string matches the pattern, otherwise `false`.
|
17
|
+
delegate :match?, to: :regex
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
# @return [Regexp]
|
22
|
+
def regex
|
23
|
+
::Regexp.new("^#{::Regexp.escape(@pattern).gsub('\*', '.*').gsub('\?', '.?')}$")
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eac_ruby_utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.119.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Esquilo Azul Company
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-06-
|
11
|
+
date: 2023-06-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -314,6 +314,7 @@ files:
|
|
314
314
|
- lib/eac_ruby_utils/struct.rb
|
315
315
|
- lib/eac_ruby_utils/unimplemented_method_error.rb
|
316
316
|
- lib/eac_ruby_utils/version.rb
|
317
|
+
- lib/eac_ruby_utils/wildcards.rb
|
317
318
|
- lib/eac_ruby_utils/yaml.rb
|
318
319
|
homepage:
|
319
320
|
licenses:
|