public_suffix 4.0.6 → 5.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +19 -0
- data/.github/workflows/psl-update.yml +38 -0
- data/.github/workflows/release.yml +18 -0
- data/.github/workflows/tests.yml +16 -23
- data/.rubocop.yml +1 -0
- data/.rubocop_opinionated.yml +0 -22
- data/CHANGELOG.md +26 -0
- data/Gemfile +2 -3
- data/LICENSE.txt +1 -1
- data/README.md +13 -3
- data/Rakefile +4 -3
- data/data/list.txt +1327 -518
- data/lib/public_suffix/domain.rb +1 -1
- data/lib/public_suffix/errors.rb +1 -1
- data/lib/public_suffix/list.rb +4 -4
- data/lib/public_suffix/rule.rb +16 -16
- data/lib/public_suffix/version.rb +5 -3
- data/lib/public_suffix.rb +12 -14
- data/public_suffix.gemspec +1 -1
- data/test/acceptance_test.rb +4 -4
- data/test/psl_test.rb +1 -1
- data/test/test_helper.rb +0 -8
- data/test/unit/domain_test.rb +3 -3
- data/test/unit/list_test.rb +1 -1
- data/test/unit/rule_test.rb +15 -15
- metadata +10 -30
- data/.travis.yml +0 -23
- data/codecov.yml +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e2d5eae634d5527c967fb66edc14fda9861075c30ba6101cbf8b315228b1dbea
|
4
|
+
data.tar.gz: a88c678e28311664491be49296d5a349e89a1beb9039bf16ebca48b5c62ff8f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2463aad10f4e27ecd886e0bbe566557a8048b325ea8d6f175467954dd8d0d808c5857847d4e9665ec2771eaef562220336686dc73c0b37f49caf2a15f1b121cc
|
7
|
+
data.tar.gz: f5c5717c0cf2ff90a88899d6c026e61bb5b802350c9dcbab1e26db2abbb3a0b073b86ec0f1b9411acd742ccd2fdd69366fd0154839850f15203e0c2a1575b039
|
@@ -0,0 +1,19 @@
|
|
1
|
+
version: 2
|
2
|
+
updates:
|
3
|
+
- package-ecosystem: bundler
|
4
|
+
directory: "/"
|
5
|
+
schedule:
|
6
|
+
interval: daily
|
7
|
+
time: "04:00"
|
8
|
+
open-pull-requests-limit: 10
|
9
|
+
labels:
|
10
|
+
- dependencies
|
11
|
+
|
12
|
+
- package-ecosystem: "github-actions"
|
13
|
+
directory: "/"
|
14
|
+
schedule:
|
15
|
+
interval: "daily"
|
16
|
+
time: "04:00"
|
17
|
+
open-pull-requests-limit: 10
|
18
|
+
labels:
|
19
|
+
- dependencies
|
@@ -0,0 +1,38 @@
|
|
1
|
+
name: PSL Update
|
2
|
+
|
3
|
+
on:
|
4
|
+
workflow_dispatch:
|
5
|
+
schedule:
|
6
|
+
- cron: '40 6 * * *'
|
7
|
+
|
8
|
+
jobs:
|
9
|
+
update:
|
10
|
+
runs-on: ubuntu-latest
|
11
|
+
steps:
|
12
|
+
|
13
|
+
- name: Checkout
|
14
|
+
uses: actions/checkout@v3
|
15
|
+
|
16
|
+
- name: Set up Ruby
|
17
|
+
uses: ruby/setup-ruby@v1
|
18
|
+
with:
|
19
|
+
ruby-version: "3.1"
|
20
|
+
bundler-cache: true
|
21
|
+
|
22
|
+
- name: Update PSL
|
23
|
+
run: bundle exec rake update-list
|
24
|
+
|
25
|
+
- name: Create Pull Request
|
26
|
+
uses: peter-evans/create-pull-request@v4
|
27
|
+
with:
|
28
|
+
title: PSL auto-update
|
29
|
+
commit-message: Updated list from source
|
30
|
+
reviewers: weppos
|
31
|
+
add-paths: |
|
32
|
+
data/list.txt
|
33
|
+
|
34
|
+
- name: Check Pull Request
|
35
|
+
if: ${{ steps.cpr.outputs.pull-request-number }}
|
36
|
+
run: |
|
37
|
+
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
|
38
|
+
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
|
@@ -0,0 +1,18 @@
|
|
1
|
+
name: Release
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
tags:
|
6
|
+
- v*.*.*
|
7
|
+
|
8
|
+
jobs:
|
9
|
+
release:
|
10
|
+
runs-on: ubuntu-latest
|
11
|
+
steps:
|
12
|
+
- name: Checkout
|
13
|
+
uses: actions/checkout@v3
|
14
|
+
- name: Release Gem
|
15
|
+
uses: cadwallion/publish-rubygems-action@d9474d9633f4674e59afb0c343f2dafe25181328
|
16
|
+
env:
|
17
|
+
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
|
18
|
+
RELEASE_COMMAND: rake release
|
data/.github/workflows/tests.yml
CHANGED
@@ -2,35 +2,28 @@ name: Tests
|
|
2
2
|
|
3
3
|
on:
|
4
4
|
push:
|
5
|
-
branches: [ master ]
|
6
5
|
pull_request:
|
7
|
-
|
6
|
+
workflow_dispatch:
|
8
7
|
|
9
8
|
jobs:
|
10
|
-
|
11
|
-
build:
|
9
|
+
test:
|
12
10
|
strategy:
|
13
11
|
matrix:
|
14
12
|
ruby-version:
|
15
|
-
# - "2.3"
|
16
|
-
- "2.4"
|
17
|
-
- "2.5"
|
18
13
|
- "2.6"
|
19
14
|
- "2.7"
|
20
|
-
|
21
|
-
|
22
|
-
runs-on:
|
15
|
+
- "3.0"
|
16
|
+
- "3.1"
|
17
|
+
runs-on: ubuntu-latest
|
23
18
|
steps:
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
- name: Run tests
|
36
|
-
run: bundle exec rake
|
19
|
+
- name: Checkout
|
20
|
+
uses: actions/checkout@v3
|
21
|
+
- name: Set up Ruby
|
22
|
+
uses: ruby/setup-ruby@v1
|
23
|
+
with:
|
24
|
+
ruby-version: ${{ matrix.ruby-version }}
|
25
|
+
bundler-cache: true
|
26
|
+
- name: Rubocop
|
27
|
+
run: bundle exec rake rubocop
|
28
|
+
- name: Run tests
|
29
|
+
run: bundle exec rake test
|
data/.rubocop.yml
CHANGED
data/.rubocop_opinionated.yml
CHANGED
@@ -95,12 +95,6 @@ Layout/EmptyLinesAroundModuleBody:
|
|
95
95
|
Layout/EmptyLineBetweenDefs:
|
96
96
|
Enabled: false
|
97
97
|
|
98
|
-
# I personally don't care about the format style.
|
99
|
-
# In most cases I like to use %, but not at the point I want to enforce it
|
100
|
-
# as a convention in the entire code.
|
101
|
-
Style/FormatString:
|
102
|
-
Enabled: false
|
103
|
-
|
104
98
|
# Annotated tokens (like %<foo>s) are a good thing, but in most cases we don't need them.
|
105
99
|
# %s is a simpler and straightforward version that works in almost all cases. So don't complain.
|
106
100
|
Style/FormatStringToken:
|
@@ -110,11 +104,6 @@ Style/FormatStringToken:
|
|
110
104
|
Style/NegatedIf:
|
111
105
|
Enabled: false
|
112
106
|
|
113
|
-
# For years, %w() has been the de-facto standard. A lot of libraries are using ().
|
114
|
-
# Switching to [] would be a nightmare.
|
115
|
-
Style/PercentLiteralDelimiters:
|
116
|
-
Enabled: false
|
117
|
-
|
118
107
|
# There are cases were the inline rescue is ok. We can either downgrade the severity,
|
119
108
|
# or rely on the developer judgement on a case-by-case basis.
|
120
109
|
Style/RescueModifier:
|
@@ -123,17 +112,6 @@ Style/RescueModifier:
|
|
123
112
|
Style/SymbolArray:
|
124
113
|
EnforcedStyle: brackets
|
125
114
|
|
126
|
-
# Sorry, but using trailing spaces helps readability.
|
127
|
-
#
|
128
|
-
# %w( foo bar )
|
129
|
-
#
|
130
|
-
# looks better to me than
|
131
|
-
#
|
132
|
-
# %w( foo bar )
|
133
|
-
#
|
134
|
-
Layout/SpaceInsidePercentLiteralDelimiters:
|
135
|
-
Enabled: false
|
136
|
-
|
137
115
|
# Hate It or Love It, I prefer double quotes as this is more consistent
|
138
116
|
# with several other programming languages and the output of puts and inspect.
|
139
117
|
Style/StringLiterals:
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,32 @@
|
|
2
2
|
|
3
3
|
This project uses [Semantic Versioning 2.0.0](https://semver.org/).
|
4
4
|
|
5
|
+
## 5.0.1
|
6
|
+
|
7
|
+
### Changed
|
8
|
+
|
9
|
+
- Updated definitions.
|
10
|
+
|
11
|
+
|
12
|
+
## 5.0.0
|
13
|
+
|
14
|
+
### Changed
|
15
|
+
|
16
|
+
- Minimum Ruby version is 2.6
|
17
|
+
|
18
|
+
- Updated definitions.
|
19
|
+
|
20
|
+
|
21
|
+
## 4.0.7
|
22
|
+
|
23
|
+
### Fixes
|
24
|
+
|
25
|
+
- Fixed YARD rake task (GH-179)
|
26
|
+
|
27
|
+
### Changed
|
28
|
+
|
29
|
+
- Updated definitions.
|
30
|
+
|
5
31
|
|
6
32
|
## 4.0.6
|
7
33
|
|
data/Gemfile
CHANGED
@@ -6,10 +6,9 @@ gemspec
|
|
6
6
|
|
7
7
|
gem "rake"
|
8
8
|
|
9
|
-
gem "codecov", require: false
|
10
9
|
gem "memory_profiler", require: false
|
11
10
|
gem "minitest"
|
12
11
|
gem "minitest-reporters"
|
13
|
-
gem "mocha"
|
14
|
-
gem "rubocop",
|
12
|
+
gem "mocha", "~> 2.0.1"
|
13
|
+
gem "rubocop", require: false
|
15
14
|
gem "yard"
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
<tt>PublicSuffix</tt> is a Ruby domain name parser based on the [Public Suffix List](https://publicsuffix.org/).
|
4
4
|
|
5
|
-
[![Build Status](https://
|
5
|
+
[![Build Status](https://github.com/weppos/publicsuffix-ruby/actions/workflows/tests.yml/badge.svg)](https://github.com/weppos/publicsuffix-ruby/actions/workflows/tests.yml)
|
6
6
|
[![Tidelift dependencies](https://tidelift.com/badges/package/rubygems/public_suffix)](https://tidelift.com/subscription/pkg/rubygems-public-suffix?utm_source=rubygems-public-suffix&utm_medium=referral&utm_campaign=enterprise)
|
7
7
|
|
8
8
|
|
@@ -16,7 +16,7 @@
|
|
16
16
|
|
17
17
|
## Requirements
|
18
18
|
|
19
|
-
<tt>PublicSuffix</tt> requires **Ruby >= 2.
|
19
|
+
<tt>PublicSuffix</tt> requires **Ruby >= 2.6**. For an older versions of Ruby use a previous release.
|
20
20
|
|
21
21
|
|
22
22
|
## Installation
|
@@ -202,6 +202,16 @@ See the [CHANGELOG.md](CHANGELOG.md) file for details.
|
|
202
202
|
|
203
203
|
## License
|
204
204
|
|
205
|
-
Copyright (c) 2009-
|
205
|
+
Copyright (c) 2009-2022 Simone Carletti. This is Free Software distributed under the MIT license.
|
206
206
|
|
207
207
|
The [Public Suffix List source](https://publicsuffix.org/list/) is subject to the terms of the Mozilla Public License, v. 2.0.
|
208
|
+
|
209
|
+
## Definitions
|
210
|
+
|
211
|
+
tld = Top level domain, this is in reference to the last segment of a domain, sometimes the part that is directly after the "dot" symbol. For example, `mozilla.org`, the `.org` portion is the tld.
|
212
|
+
|
213
|
+
sld = Second level domain, a domain that is directly below a top-level domain. For example, in `https://www.mozilla.org/en-US/`, `mozilla` is the second-level domain of the .org tld.
|
214
|
+
|
215
|
+
trd = Transit routing domain, or known as a subdomain. This is the part of the domain that is before the sld or root domain. For example, in `https://www.mozilla.org/en-US/`, `www` is the trd.
|
216
|
+
|
217
|
+
FQDN = Fully Qualified Domain Names, are domain names that are written with the hostname and the domain name, and include the top-level domain, the format looks like `[hostname].[domain].[tld].` for ex. `[www].[mozilla].[org]`.
|
data/Rakefile
CHANGED
@@ -9,7 +9,7 @@ task default: [:test, :rubocop]
|
|
9
9
|
require "rake/testtask"
|
10
10
|
|
11
11
|
Rake::TestTask.new do |t|
|
12
|
-
t.libs = %w
|
12
|
+
t.libs = %w[lib test]
|
13
13
|
t.pattern = "test/**/*_test.rb"
|
14
14
|
t.verbose = !ENV["VERBOSE"].nil?
|
15
15
|
t.warning = !ENV["WARNING"].nil?
|
@@ -20,6 +20,7 @@ require "rubocop/rake_task"
|
|
20
20
|
RuboCop::RakeTask.new
|
21
21
|
|
22
22
|
|
23
|
+
require "yard"
|
23
24
|
require "yard/rake/yardoc_task"
|
24
25
|
|
25
26
|
YARD::Rake::YardocTask.new(:yardoc) do |y|
|
@@ -41,10 +42,10 @@ desc "Downloads the Public Suffix List file from the repository and stores it lo
|
|
41
42
|
task :"update-list" do
|
42
43
|
require "net/http"
|
43
44
|
|
44
|
-
|
45
|
+
definition_url = "https://raw.githubusercontent.com/publicsuffix/list/master/public_suffix_list.dat"
|
45
46
|
|
46
47
|
File.open("data/list.txt", "w+") do |f|
|
47
|
-
response = Net::HTTP.get_response(URI.parse(
|
48
|
+
response = Net::HTTP.get_response(URI.parse(definition_url))
|
48
49
|
response.body
|
49
50
|
f.write(response.body)
|
50
51
|
end
|