public_suffix 2.0.5 → 4.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +5 -5
  2. data/.github/FUNDING.yml +12 -0
  3. data/.github/dependabot.yml +8 -0
  4. data/.github/workflows/release.yml +16 -0
  5. data/.github/workflows/tests.yml +28 -0
  6. data/.gitignore +5 -8
  7. data/.rubocop.yml +19 -1
  8. data/{.rubocop_defaults.yml → .rubocop_opinionated.yml} +62 -34
  9. data/CHANGELOG.md +156 -54
  10. data/Gemfile +9 -5
  11. data/LICENSE.txt +1 -1
  12. data/README.md +44 -15
  13. data/Rakefile +9 -4
  14. data/SECURITY.md +104 -0
  15. data/bin/console +15 -0
  16. data/data/list.txt +3163 -973
  17. data/lib/public_suffix/domain.rb +4 -4
  18. data/lib/public_suffix/errors.rb +3 -1
  19. data/lib/public_suffix/list.rb +78 -117
  20. data/lib/public_suffix/rule.rb +54 -62
  21. data/lib/public_suffix/version.rb +8 -3
  22. data/lib/public_suffix.rb +38 -32
  23. data/public_suffix.gemspec +9 -5
  24. data/test/.empty +2 -0
  25. data/test/acceptance_test.rb +43 -31
  26. data/test/benchmarks/bm_find.rb +66 -0
  27. data/test/benchmarks/bm_find_all.rb +102 -0
  28. data/test/benchmarks/bm_names.rb +91 -0
  29. data/test/benchmarks/bm_select.rb +26 -0
  30. data/test/benchmarks/bm_select_incremental.rb +25 -0
  31. data/test/benchmarks/bm_valid.rb +101 -0
  32. data/test/profilers/domain_profiler.rb +12 -0
  33. data/test/profilers/find_profiler.rb +12 -0
  34. data/test/profilers/find_profiler_jp.rb +12 -0
  35. data/test/{initialization_profiler.rb → profilers/initialization_profiler.rb} +1 -1
  36. data/test/profilers/list_profsize.rb +11 -0
  37. data/test/profilers/object_binsize.rb +57 -0
  38. data/test/psl_test.rb +7 -4
  39. data/test/test_helper.rb +3 -14
  40. data/test/unit/domain_test.rb +17 -15
  41. data/test/unit/errors_test.rb +2 -0
  42. data/test/unit/list_test.rb +54 -72
  43. data/test/unit/public_suffix_test.rb +24 -22
  44. data/test/unit/rule_test.rb +77 -79
  45. metadata +32 -70
  46. data/.ruby-gemset +0 -1
  47. data/.travis.yml +0 -23
  48. data/test/benchmark_helper.rb +0 -4
  49. data/test/execution_profiler.rb +0 -14
  50. data/test/performance_benchmark.rb +0 -38
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "test_helper"
2
4
 
3
5
  class PublicSuffixTest < Minitest::Test
@@ -13,7 +15,7 @@ class PublicSuffixTest < Minitest::Test
13
15
  domain = PublicSuffix.parse("www.example.blogspot.com")
14
16
  assert_equal "com", domain.tld
15
17
  ensure
16
- PublicSuffix::List.clear
18
+ PublicSuffix::List.default = nil
17
19
  end
18
20
 
19
21
 
@@ -22,13 +24,13 @@ class PublicSuffixTest < Minitest::Test
22
24
  assert_instance_of PublicSuffix::Domain, domain
23
25
  assert_equal "com", domain.tld
24
26
  assert_equal "example", domain.sld
25
- assert_equal nil, domain.trd
27
+ assert_nil domain.trd
26
28
 
27
29
  domain = PublicSuffix.parse("example.co.uk")
28
30
  assert_instance_of PublicSuffix::Domain, domain
29
31
  assert_equal "co.uk", domain.tld
30
32
  assert_equal "example", domain.sld
31
- assert_equal nil, domain.trd
33
+ assert_nil domain.trd
32
34
  end
33
35
 
34
36
  def test_self_parse_a_domain_with_tld_and_sld_and_trd
@@ -83,12 +85,12 @@ class PublicSuffixTest < Minitest::Test
83
85
  assert_instance_of PublicSuffix::Domain, domain
84
86
  assert_equal "tldnotlisted", domain.tld
