eac_ruby_utils 0.118.1 → 0.119.0

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: 904ea7b7f6c0df2889d854f1f2aba29f52511bab46ab634cc6faf850fe2421f4
4
- data.tar.gz: 878c847fcdc7214bafc113c5a3af0269537c967858c6d399381f54ae997f0681
3
+ metadata.gz: 1d71d34fe45cdb062a5f3974813666aef60b02ba8134e8b5eaf235467d328691
4
+ data.tar.gz: 64087fb892acc2127b9558179c13161d6a7a91837bf297c0cc8375de76a1be8d
5
5
  SHA512:
6
- metadata.gz: d7c3d1433a92489eb25ba845e0bc84b34a8065ececa9f27220a591176d4197a3ecf66de8f69dd27970fed3e3e5b24d9ae50679dcea3b19e0a104ef82d634e455
7
- data.tar.gz: 5ba94d00fe8576164dcc74caa66e54f13fdc5abf1bf9c9d8d7704a3727837a0dde5dac3c0e1ffa7fcf4ee37180faa41475e9a888dd235ec1fb23fdbdce9bf414
6
+ metadata.gz: 4d1e1dfe4a2ac6c4364aab93ef1291d0f78ff4508ebae94e147b95b8101ca04086f9c61adb64f2d622d23081e36e5ff648c58430d5fa8e3895d43b33d77821fe
7
+ data.tar.gz: 0a8b6b6575623856a12c50fbd9b918fecd5713c6de188f8f4d3392004ea3e81e8131faa6ba0a84bdd080dda3ead1f1d044d5746b02019586cb072c65aa4b9aed
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacRubyUtils
4
- VERSION = '0.118.1'
4
+ VERSION = '0.119.0'
5
5
  end
@@ -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.118.1
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-24 00:00:00.000000000 Z
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: