mail_address 1.2.18 → 1.2.19

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
- SHA1:
3
- metadata.gz: 833d9b9134350751bddcf7ca4f6ca54eff8a38fd
4
- data.tar.gz: 6c81de26be132ebb70e5c22c56c3cbe199992a7b
2
+ SHA256:
3
+ metadata.gz: 13603b8b09a30e1641652023214e199d838af06d4d7022c5d0c97a53798f495f
4
+ data.tar.gz: 1c6ca7323e50be0d24572415bbc90afe7c5f7f0b205a92fb4a03c84594def2f2
5
5
  SHA512:
6
- metadata.gz: 07c56ea14c1f38817800109bdada2f7d53e7573dc0a61dff0caa87ce9eb3074746198b6ff6f87f86a0d254d9e7fa7a4375a06f342050f4c43617b340d33a8cf3
7
- data.tar.gz: db03e23d3749afceb5e2fb2c1a3293830b46e42bc89b85ac37f3e9a3f745103063063a89a6dc192282a9966073136ab538fa4497fa88db16d855fa74181fd182
6
+ metadata.gz: 97d7c77f4e28b7c5bb38b2a035356e54147c0d0abbbedd7b028140283656b3a67289eadc5c8406782f8dd4b03f0479e54324402f4c84aa8fc7259ddfe4d5d7bb
7
+ data.tar.gz: 65c4d48be8dd2f856803a0825018200c736fcd25084505c7b5deb06a80e3743929630060f6a72e23d89257608469ce6a19c6ddfad6a221b0a9564c2a7de54048
data/README.md CHANGED
@@ -35,7 +35,7 @@ Or install it yourself as:
35
35
  ## Usage
36
36
 
37
37
  It's almost the same as Mail::Address(Perl).
38
- But in this module, removed `comment` property from address class in version v1.0.0. Most people don't reallize comment I think.
38
+ But in this module, removed `comment` property from address class in version v1.0.0. Most people don't realize comment I think.
39
39
 
40
40
  ```rb
41
41
  require 'mail_address'
@@ -15,7 +15,7 @@ module MailAddress
15
15
  QUOTED_REGEX_STR_ = '[+a-zA-Z0-9_.!#$%&\'*\\/=?^`{|}~-]+'
16
16
  UNQUOTED_REGEX_STR_ = '"' + QUOTED_REGEX_STR_ + '"'
17
17
  LOCAL_PART_REGEXP_STR_ = '(?:' + QUOTED_REGEX_STR_ + '|' + UNQUOTED_REGEX_STR_ + ')'
18
- DOMAIN_PART_REGEXP_STR_ = '([a-zA-Z0-9-]+\\.)+[a-zA-Z0-9]{2,63}'
18
+ DOMAIN_PART_REGEXP_STR_ = '([a-zA-Z0-9-_]+\\.)+[a-zA-Z0-9]{2,63}'
19
19
  EMAIL_ADDRESS_ = Regexp.new('\\A' + LOCAL_PART_REGEXP_STR_ + '@' + DOMAIN_PART_REGEXP_STR_ + '\\z')
20
20
 
21
21
  def self.parse_simple(str)
@@ -1,3 +1,3 @@
1
1
  module MailAddress
2
- VERSION = "1.2.18"
2
+ VERSION = "1.2.19"
3
3
  end
data/mail_address.gemspec CHANGED
@@ -18,8 +18,8 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_development_dependency "bundler", "~> 1.7"
22
- spec.add_development_dependency "rake", "~> 10.0"
21
+ spec.add_development_dependency "bundler", "~> 2.1"
22
+ spec.add_development_dependency "rake", "~> 13.0"
23
23
  spec.add_development_dependency 'rspec', '~> 3.1', '>= 3.1.0'
24
24
  spec.add_development_dependency "coveralls"
25
25
  end
@@ -23,6 +23,19 @@ describe MailAddress do
23
23
  expect(result.user).to eq('johndoe')
24
24
  expect(result.original).to eq(line)
25
25
 
26
+ # subdomain has underscore(s) (not common though)
27
+ line = 'johndoe@sub_domain.example.com'
28
+ result = MailAddress.parse_first(line)
29
+ expect(result.format).to eq('johndoe@sub_domain.example.com')
30
+ expect(result.format(true)).to eq('johndoe@sub_domain.example.com')
31
+ expect(result.address).to eq('johndoe@sub_domain.example.com')
32
+ expect(result.name).to be_nil
33
+ expect(result.phrase).to eq('')
34
+ expect(result.host).to eq('sub_domain.example.com')
35
+ expect(result.user).to eq('johndoe')
36
+ expect(result.original).to eq(line)
37
+
38
+
26
39
  # <address> only
27
40
  line = '<johndoe@example.com>'
28
41
  result = MailAddress.parse_first(line)
@@ -1,6 +1,4 @@
1
- # -*- coding: utf-8 -*-
2
1
  require 'spec_helper'
3
- require 'pp'
4
2
 
5
3
  #
6
4
  # These tests are almost ports of the following test code:
@@ -101,4 +99,10 @@ describe MailAddress do
101
99
  'Failed to parse pre-OS X Mac newlines');
102
100
  end
103
101
 
102
+ context "subdomain has underscore(s)" do
103
+ it "permits as an email address" do
104
+ assert_parsed_list("a@sub_domain.example.com", ['a@sub_domain.example.com'], 'OK');
105
+ end
106
+ end
107
+
104
108
  end
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.18
4
+ version: 1.2.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kizashi Nagata
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-14 00:00:00.000000000 Z
11
+ date: 2022-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.7'
19
+ version: '2.1'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.7'
26
+ version: '2.1'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: '13.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: '13.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -116,8 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  requirements: []
119
- rubyforge_project:
120
- rubygems_version: 2.5.2
119
+ rubygems_version: 3.1.2
121
120
  signing_key:
122
121
  specification_version: 4
123
122
  summary: Simple Mail Address Parser