public_suffix 4.0.7 → 5.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +45 -0
- data/LICENSE.txt +1 -1
- data/README.md +10 -3
- data/SECURITY.md +2 -81
- data/data/list.txt +3635 -1973
- data/lib/public_suffix/domain.rb +1 -1
- data/lib/public_suffix/errors.rb +1 -1
- data/lib/public_suffix/list.rb +2 -2
- data/lib/public_suffix/rule.rb +7 -7
- data/lib/public_suffix/version.rb +3 -4
- data/lib/public_suffix.rb +2 -2
- metadata +9 -42
- data/.github/FUNDING.yml +0 -12
- data/.github/dependabot.yml +0 -8
- data/.github/workflows/release.yml +0 -16
- data/.github/workflows/tests.yml +0 -28
- data/.gitignore +0 -8
- data/.rubocop.yml +0 -36
- data/.rubocop_opinionated.yml +0 -163
- data/Gemfile +0 -14
- data/Rakefile +0 -52
- data/bin/console +0 -15
- data/public_suffix.gemspec +0 -29
- data/test/.empty +0 -2
- data/test/acceptance_test.rb +0 -131
- data/test/benchmarks/bm_find.rb +0 -66
- data/test/benchmarks/bm_find_all.rb +0 -102
- data/test/benchmarks/bm_names.rb +0 -91
- data/test/benchmarks/bm_select.rb +0 -26
- data/test/benchmarks/bm_select_incremental.rb +0 -25
- data/test/benchmarks/bm_valid.rb +0 -101
- data/test/profilers/domain_profiler.rb +0 -12
- data/test/profilers/find_profiler.rb +0 -12
- data/test/profilers/find_profiler_jp.rb +0 -12
- data/test/profilers/initialization_profiler.rb +0 -11
- data/test/profilers/list_profsize.rb +0 -11
- data/test/profilers/object_binsize.rb +0 -57
- data/test/psl_test.rb +0 -52
- data/test/test_helper.rb +0 -10
- data/test/tests.txt +0 -98
- data/test/unit/domain_test.rb +0 -106
- data/test/unit/errors_test.rb +0 -25
- data/test/unit/list_test.rb +0 -241
- data/test/unit/public_suffix_test.rb +0 -188
- data/test/unit/rule_test.rb +0 -222
data/lib/public_suffix/domain.rb
CHANGED
data/lib/public_suffix/errors.rb
CHANGED
data/lib/public_suffix/list.rb
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
#
|
5
5
|
# Domain name parser based on the Public Suffix List.
|
6
6
|
#
|
7
|
-
# Copyright (c) 2009-
|
7
|
+
# Copyright (c) 2009-2024 Simone Carletti <weppos@weppos.net>
|
8
8
|
|
9
9
|
module PublicSuffix
|
10
10
|
|
@@ -87,7 +87,7 @@ module PublicSuffix
|
|
87
87
|
section = 2
|
88
88
|
|
89
89
|
# skip comments
|
90
|
-
when line.start_with?(comment_token)
|
90
|
+
when line.start_with?(comment_token) # rubocop:disable Lint/DuplicateBranch
|
91
91
|
next
|
92
92
|
|
93
93
|
else
|
data/lib/public_suffix/rule.rb
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
#
|
5
5
|
# Domain name parser based on the Public Suffix List.
|
6
6
|
#
|
7
|
-
# Copyright (c) 2009-
|
7
|
+
# Copyright (c) 2009-2024 Simone Carletti <weppos@weppos.net>
|
8
8
|
|
9
9
|
module PublicSuffix
|
10
10
|
|
@@ -125,7 +125,7 @@ module PublicSuffix
|
|
125
125
|
# @param private [Boolean]
|
126
126
|
def initialize(value:, length: nil, private: false)
|
127
127
|
@value = value.to_s
|
128
|
-
@length = length || @value.count(DOT) + 1
|
128
|
+
@length = length || (@value.count(DOT) + 1)
|
129
129
|
@private = private
|
130
130
|
end
|
131
131
|
|
@@ -161,7 +161,7 @@ module PublicSuffix
|
|
161
161
|
# @param name [String] the domain name to check
|
162
162
|
# @return [Boolean]
|
163
163
|
def match?(name)
|
164
|
-
#
|
164
|
+
# NOTE: it works because of the assumption there are no
|
165
165
|
# rules like foo.*.com. If the assumption is incorrect,
|
166
166
|
# we need to properly walk the input and skip parts according
|
167
167
|
# to wildcard component.
|
@@ -221,7 +221,7 @@ module PublicSuffix
|
|
221
221
|
# @param content [String] the content of the rule
|
222
222
|
# @param private [Boolean]
|
223
223
|
def self.build(content, private: false)
|
224
|
-
new(value: content.to_s[2
|
224
|
+
new(value: content.to_s[2..], private: private)
|
225
225
|
end
|
226
226
|
|
227
227
|
# Initializes a new rule.
|
@@ -230,7 +230,7 @@ module PublicSuffix
|
|
230
230
|
# @param length [Integer]
|
231
231
|
# @param private [Boolean]
|
232
232
|
def initialize(value:, length: nil, private: false)
|
233
|
-
super
|
233
|
+
super
|
234
234
|
length or @length += 1 # * counts as 1
|
235
235
|
end
|
236
236
|
|
@@ -269,7 +269,7 @@ module PublicSuffix
|
|
269
269
|
# @param content [#to_s] the content of the rule
|
270
270
|
# @param private [Boolean]
|
271
271
|
def self.build(content, private: false)
|
272
|
-
new(value: content.to_s[1
|
272
|
+
new(value: content.to_s[1..], private: private)
|
273
273
|
end
|
274
274
|
|
275
275
|
# Gets the original rule definition.
|
@@ -299,7 +299,7 @@ module PublicSuffix
|
|
299
299
|
#
|
300
300
|
# @return [Array<String>]
|
301
301
|
def parts
|
302
|
-
@value.split(DOT)[1
|
302
|
+
@value.split(DOT)[1..]
|
303
303
|
end
|
304
304
|
|
305
305
|
end
|
@@ -1,15 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
#
|
4
3
|
# = Public Suffix
|
5
4
|
#
|
6
5
|
# Domain name parser based on the Public Suffix List.
|
7
6
|
#
|
8
|
-
# Copyright (c) 2009-
|
7
|
+
# Copyright (c) 2009-2024 Simone Carletti <weppos@weppos.net>
|
9
8
|
|
10
9
|
module PublicSuffix
|
11
10
|
|
12
|
-
# @return [String]
|
13
|
-
VERSION = "
|
11
|
+
# @return [String] the current library version
|
12
|
+
VERSION = "5.1.1"
|
14
13
|
|
15
14
|
end
|
data/lib/public_suffix.rb
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
#
|
5
5
|
# Domain name parser based on the Public Suffix List.
|
6
6
|
#
|
7
|
-
# Copyright (c) 2009-
|
7
|
+
# Copyright (c) 2009-2024 Simone Carletti <weppos@weppos.net>
|
8
8
|
|
9
9
|
require_relative "public_suffix/domain"
|
10
10
|
require_relative "public_suffix/version"
|
@@ -169,7 +169,7 @@ module PublicSuffix
|
|
169
169
|
|
170
170
|
return DomainInvalid.new("Name is blank") if name.empty?
|
171
171
|
return DomainInvalid.new("Name starts with a dot") if name.start_with?(DOT)
|
172
|
-
return DomainInvalid.new("%s is not expected to contain a scheme"
|
172
|
+
return DomainInvalid.new(format("%s is not expected to contain a scheme", name)) if name.include?("://")
|
173
173
|
|
174
174
|
name
|
175
175
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: public_suffix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 5.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simone Carletti
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: PublicSuffix can parse and decompose a domain name into top level domain,
|
14
14
|
domain and subdomains.
|
@@ -19,22 +19,12 @@ extensions: []
|
|
19
19
|
extra_rdoc_files:
|
20
20
|
- LICENSE.txt
|
21
21
|
files:
|
22
|
-
- ".github/FUNDING.yml"
|
23
|
-
- ".github/dependabot.yml"
|
24
|
-
- ".github/workflows/release.yml"
|
25
|
-
- ".github/workflows/tests.yml"
|
26
|
-
- ".gitignore"
|
27
|
-
- ".rubocop.yml"
|
28
|
-
- ".rubocop_opinionated.yml"
|
29
22
|
- ".yardopts"
|
30
23
|
- 2.0-Upgrade.md
|
31
24
|
- CHANGELOG.md
|
32
|
-
- Gemfile
|
33
25
|
- LICENSE.txt
|
34
26
|
- README.md
|
35
|
-
- Rakefile
|
36
27
|
- SECURITY.md
|
37
|
-
- bin/console
|
38
28
|
- data/list.txt
|
39
29
|
- lib/public_suffix.rb
|
40
30
|
- lib/public_suffix/domain.rb
|
@@ -42,39 +32,16 @@ files:
|
|
42
32
|
- lib/public_suffix/list.rb
|
43
33
|
- lib/public_suffix/rule.rb
|
44
34
|
- lib/public_suffix/version.rb
|
45
|
-
- public_suffix.gemspec
|
46
|
-
- test/.empty
|
47
|
-
- test/acceptance_test.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
|
60
|
-
- test/psl_test.rb
|
61
|
-
- test/test_helper.rb
|
62
|
-
- test/tests.txt
|
63
|
-
- test/unit/domain_test.rb
|
64
|
-
- test/unit/errors_test.rb
|
65
|
-
- test/unit/list_test.rb
|
66
|
-
- test/unit/public_suffix_test.rb
|
67
|
-
- test/unit/rule_test.rb
|
68
35
|
homepage: https://simonecarletti.com/code/publicsuffix-ruby
|
69
36
|
licenses:
|
70
37
|
- MIT
|
71
38
|
metadata:
|
72
39
|
bug_tracker_uri: https://github.com/weppos/publicsuffix-ruby/issues
|
73
40
|
changelog_uri: https://github.com/weppos/publicsuffix-ruby/blob/master/CHANGELOG.md
|
74
|
-
documentation_uri: https://rubydoc.info/gems/public_suffix/
|
41
|
+
documentation_uri: https://rubydoc.info/gems/public_suffix/5.1.1
|
75
42
|
homepage_uri: https://simonecarletti.com/code/publicsuffix-ruby
|
76
|
-
source_code_uri: https://github.com/weppos/publicsuffix-ruby/tree/
|
77
|
-
post_install_message:
|
43
|
+
source_code_uri: https://github.com/weppos/publicsuffix-ruby/tree/v5.1.1
|
44
|
+
post_install_message:
|
78
45
|
rdoc_options: []
|
79
46
|
require_paths:
|
80
47
|
- lib
|
@@ -82,15 +49,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
82
49
|
requirements:
|
83
50
|
- - ">="
|
84
51
|
- !ruby/object:Gem::Version
|
85
|
-
version: '2.
|
52
|
+
version: '2.6'
|
86
53
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
87
54
|
requirements:
|
88
55
|
- - ">="
|
89
56
|
- !ruby/object:Gem::Version
|
90
57
|
version: '0'
|
91
58
|
requirements: []
|
92
|
-
rubygems_version: 3.
|
93
|
-
signing_key:
|
59
|
+
rubygems_version: 3.5.11
|
60
|
+
signing_key:
|
94
61
|
specification_version: 4
|
95
62
|
summary: Domain name parser based on the Public Suffix List.
|
96
63
|
test_files: []
|
data/.github/FUNDING.yml
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
# These are supported funding model platforms
|
2
|
-
|
3
|
-
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
4
|
-
patreon: # Replace with a single Patreon username
|
5
|
-
open_collective: # Replace with a single Open Collective username
|
6
|
-
ko_fi: # Replace with a single Ko-fi username
|
7
|
-
tidelift: "rubygems/public_suffix"
|
8
|
-
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
9
|
-
liberapay: # Replace with a single Liberapay username
|
10
|
-
issuehunt: # Replace with a single IssueHunt username
|
11
|
-
otechie: # Replace with a single Otechie username
|
12
|
-
custom: # Replace with a single custom sponsorship URL
|
data/.github/dependabot.yml
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
name: release
|
2
|
-
|
3
|
-
on:
|
4
|
-
push:
|
5
|
-
tags:
|
6
|
-
- v*.*.*
|
7
|
-
jobs:
|
8
|
-
release:
|
9
|
-
runs-on: ubuntu-latest
|
10
|
-
steps:
|
11
|
-
- uses: actions/checkout@v2
|
12
|
-
- name: Release Gem
|
13
|
-
uses: cadwallion/publish-rubygems-action@8f9e0538302643309e4e43bf48cd34173ca48cfc
|
14
|
-
env:
|
15
|
-
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
|
16
|
-
RELEASE_COMMAND: rake release
|
data/.github/workflows/tests.yml
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
name: Tests
|
2
|
-
|
3
|
-
on:
|
4
|
-
push:
|
5
|
-
pull_request:
|
6
|
-
workflow_dispatch:
|
7
|
-
|
8
|
-
jobs:
|
9
|
-
build:
|
10
|
-
strategy:
|
11
|
-
matrix:
|
12
|
-
ruby-version:
|
13
|
-
- "2.6"
|
14
|
-
- "2.7"
|
15
|
-
- "3.0"
|
16
|
-
- "3.1"
|
17
|
-
platform: [ubuntu-latest]
|
18
|
-
runs-on: ${{ matrix.platform }}
|
19
|
-
steps:
|
20
|
-
- uses: actions/checkout@v2
|
21
|
-
- name: Set up Ruby
|
22
|
-
uses: ruby/setup-ruby@v1
|
23
|
-
with:
|
24
|
-
ruby-version: ${{ matrix.ruby-version }}
|
25
|
-
- name: Install dependencies
|
26
|
-
run: bundle install
|
27
|
-
- name: Run tests
|
28
|
-
run: bundle exec rake
|
data/.gitignore
DELETED
data/.rubocop.yml
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
inherit_from:
|
2
|
-
- .rubocop_opinionated.yml
|
3
|
-
|
4
|
-
AllCops:
|
5
|
-
Exclude:
|
6
|
-
# Exclude .gemspec files because they are generally auto-generated
|
7
|
-
- '*.gemspec'
|
8
|
-
# Exclude vendored folders
|
9
|
-
- 'tmp/**/*'
|
10
|
-
- 'vendor/**/*'
|
11
|
-
# Exclude artifacts
|
12
|
-
- 'pkg/**/*'
|
13
|
-
# Other
|
14
|
-
- 'test/benchmarks/**/*'
|
15
|
-
- 'test/profilers/**/*'
|
16
|
-
|
17
|
-
# I often use @_variable to avoid clashing.
|
18
|
-
Naming/MemoizedInstanceVariableName:
|
19
|
-
Enabled: false
|
20
|
-
|
21
|
-
Style/ClassAndModuleChildren:
|
22
|
-
Exclude:
|
23
|
-
- 'spec/**/*_spec.rb'
|
24
|
-
- 'test/**/*_test.rb'
|
25
|
-
|
26
|
-
# Dear Rubocop, I don't want to use String#strip_heredoc
|
27
|
-
Layout/HeredocIndentation:
|
28
|
-
Enabled: false
|
29
|
-
|
30
|
-
Style/WordArray:
|
31
|
-
Enabled: false
|
32
|
-
MinSize: 3
|
33
|
-
|
34
|
-
Style/SymbolArray:
|
35
|
-
Enabled: false
|
36
|
-
MinSize: 3
|
data/.rubocop_opinionated.yml
DELETED
@@ -1,163 +0,0 @@
|
|
1
|
-
AllCops:
|
2
|
-
Exclude:
|
3
|
-
# Exclude .gemspec files because they are generally auto-generated
|
4
|
-
- '*.gemspec'
|
5
|
-
# Exclude vendored folders
|
6
|
-
- 'tmp/**/*'
|
7
|
-
- 'vendor/**/*'
|
8
|
-
NewCops: enable
|
9
|
-
|
10
|
-
# [codesmell]
|
11
|
-
Layout/LineLength:
|
12
|
-
Enabled: false
|
13
|
-
Exclude:
|
14
|
-
- 'spec/**/*_spec.rb'
|
15
|
-
- 'test/**/*_test.rb'
|
16
|
-
Max: 100
|
17
|
-
|
18
|
-
Lint/ConstantDefinitionInBlock:
|
19
|
-
Exclude:
|
20
|
-
- 'Rakefile'
|
21
|
-
- 'spec/**/*'
|
22
|
-
- 'test/**/*'
|
23
|
-
|
24
|
-
# [codesmell]
|
25
|
-
Metrics/AbcSize:
|
26
|
-
Enabled: false
|
27
|
-
Exclude:
|
28
|
-
- 'spec/**/*_spec.rb'
|
29
|
-
- 'test/**/*_test.rb'
|
30
|
-
|
31
|
-
# [codesmell]
|
32
|
-
Metrics/BlockLength:
|
33
|
-
Enabled: false
|
34
|
-
|
35
|
-
# [codesmell]
|
36
|
-
Metrics/CyclomaticComplexity:
|
37
|
-
Enabled: false
|
38
|
-
Exclude:
|
39
|
-
- 'spec/**/*_spec.rb'
|
40
|
-
- 'test/**/*_test.rb'
|
41
|
-
|
42
|
-
# [codesmell]
|
43
|
-
Metrics/ClassLength:
|
44
|
-
Enabled: false
|
45
|
-
Exclude:
|
46
|
-
- 'spec/**/*_spec.rb'
|
47
|
-
- 'test/**/*_test.rb'
|
48
|
-
|
49
|
-
# [codesmell]
|
50
|
-
Metrics/MethodLength:
|
51
|
-
Enabled: false
|
52
|
-
Exclude:
|
53
|
-
- 'spec/**/*_spec.rb'
|
54
|
-
- 'test/**/*_test.rb'
|
55
|
-
Max: 10
|
56
|
-
|
57
|
-
# [codesmell]
|
58
|
-
Metrics/ModuleLength:
|
59
|
-
Enabled: false
|
60
|
-
Exclude:
|
61
|
-
- 'spec/**/*_spec.rb'
|
62
|
-
- 'test/**/*_test.rb'
|
63
|
-
|
64
|
-
# [codesmell]
|
65
|
-
Metrics/ParameterLists:
|
66
|
-
Enabled: false
|
67
|
-
Max: 5
|
68
|
-
|
69
|
-
# [codesmell]
|
70
|
-
Metrics/PerceivedComplexity:
|
71
|
-
Enabled: false
|
72
|
-
|
73
|
-
# Do not use "and" or "or" in conditionals, but for readability we can use it
|
74
|
-
# to chain executions. Just beware of operator order.
|
75
|
-
Style/AndOr:
|
76
|
-
EnforcedStyle: conditionals
|
77
|
-
|
78
|
-
Style/Documentation:
|
79
|
-
Exclude:
|
80
|
-
- 'spec/**/*'
|
81
|
-
- 'test/**/*'
|
82
|
-
|
83
|
-
# Double empty lines are useful to separate conceptually different methods
|
84
|
-
# in the same class or module.
|
85
|
-
Layout/EmptyLines:
|
86
|
-
Enabled: false
|
87
|
-
|
88
|
-
# In most cases, a space is nice. Sometimes, it's not.
|
89
|
-
# Just be consistent with the rest of the surrounding code.
|
90
|
-
Layout/EmptyLinesAroundClassBody:
|
91
|
-
Enabled: false
|
92
|
-
|
93
|
-
# In most cases, a space is nice. Sometimes, it's not.
|
94
|
-
# Just be consistent with the rest of the surrounding code.
|
95
|
-
Layout/EmptyLinesAroundModuleBody:
|
96
|
-
Enabled: false
|
97
|
-
|
98
|
-
# This is quite buggy, as it doesn't recognize double lines.
|
99
|
-
# Double empty lines are useful to separate conceptually different methods
|
100
|
-
# in the same class or module.
|
101
|
-
Layout/EmptyLineBetweenDefs:
|
102
|
-
Enabled: false
|
103
|
-
|
104
|
-
# I personally don't care about the format style.
|
105
|
-
# In most cases I like to use %, but not at the point I want to enforce it
|
106
|
-
# as a convention in the entire code.
|
107
|
-
Style/FormatString:
|
108
|
-
Enabled: false
|
109
|
-
|
110
|
-
# Annotated tokens (like %<foo>s) are a good thing, but in most cases we don't need them.
|
111
|
-
# %s is a simpler and straightforward version that works in almost all cases. So don't complain.
|
112
|
-
Style/FormatStringToken:
|
113
|
-
Enabled: false
|
114
|
-
|
115
|
-
# unless is not always cool.
|
116
|
-
Style/NegatedIf:
|
117
|
-
Enabled: false
|
118
|
-
|
119
|
-
# For years, %w() has been the de-facto standard. A lot of libraries are using ().
|
120
|
-
# Switching to [] would be a nightmare.
|
121
|
-
Style/PercentLiteralDelimiters:
|
122
|
-
Enabled: false
|
123
|
-
|
124
|
-
# There are cases were the inline rescue is ok. We can either downgrade the severity,
|
125
|
-
# or rely on the developer judgement on a case-by-case basis.
|
126
|
-
Style/RescueModifier:
|
127
|
-
Enabled: false
|
128
|
-
|
129
|
-
Style/SymbolArray:
|
130
|
-
EnforcedStyle: brackets
|
131
|
-
|
132
|
-
# Sorry, but using trailing spaces helps readability.
|
133
|
-
#
|
134
|
-
# %w( foo bar )
|
135
|
-
#
|
136
|
-
# looks better to me than
|
137
|
-
#
|
138
|
-
# %w( foo bar )
|
139
|
-
#
|
140
|
-
Layout/SpaceInsidePercentLiteralDelimiters:
|
141
|
-
Enabled: false
|
142
|
-
|
143
|
-
# Hate It or Love It, I prefer double quotes as this is more consistent
|
144
|
-
# with several other programming languages and the output of puts and inspect.
|
145
|
-
Style/StringLiterals:
|
146
|
-
EnforcedStyle: double_quotes
|
147
|
-
|
148
|
-
# It's nice to be consistent. The trailing comma also allows easy reordering,
|
149
|
-
# and doesn't cause a diff in Git when you add a line to the bottom.
|
150
|
-
Style/TrailingCommaInArrayLiteral:
|
151
|
-
EnforcedStyleForMultiline: consistent_comma
|
152
|
-
Style/TrailingCommaInHashLiteral:
|
153
|
-
EnforcedStyleForMultiline: consistent_comma
|
154
|
-
|
155
|
-
Style/TrivialAccessors:
|
156
|
-
# IgnoreClassMethods because I want to be able to define class-level accessors
|
157
|
-
# that sets an instance variable on the metaclass, such as:
|
158
|
-
#
|
159
|
-
# def self.default=(value)
|
160
|
-
# @default = value
|
161
|
-
# end
|
162
|
-
#
|
163
|
-
IgnoreClassMethods: true
|
data/Gemfile
DELETED
data/Rakefile
DELETED
@@ -1,52 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "bundler/gem_tasks"
|
4
|
-
|
5
|
-
# By default, run tests and linter.
|
6
|
-
task default: [:test, :rubocop]
|
7
|
-
|
8
|
-
|
9
|
-
require "rake/testtask"
|
10
|
-
|
11
|
-
Rake::TestTask.new do |t|
|
12
|
-
t.libs = %w( lib test )
|
13
|
-
t.pattern = "test/**/*_test.rb"
|
14
|
-
t.verbose = !ENV["VERBOSE"].nil?
|
15
|
-
t.warning = !ENV["WARNING"].nil?
|
16
|
-
end
|
17
|
-
|
18
|
-
require "rubocop/rake_task"
|
19
|
-
|
20
|
-
RuboCop::RakeTask.new
|
21
|
-
|
22
|
-
|
23
|
-
require "yard"
|
24
|
-
require "yard/rake/yardoc_task"
|
25
|
-
|
26
|
-
YARD::Rake::YardocTask.new(:yardoc) do |y|
|
27
|
-
y.options = ["--output-dir", "yardoc"]
|
28
|
-
end
|
29
|
-
|
30
|
-
CLOBBER.include "yardoc"
|
31
|
-
|
32
|
-
|
33
|
-
task :benchmarks do
|
34
|
-
Dir["benchmarks/bm_*.rb"].each do |file|
|
35
|
-
sh "ruby #{file}"
|
36
|
-
end
|
37
|
-
end
|
38
|
-
task default: [:benchmarks] if ENV["BENCHMARKS"] == "1"
|
39
|
-
|
40
|
-
|
41
|
-
desc "Downloads the Public Suffix List file from the repository and stores it locally."
|
42
|
-
task :"update-list" do
|
43
|
-
require "net/http"
|
44
|
-
|
45
|
-
DEFINITION_URL = "https://raw.githubusercontent.com/publicsuffix/list/master/public_suffix_list.dat"
|
46
|
-
|
47
|
-
File.open("data/list.txt", "w+") do |f|
|
48
|
-
response = Net::HTTP.get_response(URI.parse(DEFINITION_URL))
|
49
|
-
response.body
|
50
|
-
f.write(response.body)
|
51
|
-
end
|
52
|
-
end
|
data/bin/console
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
require "bundler/setup"
|
5
|
-
require "public_suffix"
|
6
|
-
|
7
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
-
# with your gem easier. You can also use a different console, if you like.
|
9
|
-
|
10
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
11
|
-
# require "pry"
|
12
|
-
# Pry.start
|
13
|
-
|
14
|
-
require "irb"
|
15
|
-
IRB.start
|
data/public_suffix.gemspec
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
$LOAD_PATH.push File.expand_path("../lib", __FILE__)
|
3
|
-
require "public_suffix/version"
|
4
|
-
|
5
|
-
Gem::Specification.new do |s|
|
6
|
-
s.name = "public_suffix"
|
7
|
-
s.version = PublicSuffix::VERSION
|
8
|
-
s.authors = ["Simone Carletti"]
|
9
|
-
s.email = ["weppos@weppos.net"]
|
10
|
-
s.homepage = "https://simonecarletti.com/code/publicsuffix-ruby"
|
11
|
-
s.summary = "Domain name parser based on the Public Suffix List."
|
12
|
-
s.description = "PublicSuffix can parse and decompose a domain name into top level domain, domain and subdomains."
|
13
|
-
s.licenses = ["MIT"]
|
14
|
-
|
15
|
-
s.metadata = {
|
16
|
-
"bug_tracker_uri" => "https://github.com/weppos/publicsuffix-ruby/issues",
|
17
|
-
"changelog_uri" => "https://github.com/weppos/publicsuffix-ruby/blob/master/CHANGELOG.md",
|
18
|
-
"documentation_uri" => "https://rubydoc.info/gems/#{s.name}/#{s.version}",
|
19
|
-
"homepage_uri" => s.homepage,
|
20
|
-
"source_code_uri" => "https://github.com/weppos/publicsuffix-ruby/tree/v#{s.version}",
|
21
|
-
}
|
22
|
-
|
23
|
-
s.required_ruby_version = ">= 2.3"
|
24
|
-
|
25
|
-
s.require_paths = ["lib"]
|
26
|
-
s.files = `git ls-files`.split("\n")
|
27
|
-
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
28
|
-
s.extra_rdoc_files = %w( LICENSE.txt )
|
29
|
-
end
|
data/test/.empty
DELETED