umbrellio-utils 1.5.1 → 1.5.3

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: 7cd602271ee79c5ada9955b320e8b8f34a4eeaff2d6c5ceb44a4a3925f1c48c0
4
- data.tar.gz: 0c0e05b3b6c0fdd8859f9c65ee075cda6d22d8d6c583e2adea45c65b48390b61
3
+ metadata.gz: 8dbe11eaa3463a28e2f3fa682025baf53d86ee48a3397da363a04125d91ba179
4
+ data.tar.gz: 3d99056a1fd26addd40890d2a27d47906b355f3e76bf4382d0ffa9d76ef4e5e1
5
5
  SHA512:
6
- metadata.gz: 53a57309a2caf8fc51c184223401dd7b0ce285446ce1e633afe159dee813071cd37c1624c4735d2a7f263d113e5c65956b3da0be262d686201c99b12e483be74
7
- data.tar.gz: 11b10e82bc896b39741a7e35ad2c7a0f46eb70fa83c88975994a7515cc4275efa4c7ee6635037d3bbe991f188a986fdd8d8bd2c23bf55217946cf671d2a775d0
6
+ metadata.gz: d1a0d447edc9846015f4966f534ac428abbe0ad4774864df61a4fe6bd189e1046a01fd6c7964a3c038554e5525825ea3f07dedf95d7cdcd31cb4f4675daa53e3
7
+ data.tar.gz: 2892c6bf30bd9986b9600c8f5410713c1ec3dc148f2bfc7a2778f1b89a1a03cacb4c99793f390b5dcbc9ea44f415e191ed539e0e7cd846eade843179e5c4a4d8
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- umbrellio-utils (1.5.1)
4
+ umbrellio-utils (1.5.3)
5
5
  memery (~> 1)
6
6
 
7
7
  GEM
@@ -1,10 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "uri/mailto"
4
+
3
5
  module UmbrellioUtils
4
6
  module Checks
5
7
  extend self
6
8
 
7
- EMAIL_REGEXP = /\A([\w+-].?)+@[a-z\d-]+(\.[a-z]+)*\.[a-z]+\z/i
8
9
  HOLDER_NAME_REGEXP = /\A([A-Za-z0-9.'-]+ ?)+\z/
9
10
 
10
11
  def secure_compare(src, dest)
@@ -30,11 +31,11 @@ module UmbrellioUtils
30
31
  end
31
32
 
32
33
  def valid_email?(email)
33
- email.to_s =~ EMAIL_REGEXP
34
+ email.to_s.match?(URI::MailTo::EMAIL_REGEXP)
34
35
  end
35
36
 
36
37
  def valid_card_holder?(holder)
37
- holder.to_s =~ HOLDER_NAME_REGEXP
38
+ holder.to_s.match?(HOLDER_NAME_REGEXP)
38
39
  end
39
40
 
40
41
  def valid_card_cvv?(cvv)
@@ -19,8 +19,13 @@ module UmbrellioUtils
19
19
  end
20
20
 
21
21
  def retry_on_unique_violation(
22
- times: Float::INFINITY, retry_on_all_constraints: false, checked_constraints: [], &block
22
+ times: Float::INFINITY,
23
+ retry_on_all_constraints: false,
24
+ checked_constraints: [],
25
+ &block
23
26
  )
27
+ return yield if !retry_on_all_constraints && checked_constraints.empty?
28
+
24
29
  retry_on(Sequel::UniqueConstraintViolation, times:) do
25
30
  DB.transaction(savepoint: true, &block)
26
31
  rescue Sequel::UniqueConstraintViolation => e
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module UmbrellioUtils
4
- VERSION = "1.5.1"
4
+ VERSION = "1.5.3"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: umbrellio-utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 1.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Team Umbrellio
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-10-16 00:00:00.000000000 Z
11
+ date: 2024-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: memery
@@ -87,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
87
  - !ruby/object:Gem::Version
88
88
  version: '0'
89
89
  requirements: []
90
- rubygems_version: 3.5.21
90
+ rubygems_version: 3.5.22
91
91
  signing_key:
92
92
  specification_version: 4
93
93
  summary: A set of utilities that speed up development