mail_address 1.2.6 → 1.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mail_address/mail_address.rb +4 -1
- data/lib/mail_address/version.rb +1 -1
- data/spec/mail_address_spec.rb +13 -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: 9687a3d23a4e43f5b0850ebb8a72074374740168
|
4
|
+
data.tar.gz: 89be960001d6e7c78ee85bf05433ac191859d66e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 177c2773f8e320e783b85b48ac2f6ec03992a1f8277ce4594071597930db951fef7afbc49745151fc807bbdabf8b4b944cd35765679096068e875e2ead2318de
|
7
|
+
data.tar.gz: 67524413c8568795c473b0e0d988e8bd24a4f3a7625ffe1561be277394d5101f1ddacb1ce366f25f3cc98dd7ff0d10d67a172d1b90983c6a7dc5b230d12daa92
|
@@ -35,7 +35,10 @@ module MailAddress
|
|
35
35
|
|
36
36
|
if (substr == '(' && !address.empty?) then
|
37
37
|
end_paren_idx = _find_next_paren(idx, tokens, len)
|
38
|
-
|
38
|
+
if end_paren_idx == -1
|
39
|
+
# end paren doesn't exist
|
40
|
+
# but nothing to do
|
41
|
+
end
|
39
42
|
rem = tokens[idx .. end_paren_idx]
|
40
43
|
phrase.push(rem.join(''))
|
41
44
|
elsif (substr == '<') then
|
data/lib/mail_address/version.rb
CHANGED
data/spec/mail_address_spec.rb
CHANGED
@@ -554,9 +554,18 @@ describe MailAddress do
|
|
554
554
|
expect(results[0].original).to eq(line)
|
555
555
|
|
556
556
|
line = 'john <john@example.com> (last' # lack of right parenthesis
|
557
|
-
|
558
|
-
|
559
|
-
|
557
|
+
results = MailAddress.parse(line)
|
558
|
+
expect(results[0].original).to eq(line)
|
559
|
+
|
560
|
+
line = 'john <john@example.com> (ああ いい)' # right paren is a full-width char
|
561
|
+
results = MailAddress.parse(line)
|
562
|
+
expect(results[0].original).to eq(line)
|
563
|
+
|
564
|
+
line = 'john <john@example.com> (last, Mary <mary@example.com>' # lack of right parenthesis
|
565
|
+
results = MailAddress.parse(line)
|
566
|
+
expect(results[0].original).to eq('john <john@example.com> (last')
|
567
|
+
expect(results[1].original).to eq('Mary <mary@example.com>')
|
568
|
+
|
560
569
|
end
|
561
570
|
|
562
571
|
it "unbelievable but existed address" do
|
@@ -572,6 +581,7 @@ describe MailAddress do
|
|
572
581
|
expect(results[0].original).to eq('Sf 山田 太郎@example.com')
|
573
582
|
end
|
574
583
|
|
584
|
+
|
575
585
|
it 'Perl Module TAP test data' do
|
576
586
|
data = [
|
577
587
|
# [ '"Joe & J. Harvey" <ddd @Org>, JJV @ BBN',
|
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.7
|
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-
|
11
|
+
date: 2015-11-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|