85
87
  assert_equal "example", domain.sld
86
- assert_equal nil, domain.trd
88
+ assert_nil domain.trd
87
89
  end
88
90
 
89
91
  def test_self_parse_with_unallowed_domain
90
- error = assert_raises(PublicSuffix::DomainNotAllowed) { PublicSuffix.parse("example.ke") }
91
- assert_match(/example\.ke/, error.message)
92
+ error = assert_raises(PublicSuffix::DomainNotAllowed) { PublicSuffix.parse("example.bd") }
93
+ assert_match(/example\.bd/, error.message)
92
94
  end
93
95
 
94
96
  def test_self_parse_with_uri
@@ -128,7 +130,7 @@ class PublicSuffixTest < Minitest::Test
128
130
  end
129
131
 
130
132
  def test_self_domain_with_unallowed_name
131
- assert_nil PublicSuffix.domain("example.ke")
133
+ assert_nil PublicSuffix.domain("example.bd")
132
134
  end
133
135
 
134
136
  def test_self_domain_with_blank_sld
@@ -139,13 +141,13 @@ class PublicSuffixTest < Minitest::Test
139
141
 
140
142
  def test_self_normalize
141
143
  [
142
- ["com", "com"],
143
- ["example.com", "example.com"],
144
- ["www.example.com", "www.example.com"],
144
+ ["com", "com"],
145
+ ["example.com", "example.com"],
146
+ ["www.example.com", "www.example.com"],
145
147
 
146
- ["example.com.", "example.com"], # strip FQDN
147
- [" example.com ", "example.com"], # strip spaces
148
- ["Example.COM", "example.com"], # downcase
148
+ ["example.com.", "example.com"], # strip FQDN
149
+ [" example.com ", "example.com"], # strip spaces
150
+ ["Example.COM", "example.com"], # downcase
149
151
  ].each do |input, output|
150
152
  assert_equal output, PublicSuffix.normalize(input)
151
153
  end
@@ -153,10 +155,10 @@ class PublicSuffixTest < Minitest::Test
153
155
 
154
156
  def test_normalize_blank
155
157
  [
156
- nil,
157
- "",
158
- " ",
159
- ].each do |input, _|
158
+ nil,
159
+ "",
160
+ " ",
161
+ ].each do |input|
160
162
  error = PublicSuffix.normalize(input)
161
163
  assert_instance_of PublicSuffix::DomainInvalid, error
162
164
  assert_equal "Name is blank", error.message
@@ -165,18 +167,18 @@ class PublicSuffixTest < Minitest::Test
165
167
 
166
168
  def test_normalize_scheme
167
169
  [
168
- "https://google.com",
169
- ].each do |input, _|
170
+ "https://google.com",
171
+ ].each do |input|
170
172
  error = PublicSuffix.normalize(input)
171
173
  assert_instance_of PublicSuffix::DomainInvalid, error
172
- assert_match /scheme/, error.message
174
+ assert_match(/scheme/, error.message)
173
175
  end
174
176
  end
175
177
 
176
178
  def test_normalize_leading_dot
177
179
  [
178
- ".google.com",
179
- ].each do |input, _|
180
+ ".google.com",
181
+ ].each do |input|
180
182
  error = PublicSuffix.normalize(input)
181
183
  assert_instance_of PublicSuffix::DomainInvalid, error
182
184
  assert_match "Name starts with a dot", error.message
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "test_helper"
2
4
 
3
5
  class PublicSuffix::RuleTest < Minitest::Test
@@ -26,7 +28,7 @@ class PublicSuffix::RuleTest < Minitest::Test
26
28
 
27
29
  def test_default_returns_default_wildcard
28
30
  default = PublicSuffix::Rule.default
29
- assert_equal PublicSuffix::Rule::Wildcard.new("*"), default
31
+ assert_equal PublicSuffix::Rule::Wildcard.build("*"), default
30
32
  assert_equal %w( example tldnotlisted ), default.decompose("example.tldnotlisted")
31
33
  assert_equal %w( www.example tldnotlisted ), default.decompose("www.example.tldnotlisted")
32
34
  end
@@ -45,59 +47,59 @@ class PublicSuffix::RuleBaseTest < Minitest::Test
45
47
 
46
48
 
47
49
  def test_initialize
