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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 55a1aa4aa12065d46469e8c35b6041f37ee42cc1
4
- data.tar.gz: b797ab4c2a23d3ce801beaf16172ed0b0ff4280b
3
+ metadata.gz: 2ea80ed563bb14c8c10a2eca8c05a763edc5bccb
4
+ data.tar.gz: bf3bcc1a60900dc8b916b3594504740071b6cf62
5
5
  SHA512:
6
- metadata.gz: db93d3bf8aa49be0e99c1932ab0a6b2e226078e2768d97ec542aaa118c5dc65ec203fd9ed781ec17843390fcd78c2968501b6b61cd377953df9b6a079f685f4c
7
- data.tar.gz: dfba207c8827f687e68401236ae672350d669f5734db8ff4a119bec122f1f0d7f820f5c6ae8d99927ac73b3d893a785009ba384404c59fbf81a3d1093572bcff
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
- o = _complete(phrase, address, original)
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
@@ -1,3 +1,3 @@
1
1
  module MailAddress
2
- VERSION = "1.2.0"
2
+ VERSION = "1.2.1"
3
3
  end
@@ -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
- expect {
447
- results = MailAddress.parse(line)
448
- }.to raise_error(StandardError, "Unmatched '<>' in line")
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.0
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-26 00:00:00.000000000 Z
11
+ date: 2015-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler