public_suffix 5.1.1 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f95fd278200cbe3922d07b90ca7b51231509770ff2df64b45f1f0dd0aae532b5
4
- data.tar.gz: 8ca654313480fdb64b80d1ac2e54150cc594d731a88dfee4a125c8a32bb6aecc
3
+ metadata.gz: '084a35b60185cb9effa86043e48492bbdef04d05f0f25b022cd4814b812b3de2'
4
+ data.tar.gz: 70c513a2c19d770c0d6d929a9bb8fe868a9df87b899af6eaf4ffe24a4acfc903
5
5
  SHA512:
6
- metadata.gz: e7f9ae38d463e8ef8355e033606d5f0a7689976054127f9d5a32b9e0af0bca7f54fa3287678d85def68e73a3fc466fc01d4b39db511386e121ac8bab1fe8c728
7
- data.tar.gz: 22bf9f457b5d961de5a8e40de03558bdca814bf565343ed0024be69b71b789b538ca497b856bfa9f294b9cbfcf4c9cf48d9fd7670628f5e0684dc05afa528d1c
6
+ metadata.gz: 867e2369292df3275da727802270527999530fff53b9683228edf4f183e9f8fd7592cb3da2d2bf0923f2b7c727e778dbc45e329f234e7f1869d74f298994bf5a
7
+ data.tar.gz: 9fbbcf8839be0685d98d91e6fb44ec010f3dd2c3e80469b57b1138465701b3b0168da508aa3f7c8a3e46897c8135b337b2b64e1d17fb058e4de02a11efc4e984
data/CHANGELOG.md CHANGED
@@ -2,17 +2,59 @@
2
2
 
3
3
  This project uses [Semantic Versioning 2.0.0](https://semver.org/).
4
4
 
5
+
6
+ ## 7.0.0
7
+
8
+ ### Changed
9
+
10
+ - Updated definitions.
11
+ - Minimum Ruby version is 3.2
12
+
13
+
14
+ ## 6.0.2
15
+
16
+ ### Changed
17
+
18
+ - Updated definitions.
19
+
20
+
21
+ ## 6.0.1
22
+
23
+ ### Changed
24
+
25
+ - Updated definitions.
26
+
27
+
28
+ ## 6.0.0
29
+
30
+ Same as 5.1.0. Re-releasing as a major version change due to a major ruby version requirement change.
31
+
32
+ ### Changed
33
+
34
+ - Updated definitions.
35
+ - Minimum Ruby version is 3.0
36
+
37
+
5
38
  ## 5.1.1
6
39
 
7
40
  No significant changes. Releasing a mini version to address 5.1.0 release with major ruby requirement change (GH-315).
8
41
 
9
42
 
43
+ ## 5.1.0
44
+
45
+ ### Changed
46
+
47
+ - Updated definitions.
48
+ - Minimum Ruby version is 3.0
49
+
50
+
10
51
  ## 5.0.5
11
52
 
12
53
  ### Changed
13
54
 
14
55
  - Updated definitions.
15
56
 
57
+
16
58
  ## 5.0.4
17
59
 
18
60
  ### Changed
@@ -20,18 +62,21 @@ No significant changes. Releasing a mini version to address 5.1.0 release with m
20
62
  - Reduced .gem file size (GH-258). [Thanks @ybiquitous]
21
63
  - Updated definitions.
22
64
 
65
+
23
66
  ## 5.0.3
24
67
 
25
68
  ### Fixed
26
69
 
27
70
  - Fixed automated release workflow.
28
71
 
72
+
29
73
  ## 5.0.2
30
74
 
31
75
  ### Changed
32
76
 
33
77
  - Updated definitions.
34
78
 
79
+
35
80
  ## 5.0.1
36
81
 
37
82
  ### Changed
@@ -44,7 +89,6 @@ No significant changes. Releasing a mini version to address 5.1.0 release with m
44
89
  ### Changed
45
90
 
46
91
  - Minimum Ruby version is 2.6
47
-
48
92
  - Updated definitions.
49
93
 
50
94
 
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2009-2024 Simone Carletti <weppos@weppos.net>
1
+ Copyright (c) 2009-2025 Simone Carletti <weppos@weppos.net>
2
2
 
3
3
  MIT License
4
4
 
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # Public Suffix <small>for Ruby</small>
1
+ # PublicSuffix for Ruby
2
2
 
3
- <tt>PublicSuffix</tt> is a Ruby domain name parser based on the [Public Suffix List](https://publicsuffix.org/).
3
+ `PublicSuffix` is a Ruby domain name parser based on the [Public Suffix List](https://publicsuffix.org/).
4
4
 
5
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)
@@ -16,7 +16,7 @@
16
16
 
17
17
  ## Requirements
18
18
 
19
- <tt>PublicSuffix</tt> requires **Ruby >= 2.6**. For an older versions of Ruby use a previous release.
19
+ `PublicSuffix` requires **Ruby >= 3.2**. For older versions of Ruby, use a previous release.
20
20
 
21
21
 
22
22
  ## Installation
@@ -33,8 +33,6 @@ Or use Bundler and define it as a dependency in your `Gemfile`:
33
33
  gem 'public_suffix'
34
34
  ```
35
35
 
36
- If you are upgrading to 2.0, see [2.0-Upgrade.md](2.0-Upgrade.md).
37
-
38
36
  ## Usage
39
37
 
40
38
  Extract the domain out from a name:
@@ -108,9 +106,9 @@ PublicSuffix.valid?("example.tldnotlisted", default_rule: nil)
108
106
  ```
109
107
 
110
108
 
111
- ## Fully Qualified Domain Names
109
+ ## Fully qualified domain names
112
110
 
113
- This library automatically recognizes Fully Qualified Domain Names. A FQDN is a domain name that end with a trailing dot.
111
+ This library automatically recognizes Fully Qualified Domain Names. A FQDN is a domain name that ends with a trailing dot.
114
112
 
115
113
  ```ruby
116
114
  # Parse a standard domain name
@@ -124,7 +122,7 @@ PublicSuffix.domain("www.google.com.")
124
122
 
125
123
  ## Private domains
126
124
 
127
- This library has support for switching off support for private (non-ICANN).
125
+ This library supports toggling private (non-ICANN) domain handling.
128
126
 
129
127
  ```ruby
130
128
  # Extract a domain including private domains (by default)
@@ -150,15 +148,15 @@ PublicSuffix.domain("something.blogspot.com")
150
148
  # => "blogspot.com"
151
149
  ```
152
150
 
153
- ## Add domain to list
151
+ ## Adding custom domains
154
152
 
155
- If you want to manually add a domain to the list just run:
153
+ To manually add a domain to the list:
156
154
 
157
155
  ```ruby
158
156
  PublicSuffix::List.default << PublicSuffix::Rule.factory('onmicrosoft.com')
159
157
  ```
160
158
 
161
- ## What is the Public Suffix List?
159
+ ## What is the public suffix list?
162
160
 
163
161
  The [Public Suffix List](https://publicsuffix.org) is a cross-vendor initiative to provide an accurate list of domain name suffixes.
164
162
 
@@ -167,7 +165,7 @@ The Public Suffix List is an initiative of the Mozilla Project, but is maintaine
167
165
  A "public suffix" is one under which Internet users can directly register names. Some examples of public suffixes are ".com", ".co.uk" and "pvt.k12.wy.us". The Public Suffix List is a list of all known public suffixes.
168
166
 
169
167
 
170
- ## Why the Public Suffix List is better than any available Regular Expression parser?
168
+ ## Why use the public suffix list instead of regular expressions?
171
169
 
172
170
  Previously, browsers used an algorithm which basically only denied setting wide-ranging cookies for top-level domains with no dots (e.g. com or org). However, this did not work for top-level domains where only third-level registrations are allowed (e.g. co.uk). In these cases, websites could set a cookie for co.uk which will be passed onto every website registered under co.uk.
173
171
 
@@ -182,43 +180,52 @@ Source: https://wiki.mozilla.org/Public_Suffix_List
182
180
  Not convinced yet? Check out [this real world example](https://stackoverflow.com/q/288810/123527).
183
181
 
184
182
 
185
- ## Does <tt>PublicSuffix</tt> make requests to Public Suffix List website?
183
+ ## Does PublicSuffix make network requests?
186
184
 
187
- No. <tt>PublicSuffix</tt> comes with a bundled list. It does not make any HTTP requests to parse or validate a domain.
185
+ No. `PublicSuffix` comes with a bundled list. It does not make any HTTP requests to parse or validate a domain.
188
186
 
189
187
 
190
- ## Support
188
+ ## Terminology
191
189
 
192
- Library documentation is auto-generated from the [README](https://github.com/weppos/publicsuffix-ruby/blob/master/README.md) and the source code, and it's available at https://rubydoc.info/gems/public_suffix.
190
+ - **TLD** (Top-Level Domain): The last segment of a domain name. For example, in `mozilla.org`, the `.org` portion is the TLD.
193
191
 
194
- - The PublicSuffix bug tracker is here: https://github.com/weppos/publicsuffix-ruby/issues
195
- - The PublicSuffix code repository is here: https://github.com/weppos/publicsuffix-ruby. Contributions are welcome! Please include tests and/or feature coverage for every patch, and create a topic branch for every separate change you make.
192
+ - **SLD** (Second-Level Domain): A domain 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.
196
193
 
197
- [Consider subscribing to Tidelift which provides Enterprise support for this project](https://tidelift.com/subscription/pkg/rubygems-public-suffix?utm_source=rubygems-public-suffix&utm_medium=referral&utm_campaign=readme) as part of the Tidelift Subscription. Tidelift subscriptions also help the maintainers by funding the project, which in turn allows us to ship releases, bugfixes, and security updates more often.
194
+ - **TRD** (Third-Level Domain): Also known as a subdomain, this is the part of the domain before the SLD or root domain. For example, in `https://www.mozilla.org/en-US/`, `www` is the TRD.
198
195
 
196
+ - **FQDN** (Fully Qualified Domain Name): A complete domain name that includes the hostname, domain, and top-level domain, ending with a trailing dot. The format is `[hostname].[domain].[tld].` (e.g., `www.mozilla.org.`).
199
197
 
200
- ## Security and Vulnerability Reporting
201
198
 
202
- Full information and description of our security policy please visit [`SECURITY.md`](SECURITY.md)
199
+ ## Documentation and support
203
200
 
201
+ ### Documentation
204
202
 
205
- ## Changelog
203
+ Library documentation is auto-generated from the [README](https://github.com/weppos/publicsuffix-ruby/blob/master/README.md) and source code, and is available at https://rubydoc.info/gems/public_suffix.
206
204
 
207
- See the [CHANGELOG.md](CHANGELOG.md) file for details.
205
+ ### Bug reports and contributions
208
206
 
207
+ - **Bug Tracker**: https://github.com/weppos/publicsuffix-ruby/issues
208
+ - **Code Repository**: https://github.com/weppos/publicsuffix-ruby
209
209
 
210
- ## License
210
+ Contributions are welcome! Please include tests and/or feature coverage for every patch, and create a topic branch for every separate change you make.
211
211
 
212
- Copyright (c) 2009-2024 Simone Carletti. This is Free Software distributed under the MIT license.
212
+ ### Enterprise support
213
213
 
214
- The [Public Suffix List source](https://publicsuffix.org/list/) is subject to the terms of the Mozilla Public License, v. 2.0.
214
+ [Consider subscribing to Tidelift](https://tidelift.com/subscription/pkg/rubygems-public-suffix?utm_source=rubygems-public-suffix&utm_medium=referral&utm_campaign=readme), which provides enterprise support for this project as part of the Tidelift Subscription. Tidelift subscriptions help fund the project, allowing us to ship releases, bugfixes, and security updates more frequently.
215
+
216
+
217
+ ## Security and vulnerability reporting
215
218
 
216
- ## Definitions
219
+ For full information and details about our security policy, please visit [`SECURITY.md`](SECURITY.md).
217
220
 
218
- 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.
219
221
 
220
- 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.
222
+ ## Changelog
223
+
224
+ See [CHANGELOG.md](CHANGELOG.md) for details.
225
+
221
226
 
222
- 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.
227
+ ## License
228
+
229
+ Copyright (c) 2009-2025 Simone Carletti. This is Free Software distributed under the MIT license.
223
230
 
224
- 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]`.
231
+ The [Public Suffix List source](https://publicsuffix.org/list/) is subject to the terms of the Mozilla Public License, v. 2.0.
data/RELEASING.md ADDED
@@ -0,0 +1,95 @@
1
+ # Releasing
2
+
3
+ This document describes the steps to release a new version of PublicSuffix.
4
+
5
+ ## Prerequisites
6
+
7
+ - You have commit access to the repository
8
+ - You have push access to the repository
9
+ - You have a GPG key configured for signing tags
10
+ - You have permission to publish to RubyGems
11
+
12
+ ## Release process
13
+
14
+ 1. **Determine the new version** using [Semantic Versioning](https://semver.org/)
15
+
16
+ ```shell
17
+ VERSION=X.Y.Z
18
+ ```
19
+
20
+ - **MAJOR** version for incompatible API changes
21
+ - **MINOR** version for backwards-compatible functionality additions
22
+ - **PATCH** version for backwards-compatible bug fixes
23
+
24
+ 2. **Update the version file** with the new version
25
+
26
+ Edit `lib/public_suffix/version.rb` and update the `VERSION` constant:
27
+
28
+ ```ruby
29
+ VERSION = "X.Y.Z"
30
+ ```
31
+
32
+ 3. **Update the changelog** with the new version
33
+
34
+ Edit `CHANGELOG.md` and add a new section for the release:
35
+
36
+ ```markdown
37
+ ## vX.Y.Z
38
+
39
+ - Description of changes
40
+ ```
41
+
42
+ 4. **Install dependencies**
43
+
44
+ ```shell
45
+ bundle install
46
+ ```
47
+
48
+ or simply:
49
+
50
+ ```shell
51
+ bundle
52
+ ```
53
+
54
+ 5. **Run tests** and confirm they pass
55
+
56
+ ```shell
57
+ bundle exec rake test
58
+ ```
59
+
60
+ 6. **Commit the new version**
61
+
62
+ ```shell
63
+ git add lib/public_suffix/version.rb CHANGELOG.md Gemfile.lock
64
+ git commit -m "Release $VERSION"
65
+ ```
66
+
67
+ 7. **Create a signed tag**
68
+
69
+ ```shell
70
+ git tag -a v$VERSION -s -m "Release $VERSION"
71
+ ```
72
+
73
+ 8. **Push the changes and tag**
74
+
75
+ ```shell
76
+ git push origin main
77
+ git push origin v$VERSION
78
+ ```
79
+
80
+ 9. **Build and publish the gem**
81
+
82
+ ```shell
83
+ bundle exec rake release
84
+ ```
85
+
86
+ This will:
87
+ - Build the gem
88
+ - Push it to RubyGems
89
+ - Create a GitHub release
90
+
91
+ ## Post-release
92
+
93
+ - Verify the new version appears on [RubyGems](https://rubygems.org/gems/public_suffix)
94
+ - Verify the GitHub release was created
95
+ - Announce the release if necessary
data/SECURITY.md CHANGED
@@ -4,8 +4,7 @@
4
4
 
5
5
  Security updates are provided only for the current minor version.
6
6
 
7
- If you are using a previous minor version, we recommend to upgrade to the current minor version.
8
- This project uses [semantic versioning](https://semver.org/), therefore you can upgrade to a more recent minor version without incurring into breaking changes.
7
+ If you are using a previous minor version, we recommend to upgrade to the current minor version. This project uses [semantic versioning](https://semver.org/), therefore you can upgrade to a more recent minor version without incurring into breaking changes.
9
8
 
10
9
  Exceptionally, we may support previous minor versions upon request if there are significant reasons preventing to immediately switch the latest minor version.
11
10