48
- rule = @klass.new("verona.it")
49
- assert_instance_of @klass, rule
50
- assert_equal "verona.it", rule.value
50
+ rule = @klass.new(value: "verona.it")
51
+ assert_instance_of @klass, rule
52
+ assert_equal "verona.it", rule.value
51
53
  end
52
54
 
53
55
 
54
56
  def test_equality_with_self
55
- rule = PublicSuffix::Rule::Base.new("foo")
57
+ rule = PublicSuffix::Rule::Base.new(value: "foo")
56
58
  assert_equal rule, rule
57
59
  end
58
60
 
59
61
  # rubocop:disable Style/SingleLineMethods
60
62
  def test_equality_with_internals
61
- assert_equal @klass.new("foo"), @klass.new("foo")
62
- assert_not_equal @klass.new("foo"), @klass.new("bar")
63
- assert_not_equal @klass.new("foo"), PublicSuffix::Rule::Test.new("foo")
64
- assert_not_equal @klass.new("foo"), PublicSuffix::Rule::Test.new("bar")
65
- assert_not_equal @klass.new("foo"), Class.new { def name; foo; end }.new
63
+ assert_equal @klass.new(value: "foo"), @klass.new(value: "foo")
64
+ refute_equal @klass.new(value: "foo"), @klass.new(value: "bar")
65
+ refute_equal @klass.new(value: "foo"), PublicSuffix::Rule::Test.new(value: "foo")
66
+ refute_equal @klass.new(value: "foo"), PublicSuffix::Rule::Test.new(value: "bar")
67
+ refute_equal @klass.new(value: "foo"), Class.new { def name; foo; end }.new
66
68
  end
67
69
  # rubocop:enable Style/SingleLineMethods
68
70
 
69
71
  def test_match
70
72
  [
71
- # standard match
72
- [PublicSuffix::Rule.factory("uk"), "uk", true],
73
- [PublicSuffix::Rule.factory("uk"), "example.uk", true],
74
- [PublicSuffix::Rule.factory("uk"), "example.co.uk", true],
75
- [PublicSuffix::Rule.factory("co.uk"), "example.co.uk", true],
76
-
77
- # FIXME
78
- # [PublicSuffix::Rule.factory("*.com"), "com", false],
79
- [PublicSuffix::Rule.factory("*.com"), "example.com", true],
80
- [PublicSuffix::Rule.factory("*.com"), "foo.example.com", true],
81
- [PublicSuffix::Rule.factory("!example.com"), "com", false],
82
- [PublicSuffix::Rule.factory("!example.com"), "example.com", true],
83
- [PublicSuffix::Rule.factory("!example.com"), "foo.example.com", true],
84
-
85
- # TLD mismatch
86
- [PublicSuffix::Rule.factory("gk"), "example.uk", false],
87
- [PublicSuffix::Rule.factory("gk"), "example.co.uk", false],
88
- [PublicSuffix::Rule.factory("co.uk"), "uk", false],
89
-
90
- # general mismatch
91
- [PublicSuffix::Rule.factory("uk.co"), "example.co.uk", false],
92
- [PublicSuffix::Rule.factory("go.uk"), "example.co.uk", false],
93
- [PublicSuffix::Rule.factory("co.uk"), "uk", false],
94
-
95
- # partial matches/mismatches
96
- [PublicSuffix::Rule.factory("co"), "example.co.uk", false],
97
- [PublicSuffix::Rule.factory("example"), "example.uk", false],
98
- [PublicSuffix::Rule.factory("le.it"), "example.it", false],
99
- [PublicSuffix::Rule.factory("le.it"), "le.it", true],
100
- [PublicSuffix::Rule.factory("le.it"), "foo.le.it", true],
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)
@@ -105,16 +107,12 @@ class PublicSuffix::RuleBaseTest < Minitest::Test
105
107
  end
106
108
 
107
109
 
108
- def test_length
109
- assert_raises(NotImplementedError) { @klass.new("com").length }
110
- end
111
-
112
110
  def test_parts
113
- assert_raises(NotImplementedError) { @klass.new("com").parts }
111
+ assert_raises(NotImplementedError) { @klass.new(value: "com").parts }
114
112
  end
115
113
 
116
114
  def test_decompose
117
- assert_raises(NotImplementedError) { @klass.new("com").decompose("google.com") }
115
+ assert_raises(NotImplementedError) { @klass.new(value: "com").decompose("google.com") }
118
116
  end
119
117
 
120
118
  end
@@ -127,8 +125,8 @@ class PublicSuffix::RuleNormalTest < Minitest::Test
127
125
  end
128
126
 
129
127
 
130
- def test_initialize
131
- rule = @klass.new("verona.it")
128
+ def test_build
129
+ rule = @klass.build("verona.it")
132
130
  assert_instance_of @klass, rule
133
131
  assert_equal "verona.it", rule.value
134
132
  assert_equal "verona.it", rule.rule
@@ -136,21 +134,21 @@ class PublicSuffix::RuleNormalTest < Minitest::Test
136
134
 
137
135
 
138
136
  def test_length
139
- assert_equal 1, @klass.new("com").length
140
- assert_equal 2, @klass.new("co.com").length
141
- assert_equal 3, @klass.new("mx.co.com").length
137
+ assert_equal 1, @klass.build("com").length
138
+ assert_equal 2, @klass.build("co.com").length
139
+ assert_equal 3, @klass.build("mx.co.com").length
142
140
  end
143
141
 
144
142
  def test_parts
145
- assert_equal %w(com), @klass.new("com").parts
146
- assert_equal %w(co com), @klass.new("co.com").parts
147
- assert_equal %w(mx co com), @klass.new("mx.co.com").parts
143
+ assert_equal %w(com), @klass.build("com").parts
144
+ assert_equal %w(co com), @klass.build("co.com").parts
145
+ assert_equal %w(mx co com), @klass.build("mx.co.com").parts
148
146
  end
149
147
 
150
148
  def test_decompose
151
- assert_equal [nil, nil], @klass.new("com").decompose("com")
152
- assert_equal %w( example com ), @klass.new("com").decompose("example.com")
153
- assert_equal %w( foo.example com ), @klass.new("com").decompose("foo.example.com")
149
+ assert_equal [nil, nil], @klass.build("com").decompose("com")
150
+ assert_equal %w( example com ), @klass.build("com").decompose("example.com")
151
+ assert_equal %w( foo.example com ), @klass.build("com").decompose("foo.example.com")
154
152
  end
155
153
 
156
154
  end
@@ -164,27 +162,27 @@ class PublicSuffix::RuleExceptionTest < Minitest::Test
164
162
 
165
163
 
166
164
  def test_initialize
167
- rule = @klass.new("!british-library.uk")
168
- assert_instance_of @klass, rule
169
- assert_equal "british-library.uk", rule.value
170
- assert_equal "!british-library.uk", rule.rule
165
+ rule = @klass.build("!british-library.uk")
166
+ assert_instance_of @klass, rule
167
+ assert_equal "british-library.uk", rule.value
168
+ assert_equal "!british-library.uk", rule.rule
171
169
  end
172
170
 
173
171
 
174
172
  def test_length
175
- assert_equal 1, @klass.new("!british-library.uk").length
176
- assert_equal 2, @klass.new("!foo.british-library.uk").length
173
+ assert_equal 2, @klass.build("!british-library.uk").length
174
+ assert_equal 3, @klass.build("!foo.british-library.uk").length
177
175
  end
178
176
 
179
177
  def test_parts
180
- assert_equal %w( uk ), @klass.new("!british-library.uk").parts
181
- assert_equal %w( tokyo jp ), @klass.new("!metro.tokyo.jp").parts
178
+ assert_equal %w( uk ), @klass.build("!british-library.uk").parts
179
+ assert_equal %w( tokyo jp ), @klass.build("!metro.tokyo.jp").parts
182
180
  end
183
181
 
184
182
  def test_decompose
185
- assert_equal [nil, nil], @klass.new("!british-library.uk").decompose("uk")
186
- assert_equal %w( british-library uk ), @klass.new("!british-library.uk").decompose("british-library.uk")
187
- assert_equal %w( foo.british-library uk ), @klass.new("!british-library.uk").decompose("foo.british-library.uk")
183
+ assert_equal [nil, nil], @klass.build("!british-library.uk").decompose("uk")
184
+ assert_equal %w( british-library uk ), @klass.build("!british-library.uk").decompose("british-library.uk")
185
+ assert_equal %w( foo.british-library uk ), @klass.build("!british-library.uk").decompose("foo.british-library.uk")
188
186
  end
189
187
 
