valid_email2 2.2.0 → 2.2.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4efb3075e063a636d33229b0a59d8f4209bf8837
4
- data.tar.gz: 8b54ad8488422e2976cf7ee9a08fac064fe20357
3
+ metadata.gz: 4846126777b929a2c98071c1a37d123f862f27cb
4
+ data.tar.gz: 34855d8b778cdf6a2b37d367ad3c0bad450d13e9
5
5
  SHA512:
6
- metadata.gz: 9628e362c4c828adc1d47005d05dc5c947aef9303445c7a667f55b0a194fa7b13d5f223adacef37c59480449d66ea665b6131b56e60b1a3d95de02ccdfbca01e
7
- data.tar.gz: e369e0af8a46db2e93aee4f82957115313eda5d643a9752bd68b40c5834fc84822136642110fe4187c10697cdd1865df33fb363646c17f6fa7e6d179f8ac1e0e
6
+ metadata.gz: 85bfaea5ddd6e2d71d271f5c4cc6c5fda4b13c1e297d19357e496a6daaccf39d6b95dcf73e7b91177b26cf414ebb7a16a9e141a09fa270fd9d80c50f8d427e58
7
+ data.tar.gz: 8cbf2ca1cc79031ccdf1c5fa37131993dc2dab391191df74356a65ce8a3c07e13c398a7e0d52ff6bba55abc72688c775cdf0561c33dcffaea99e182af0b1d942
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## Version 2.2.1
2
+ Fix regression where `ValidEmail2::Address.new` couldn't handle the address
3
+ being nil (https://github.com/lisinge/valid_email2/issues/102)
4
+
1
5
  ## Version 2.2.0
2
6
  Removed backwards-compatability shim (https://github.com/lisinge/valid_email2/pull/79)
3
7
  Removed protonmail.com from disposable email domains (https://github.com/lisinge/valid_email2/pull/99)
@@ -66,7 +66,9 @@ module ValidEmail2
66
66
  end
67
67
 
68
68
  def address_contain_emoticons? email_str
69
- (email_str.each_char.select { |char| char.bytesize > 1 }.join).empty? ? false : true
69
+ return false if email_str.nil?
70
+
71
+ email_str.each_char.any? { |char| char.bytesize > 1 }
70
72
  end
71
73
  end
72
74
  end
@@ -1,3 +1,3 @@
1
1
  module ValidEmail2
2
- VERSION = "2.2.0"
2
+ VERSION = "2.2.1"
3
3
  end
@@ -16,10 +16,6 @@ class TestUserDisallowBlacklisted < TestModel
16
16
  validates :email, 'valid_email_2/email': { blacklist: true }
17
17
  end
18
18
 
19
- class BackwardsCompatibleUser < TestModel
20
- validates :email, 'valid_email_2/email': true
21
- end
22
-
23
19
  describe ValidEmail2 do
24
20
  describe "basic validation" do
25
21
  subject(:user) { TestUser.new(email: "") }
@@ -60,14 +56,6 @@ describe ValidEmail2 do
60
56
  user = TestUser.new(email: "foo@bar..com")
61
57
  expect(user.valid?).to be_falsey
62
58
  end
63
-
64
- it "still works with the backwards-compatible syntax" do
65
- user = BackwardsCompatibleUser.new(email: "foo@bar.com")
66
- expect(user.valid?).to be_truthy
67
-
68
- user = BackwardsCompatibleUser.new(email: "foo@bar")
69
- expect(user.valid?).to be_falsey
70
- end
71
59
  end
72
60
 
73
61
  describe "disposable emails" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: valid_email2
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micke Lisinge
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-25 00:00:00.000000000 Z
11
+ date: 2018-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler