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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1aac359fd813893b39d93b4378c7913764a689b2
4
- data.tar.gz: e2d4344aebabbc322ac97e09a4f7e504311e68ac
3
+ metadata.gz: 9687a3d23a4e43f5b0850ebb8a72074374740168
4
+ data.tar.gz: 89be960001d6e7c78ee85bf05433ac191859d66e
5
5
  SHA512:
6
- metadata.gz: 7eb4f797e2644adb1ac98916cdf8df42ab31b6449c54c530cfc73bbc43f87b5a1d89356ed7eb895f79d86e3eb0c4abbdb546487134637113be9402b4449d4a74
7
- data.tar.gz: 543d58abd737430b13931dcd2dd404bab9e8abf8fe2128d4acc49849b7ced18a54cf1db5e91b6f1a384180cf32c10e9a1d9aa2c1968aa271926a54311ad3e3d4
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
- raise "cannot find end paren" if end_paren_idx == -1 # end paren must exists after address
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
@@ -1,3 +1,3 @@
1
1
  module MailAddress
2
- VERSION = "1.2.6"
2
+ VERSION = "1.2.7"
3
3
  end
@@ -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
- expect {
558
- results = MailAddress.parse(line)
559
- }.to raise_error(StandardError, 'cannot find end paren')
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.6
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-07-09 00:00:00.000000000 Z
11
+ date: 2015-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler