mail_address 1.2.0 → 1.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 +4 -4
- data/lib/mail_address/mail_address.rb +7 -3
- data/lib/mail_address/version.rb +1 -1
- data/spec/mail_address_spec.rb +8 -3
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2ea80ed563bb14c8c10a2eca8c05a763edc5bccb
|
|
4
|
+
data.tar.gz: bf3bcc1a60900dc8b916b3594504740071b6cf62
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8061aa4fc64f3bcbda7cfa2ba80076c4b889d9b8730590d83213379f166a68b36cff2d833cf501be98627043048ea0440837083cb268dccbd4ea10bb578eb202
|
|
7
|
+
data.tar.gz: 77be31cd65481953676c5a861fb13c3594a078aa7e4cb2ebc779328242946186b662cd20c3d0a000249974ca6c8ad398b8f0386e4c9bd02c9ce750f455622555
|
|
@@ -43,11 +43,15 @@ module MailAddress
|
|
|
43
43
|
elsif (substr == '>') then
|
|
44
44
|
depth -= 1 if depth > 0
|
|
45
45
|
elsif (substr == ',' || substr == ';') then
|
|
46
|
-
raise "Unmatched '<>' in line" if depth > 0
|
|
47
|
-
|
|
48
46
|
original.sub!(/[,;]\s*\z/, '')
|
|
49
47
|
|
|
50
|
-
|
|
48
|
+
if depth > 0
|
|
49
|
+
# raise "Unmatched '<>' in line"
|
|
50
|
+
o = MailAddress::Address.new(original, nil, original)
|
|
51
|
+
phrase.clear; address.clear
|
|
52
|
+
else
|
|
53
|
+
o = _complete(phrase, address, original)
|
|
54
|
+
end
|
|
51
55
|
|
|
52
56
|
objs.push(o) if o
|
|
53
57
|
depth = 0
|
data/lib/mail_address/version.rb
CHANGED
data/spec/mail_address_spec.rb
CHANGED
|
@@ -443,9 +443,14 @@ describe MailAddress do
|
|
|
443
443
|
|
|
444
444
|
it "corrupted address" do
|
|
445
445
|
line = 'john <john@example.com' # lack of right angle bracket
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
446
|
+
results = MailAddress.parse(line)
|
|
447
|
+
expect(results[0].format).to eq('john <john@example.com')
|
|
448
|
+
expect(results[0].address).to be_nil
|
|
449
|
+
expect(results[0].name).to eq('john <john@example.com')
|
|
450
|
+
expect(results[0].phrase).to eq('john <john@example.com')
|
|
451
|
+
expect(results[0].host).to be_nil
|
|
452
|
+
expect(results[0].user).to eq('')
|
|
453
|
+
expect(results[0].original).to eq(line)
|
|
449
454
|
|
|
450
455
|
line = 'john <john@example.com> (last' # lack of right parenthesis
|
|
451
456
|
expect {
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mail_address
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kizashi Nagata
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-05-
|
|
11
|
+
date: 2015-05-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|