domain_name 0.5.20190701 → 0.6.20231109
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +34 -0
- data/CHANGELOG.md +7 -0
- data/Rakefile +2 -2
- data/data/public_suffix_list.dat +4756 -2310
- data/domain_name.gemspec +3 -3
- data/lib/domain_name/etld_data.rb +1691 -900
- data/lib/domain_name/version.rb +1 -1
- data/lib/domain_name.rb +1 -2
- data/test/test_domain_name-punycode.rb +1 -1
- metadata +11 -31
- data/.travis.yml +0 -21
data/lib/domain_name/version.rb
CHANGED
data/lib/domain_name.rb
CHANGED
@@ -8,7 +8,6 @@
|
|
8
8
|
require 'domain_name/version'
|
9
9
|
require 'domain_name/punycode'
|
10
10
|
require 'domain_name/etld_data'
|
11
|
-
require 'unf'
|
12
11
|
require 'ipaddr'
|
13
12
|
|
14
13
|
# Represents a domain name ready for extracting its registered domain
|
@@ -286,7 +285,7 @@ class DomainName
|
|
286
285
|
# Normalizes a _domain_ using the Punycode algorithm as necessary.
|
287
286
|
# The result will be a downcased, ASCII-only string.
|
288
287
|
def normalize(domain)
|
289
|
-
DomainName::Punycode.encode_hostname(domain.chomp(DOT).
|
288
|
+
DomainName::Punycode.encode_hostname(domain.chomp(DOT).unicode_normalize(:nfc)).downcase
|
290
289
|
end
|
291
290
|
end
|
292
291
|
end
|
@@ -91,7 +91,7 @@ class TestDomainName < Test::Unit::TestCase
|
|
91
91
|
'-> $1.00 <--']
|
92
92
|
].each { |title, cps, punycode|
|
93
93
|
assert_equal punycode, DomainName::Punycode.encode(cps.pack('U*')), title
|
94
|
-
assert_equal cps.pack('U*').
|
94
|
+
assert_equal cps.pack('U*').unicode_normalize(:nfc), DomainName::Punycode.decode(punycode), title
|
95
95
|
}
|
96
96
|
end
|
97
97
|
end
|
metadata
CHANGED
@@ -1,49 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: domain_name
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.20231109
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Akinori MUSHA
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: unf
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 0.0.5
|
20
|
-
- - "<"
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: 1.0.0
|
23
|
-
type: :runtime
|
24
|
-
prerelease: false
|
25
|
-
version_requirements: !ruby/object:Gem::Requirement
|
26
|
-
requirements:
|
27
|
-
- - ">="
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: 0.0.5
|
30
|
-
- - "<"
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: 1.0.0
|
33
13
|
- !ruby/object:Gem::Dependency
|
34
14
|
name: test-unit
|
35
15
|
requirement: !ruby/object:Gem::Requirement
|
36
16
|
requirements:
|
37
|
-
- - "
|
17
|
+
- - ">="
|
38
18
|
- !ruby/object:Gem::Version
|
39
|
-
version:
|
19
|
+
version: '0'
|
40
20
|
type: :development
|
41
21
|
prerelease: false
|
42
22
|
version_requirements: !ruby/object:Gem::Requirement
|
43
23
|
requirements:
|
44
|
-
- - "
|
24
|
+
- - ">="
|
45
25
|
- !ruby/object:Gem::Version
|
46
|
-
version:
|
26
|
+
version: '0'
|
47
27
|
- !ruby/object:Gem::Dependency
|
48
28
|
name: bundler
|
49
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -64,14 +44,14 @@ dependencies:
|
|
64
44
|
requirements:
|
65
45
|
- - ">="
|
66
46
|
- !ruby/object:Gem::Version
|
67
|
-
version: 0
|
47
|
+
version: '0'
|
68
48
|
type: :development
|
69
49
|
prerelease: false
|
70
50
|
version_requirements: !ruby/object:Gem::Requirement
|
71
51
|
requirements:
|
72
52
|
- - ">="
|
73
53
|
- !ruby/object:Gem::Version
|
74
|
-
version: 0
|
54
|
+
version: '0'
|
75
55
|
- !ruby/object:Gem::Dependency
|
76
56
|
name: rdoc
|
77
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,8 +80,8 @@ extra_rdoc_files:
|
|
100
80
|
- README.md
|
101
81
|
files:
|
102
82
|
- ".document"
|
83
|
+
- ".github/workflows/ci.yml"
|
103
84
|
- ".gitignore"
|
104
|
-
- ".travis.yml"
|
105
85
|
- CHANGELOG.md
|
106
86
|
- Gemfile
|
107
87
|
- LICENSE.txt
|
@@ -132,14 +112,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
132
112
|
requirements:
|
133
113
|
- - ">="
|
134
114
|
- !ruby/object:Gem::Version
|
135
|
-
version:
|
115
|
+
version: 2.7.0
|
136
116
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
137
117
|
requirements:
|
138
118
|
- - ">="
|
139
119
|
- !ruby/object:Gem::Version
|
140
120
|
version: '0'
|
141
121
|
requirements: []
|
142
|
-
rubygems_version: 3.
|
122
|
+
rubygems_version: 3.4.10
|
143
123
|
signing_key:
|
144
124
|
specification_version: 4
|
145
125
|
summary: Domain Name manipulation library for Ruby
|
data/.travis.yml
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
rvm:
|
3
|
-
- 1.8.7
|
4
|
-
- ree
|
5
|
-
- 1.9.3
|
6
|
-
- 2.0.0
|
7
|
-
- 2.1.9
|
8
|
-
- 2.2.5
|
9
|
-
- 2.3.1
|
10
|
-
- ruby-head
|
11
|
-
- jruby-1.7.20
|
12
|
-
- jruby-9.0.5.0
|
13
|
-
- jruby-head
|
14
|
-
- rbx-2
|
15
|
-
matrix:
|
16
|
-
allow_failures:
|
17
|
-
- rvm: ruby-head
|
18
|
-
- rvm: jruby-head
|
19
|
-
- rvm: rbx-2
|
20
|
-
before_install:
|
21
|
-
- gem update bundler
|