190
188
  end
@@ -198,27 +196,27 @@ class PublicSuffix::RuleWildcardTest < Minitest::Test
198
196
 
199
197
 
200
198
  def test_initialize
201
- rule = @klass.new("*.aichi.jp")
202
- assert_instance_of @klass, rule
203
- assert_equal "aichi.jp", rule.value
204
- assert_equal "*.aichi.jp", rule.rule
199
+ rule = @klass.build("*.aichi.jp")
200
+ assert_instance_of @klass, rule
201
+ assert_equal "aichi.jp", rule.value
202
+ assert_equal "*.aichi.jp", rule.rule
205
203
  end
206
204
 
207
205
 
208
206
  def test_length
209
- assert_equal 2, @klass.new("*.uk").length
210
- assert_equal 3, @klass.new("*.co.uk").length
207
+ assert_equal 2, @klass.build("*.uk").length
208
+ assert_equal 3, @klass.build("*.co.uk").length
211
209
  end
212
210
 
213
211
  def test_parts
214
- assert_equal %w( uk ), @klass.new("*.uk").parts
215
- assert_equal %w( co uk ), @klass.new("*.co.uk").parts
212
+ assert_equal %w( uk ), @klass.build("*.uk").parts
213
+ assert_equal %w( co uk ), @klass.build("*.co.uk").parts
216
214
  end
217
215
 
218
216
  def test_decompose
219
- assert_equal [nil, nil], @klass.new("*.do").decompose("nic.do")
220
- assert_equal %w( google co.uk ), @klass.new("*.uk").decompose("google.co.uk")
221
- assert_equal %w( foo.google co.uk ), @klass.new("*.uk").decompose("foo.google.co.uk")
217
+ assert_equal [nil, nil], @klass.build("*.do").decompose("nic.do")
218
+ assert_equal %w( google co.uk ), @klass.build("*.uk").decompose("google.co.uk")
219
+ assert_equal %w( foo.google co.uk ), @klass.build("*.uk").decompose("foo.google.co.uk")
222
220
  end
223
221
 
224
222
  end
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: 2.0.5
4
+ version: 4.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simone Carletti
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-02 00:00:00.000000000 Z
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: 2022-04-12 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,11 +19,13 @@ extensions: []
61
19
  extra_rdoc_files:
62
20
  - LICENSE.txt
63
21
  files:
22
+ - ".github/FUNDING.yml"
23
+ - ".github/dependabot.yml"
24
+ - ".github/workflows/release.yml"
25
+ - ".github/workflows/tests.yml"
64
26
  - ".gitignore"
65
27
  - ".rubocop.yml"
66
- - ".rubocop_defaults.yml"
67
- - ".ruby-gemset"
68
- - ".travis.yml"
28
+ - ".rubocop_opinionated.yml"
69
29
  - ".yardopts"
70
30
  - 2.0-Upgrade.md
71
31
  - CHANGELOG.md
@@ -73,6 +33,8 @@ files:
73
33
  - LICENSE.txt
74
34
  - README.md
75
35
  - Rakefile
36
+ - SECURITY.md
37
+ - bin/console
76
38
  - data/list.txt
77
39
  - lib/public_suffix.rb
78
40
  - lib/public_suffix/domain.rb
@@ -81,11 +43,20 @@ files:
81
43
  - lib/public_suffix/rule.rb
82
44
  - lib/public_suffix/version.rb
83
45
  - public_suffix.gemspec
46
+ - test/.empty
84
47
  - test/acceptance_test.rb
85
- - test/benchmark_helper.rb
86
- - test/execution_profiler.rb
87
- - test/initialization_profiler.rb
88
- - test/performance_benchmark.rb
48
+ - test/benchmarks/bm_find.rb
49
+ - test/benchmarks/bm_find_all.rb
50
+ - test/benchmarks/bm_names.rb
51
+ - test/benchmarks/bm_select.rb
52
+ - test/benchmarks/bm_select_incremental.rb
53
+ - test/benchmarks/bm_valid.rb
54
+ - test/profilers/domain_profiler.rb
55
+ - test/profilers/find_profiler.rb
56
+ - test/profilers/find_profiler_jp.rb
57
+ - test/profilers/initialization_profiler.rb
58
+ - test/profilers/list_profsize.rb
59
+ - test/profilers/object_binsize.rb
89
60
  - test/psl_test.rb
