public_suffix 3.0.3 → 4.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/FUNDING.yml +12 -0
- data/.github/workflows/tests.yml +36 -0
- data/.gitignore +5 -8
- data/.rubocop.yml +2 -2
- data/{.rubocop_defaults.yml → .rubocop_opinionated.yml} +12 -39
- data/.travis.yml +5 -7
- data/CHANGELOG.md +116 -50
- data/Gemfile +9 -4
- data/LICENSE.txt +1 -1
- data/README.md +20 -15
- data/Rakefile +3 -1
- data/SECURITY.md +104 -0
- data/bin/console +1 -0
- data/codecov.yml +12 -0
- data/data/list.txt +1097 -376
- data/lib/public_suffix.rb +8 -4
- data/lib/public_suffix/domain.rb +4 -2
- data/lib/public_suffix/errors.rb +3 -1
- data/lib/public_suffix/list.rb +12 -8
- data/lib/public_suffix/rule.rb +4 -2
- data/lib/public_suffix/version.rb +5 -2
- data/public_suffix.gemspec +9 -5
- data/test/acceptance_test.rb +33 -29
- data/test/psl_test.rb +4 -1
- data/test/test_helper.rb +9 -4
- data/test/unit/domain_test.rb +2 -0
- data/test/unit/errors_test.rb +2 -0
- data/test/unit/list_test.rb +2 -0
- data/test/unit/public_suffix_test.rb +13 -11
- data/test/unit/rule_test.rb +32 -30
- metadata +16 -51
- data/.ruby-gemset +0 -1
data/test/unit/rule_test.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "test_helper"
|
2
4
|
|
3
5
|
class PublicSuffix::RuleTest < Minitest::Test
|
@@ -68,36 +70,36 @@ class PublicSuffix::RuleBaseTest < Minitest::Test
|
|
68
70
|
|
69
71
|
def test_match
|
70
72
|
[
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
73
|
+
# standard match
|
74
|
+
[PublicSuffix::Rule.factory("uk"), "uk", true],
|
75
|
+
[PublicSuffix::Rule.factory("uk"), "example.uk", true],
|
76
|
+
[PublicSuffix::Rule.factory("uk"), "example.co.uk", true],
|
77
|
+
[PublicSuffix::Rule.factory("co.uk"), "example.co.uk", true],
|
78
|
+
|
79
|
+
# FIXME
|
80
|
+
# [PublicSuffix::Rule.factory("*.com"), "com", false],
|
81
|
+
[PublicSuffix::Rule.factory("*.com"), "example.com", true],
|
82
|
+
[PublicSuffix::Rule.factory("*.com"), "foo.example.com", true],
|
83
|
+
[PublicSuffix::Rule.factory("!example.com"), "com", false],
|
84
|
+
[PublicSuffix::Rule.factory("!example.com"), "example.com", true],
|
85
|
+
[PublicSuffix::Rule.factory("!example.com"), "foo.example.com", true],
|
86
|
+
|
87
|
+
# TLD mismatch
|
88
|
+
[PublicSuffix::Rule.factory("gk"), "example.uk", false],
|
89
|
+
[PublicSuffix::Rule.factory("gk"), "example.co.uk", false],
|
90
|
+
[PublicSuffix::Rule.factory("co.uk"), "uk", false],
|
91
|
+
|
92
|
+
# general mismatch
|
93
|
+
[PublicSuffix::Rule.factory("uk.co"), "example.co.uk", false],
|
94
|
+
[PublicSuffix::Rule.factory("go.uk"), "example.co.uk", false],
|
95
|
+
[PublicSuffix::Rule.factory("co.uk"), "uk", false],
|
96
|
+
|
97
|
+
# partial matches/mismatches
|
98
|
+
[PublicSuffix::Rule.factory("co"), "example.co.uk", false],
|
99
|
+
[PublicSuffix::Rule.factory("example"), "example.uk", false],
|
100
|
+
[PublicSuffix::Rule.factory("le.it"), "example.it", false],
|
101
|
+
[PublicSuffix::Rule.factory("le.it"), "le.it", true],
|
102
|
+
[PublicSuffix::Rule.factory("le.it"), "foo.le.it", true],
|
101
103
|
|
102
104
|
].each do |rule, input, expected|
|
103
105
|
assert_equal expected, rule.match?(input)
|
metadata
CHANGED
@@ -1,57 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: public_suffix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simone Carletti
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
12
|
-
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: rake
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: mocha
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: yard
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
11
|
+
date: 2020-09-02 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
55
13
|
description: PublicSuffix can parse and decompose a domain name into top level domain,
|
56
14
|
domain and subdomains.
|
57
15
|
email:
|
@@ -61,10 +19,11 @@ extensions: []
|
|
61
19
|
extra_rdoc_files:
|
62
20
|
- LICENSE.txt
|
63
21
|
files:
|
22
|
+
- ".github/FUNDING.yml"
|
23
|
+
- ".github/workflows/tests.yml"
|
64
24
|
- ".gitignore"
|
65
25
|
- ".rubocop.yml"
|
66
|
-
- ".
|
67
|
-
- ".ruby-gemset"
|
26
|
+
- ".rubocop_opinionated.yml"
|
68
27
|
- ".travis.yml"
|
69
28
|
- ".yardopts"
|
70
29
|
- 2.0-Upgrade.md
|
@@ -73,7 +32,9 @@ files:
|
|
73
32
|
- LICENSE.txt
|
74
33
|
- README.md
|
75
34
|
- Rakefile
|
35
|
+
- SECURITY.md
|
76
36
|
- bin/console
|
37
|
+
- codecov.yml
|
77
38
|
- data/list.txt
|
78
39
|
- lib/public_suffix.rb
|
79
40
|
- lib/public_suffix/domain.rb
|
@@ -107,7 +68,12 @@ files:
|
|
107
68
|
homepage: https://simonecarletti.com/code/publicsuffix-ruby
|
108
69
|
licenses:
|
109
70
|
- MIT
|
110
|
-
metadata:
|
71
|
+
metadata:
|
72
|
+
bug_tracker_uri: https://github.com/weppos/publicsuffix-ruby/issues
|
73
|
+
changelog_uri: https://github.com/weppos/publicsuffix-ruby/blob/master/CHANGELOG.md
|
74
|
+
documentation_uri: https://rubydoc.info/gems/public_suffix/4.0.6
|
75
|
+
homepage_uri: https://simonecarletti.com/code/publicsuffix-ruby
|
76
|
+
source_code_uri: https://github.com/weppos/publicsuffix-ruby/tree/v4.0.6
|
111
77
|
post_install_message:
|
112
78
|
rdoc_options: []
|
113
79
|
require_paths:
|
@@ -116,15 +82,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
116
82
|
requirements:
|
117
83
|
- - ">="
|
118
84
|
- !ruby/object:Gem::Version
|
119
|
-
version: '2.
|
85
|
+
version: '2.3'
|
120
86
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
121
87
|
requirements:
|
122
88
|
- - ">="
|
123
89
|
- !ruby/object:Gem::Version
|
124
90
|
version: '0'
|
125
91
|
requirements: []
|
126
|
-
|
127
|
-
rubygems_version: 2.7.3
|
92
|
+
rubygems_version: 3.1.2
|
128
93
|
signing_key:
|
129
94
|
specification_version: 4
|
130
95
|
summary: Domain name parser based on the Public Suffix List.
|
data/.ruby-gemset
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
publicsuffix
|