eac_ruby_utils 0.118.1 → 0.119.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b989d21e13492e1820c666ac1bf0bf356391fbe153be2e6c028bcba26e4facb7
|
4
|
+
data.tar.gz: 16f9c6c3d5cb8223e6e4bc6e810987d4176cdac63dc8e3b46f305a095e835987
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88e7a947e6d07320130f6480ede4f0dea7d576c2b2b64746ce609feddf730cbc101621396366b4a60a149611c37815d6dab507826c4e857000e8ae76f6e1ac03
|
7
|
+
data.tar.gz: e09f8f28d2f08f149b842388928bf7581482811793bde963084cacb71a88ca61adfd2731e7385161dcf243fbf2e8f6952244a4bc28d2499d17e2eb548df4bb67
|
@@ -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.1
|
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-
|
11
|
+
date: 2023-07-08 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:
|