90
61
  - test/test_helper.rb
91
62
  - test/tests.txt
@@ -97,7 +68,12 @@ files:
97
68
  homepage: https://simonecarletti.com/code/publicsuffix-ruby
98
69
  licenses:
99
70
  - MIT
100
- 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.7
75
+ homepage_uri: https://simonecarletti.com/code/publicsuffix-ruby
76
+ source_code_uri: https://github.com/weppos/publicsuffix-ruby/tree/v4.0.7
101
77
  post_install_message:
102
78
  rdoc_options: []
103
79
  require_paths:
@@ -106,29 +82,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
106
82
  requirements:
107
83
  - - ">="
108
84
  - !ruby/object:Gem::Version
109
- version: '2.0'
85
+ version: '2.3'
110
86
  required_rubygems_version: !ruby/object:Gem::Requirement
111
87
  requirements:
112
88
  - - ">="
113
89
  - !ruby/object:Gem::Version
114
90
  version: '0'
115
91
  requirements: []
116
- rubyforge_project:
117
- rubygems_version: 2.5.2
92
+ rubygems_version: 3.3.7
118
93
  signing_key:
119
94
  specification_version: 4
120
95
  summary: Domain name parser based on the Public Suffix List.
121
- test_files:
122
- - test/acceptance_test.rb
123
- - test/benchmark_helper.rb
124
- - test/execution_profiler.rb
125
- - test/initialization_profiler.rb
126
- - test/performance_benchmark.rb
127
- - test/psl_test.rb
128
- - test/test_helper.rb
129
- - test/tests.txt
130
- - test/unit/domain_test.rb
131
- - test/unit/errors_test.rb
132
- - test/unit/list_test.rb
133
- - test/unit/public_suffix_test.rb
134
- - test/unit/rule_test.rb
96
+ test_files: []
data/.ruby-gemset DELETED
@@ -1 +0,0 @@
1
- publicsuffix
data/.travis.yml DELETED
@@ -1,23 +0,0 @@
1
- language: ruby
2
-
3
- rvm:
4
- - 2.0
5
- - 2.1
6
- - 2.2
7
- - 2.3.0
8
- - jruby-9.0.5.0
9
- - ruby-head
10
-
11
- before_install:
12
- - gem install bundler
13
-
14
- cache:
15
- - bundler
16
-
17
- env:
18
- - COVERALL=1
19
-
20
- matrix:
21
- allow_failures:
22
- - rvm: ruby-head
23
- - rvm: jruby-9.0.5.0
@@ -1,4 +0,0 @@
1
- require "benchmark"
2
-
3
- $LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
4
- require "public_suffix"
@@ -1,14 +0,0 @@
1
- $LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
2
-
3
- require "memory_profiler"
4
- require "public_suffix"
5
-
6
- PublicSuffix::List.default
7
-
8
- report = MemoryProfiler.report do
9
- PublicSuffix.domain("www.example.com")
10
- PublicSuffix.domain("a.b.ide.kyoto.jp")
11
- end
12
-
13
- report.pretty_print
14
- # report.pretty_print(to_file: 'profiler-%s-%d.txt' % [ARGV[0], Time.now.to_i])
@@ -1,38 +0,0 @@
1
- require_relative "benchmark_helper"
2
-
3
- iterations = 100_000
4
-
5
- # force load
6
- list = PublicSuffix::List.default
7
-
8
- Benchmark.bmbm do |bm|
9
- bm.report "Top level TLD" do
10
- iterations.times do
11
- PublicSuffix.domain("example.com", list)
12
- end
13
- end
14
-
15
- bm.report "Top level TLD (subdomain)" do
16
- iterations.times do
17
- PublicSuffix.domain("www.example.com", list)
18
- end
19
- end
20
-
21
- bm.report "Unlisted TLD" do
22
- iterations.times do
23
- PublicSuffix.domain("example.example", list)
24
- end
25
- end
26
-
27
- bm.report "Unlisted TLD (subdomain)" do
28
- iterations.times do
29
- PublicSuffix.domain("www.example.example", list)
30
- end
31
- end
32
-
33
- bm.report "Crazy suffix" do
34
- iterations.times do
35
- PublicSuffix.domain("a.b.ide.kyoto.jp", list)
36
- end
37
- end
38
- end