email_address 0.2.0 → 0.2.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: f9667acc31d6ce84fd3acb2e8e2f3ea04e496df5ff9dc5f89815fa148df1113e
4
- data.tar.gz: e17aa2b229cb28ca80dcbf37226a5411052758db1e15cee0ddc2038d5244de42
3
+ metadata.gz: 7db5d5d3abee697033dfef4eae04ab363e15ff1de031a11d0a99057c4ced63ae
4
+ data.tar.gz: e9a9496562833f2699f5dcbb4def03852f27468e2f292d4a9a86d44654e6d50b
5
5
  SHA512:
6
- metadata.gz: 908fa1ffaa5692b07fa4e586a66a8fdf6395c1a51013ee389e0437df175d6712ecc57831b6616cfabd28463a87c7a60df9b6ba8382cba0c58d8449e4ada51c6d
7
- data.tar.gz: a9f2a9bb8280118af5b21b08e8ca2273b16f3d5f700b91cb7c36b22444a7d5878e54a45292a2080243aff6fa4d31cd2ca3af4bd664f182b49d52ab42b864c711
6
+ metadata.gz: 911ccd6e02bf381a67f78ca14f139b4dc36a4905b4ca784a8e1df969d7bd725c9e679ba92d34b94ecc7038c9b0f39e39e843cac5d533f155874ef526b237d9a5
7
+ data.tar.gz: aa01ec4b35d46def0fd36c2d5bd59e1e94e65d4d4f10fb9e6dcea8cf7fda14b05ef61b0ab0269e5f7b50a4f60009cbefa16a3634eadfc01219e4d211eff5b102
@@ -188,7 +188,7 @@ module EmailAddress
188
188
  end
189
189
 
190
190
  def self.error_message(name, locale = "en")
191
- @errors[locale]["email_address"][name.to_s] || name.to_s
191
+ @errors.dig(locale, "email_address", name.to_s) || name.to_s
192
192
  end
193
193
 
194
194
  # Customize your own error message text.
@@ -351,8 +351,10 @@ module EmailAddress
351
351
  valid_size? or return false
352
352
  valid_encoding? or return false
353
353
  if tag
354
- return false unless mailbox =~ RELAXED_MAILBOX_REGEX &&
355
- tag =~ RELAXED_TAG_REGEX
354
+ return false unless RELAXED_MAILBOX_REGEX.match?(mailbox) &&
355
+ RELAXED_TAG_REGEX.match?(tag)
356
+ self.syntax = :relaxed
357
+ true
356
358
  elsif RELAXED_MAILBOX_REGEX.match?(local)
357
359
  self.syntax = :relaxed
358
360
  true
@@ -1,3 +1,3 @@
1
1
  module EmailAddress
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -110,7 +110,8 @@ class TestHost < MiniTest::Test
110
110
  end
111
111
 
112
112
  def test_hosted_service
113
- assert EmailAddress.valid?("test@jiff.com", dns_lookup: :mx)
113
+ # Is there a gmail-hosted domain that will continue to exist? Removing until then
114
+ # assert EmailAddress.valid?("test@jiff.com", dns_lookup: :mx)
114
115
  assert !EmailAddress.valid?("test@gmail.com", dns_lookup: :mx)
115
116
  end
116
117
 
@@ -105,4 +105,8 @@ class TestLocal < MiniTest::Test
105
105
  def test_tag_punctuation
106
106
  assert EmailAddress.valid?("first.last+foo.bar@gmail.com")
107
107
  end
108
+
109
+ def test_relaxed_tag
110
+ assert EmailAddress.valid? "foo+abc@example.com", host_validation: :syntax, local_format: :relaxed
111
+ end
108
112
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: email_address
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Allen Fair
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-02 00:00:00.000000000 Z
11
+ date: 2021-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -195,7 +195,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
195
195
  - !ruby/object:Gem::Version
196
196
  version: '0'
197
197
  requirements: []
198
- rubygems_version: 3.2.15
198
+ rubygems_version: 3.2.22
199
199
  signing_key:
200
200
  specification_version: 4
201
201
  summary: This gem provides a ruby language library for working with and validating