public_suffix 6.0.2 → 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: 04ff8ba3506464503a796f29cf86abe2c495ed69d83c702e3e1394a76ff53a38
4
- data.tar.gz: 4818f5ce2d34c646bb3f25ebfba6cc830983f03609f957550173f8d8381d993a
3
+ metadata.gz: '084a35b60185cb9effa86043e48492bbdef04d05f0f25b022cd4814b812b3de2'
4
+ data.tar.gz: 70c513a2c19d770c0d6d929a9bb8fe868a9df87b899af6eaf4ffe24a4acfc903
5
5
  SHA512:
6
- metadata.gz: f984cc18b6e52a2da58568c0c60a40b316437191f56a016684080cba1107c98c41712184b77d67dbe89dadb8b09aa52d999d789ed52e795fc3329a960b3ed20c
7
- data.tar.gz: 39d3e8228b45a8e940edd1b6fc1646e9eaad6a51d4c4227c46b88c305ed4e4452b201b05c4978fde502243b82d3ebc9baab4b339d75e4899b8648574d8e31c49
6
+ metadata.gz: 867e2369292df3275da727802270527999530fff53b9683228edf4f183e9f8fd7592cb3da2d2bf0923f2b7c727e778dbc45e329f234e7f1869d74f298994bf5a
7
+ data.tar.gz: 9fbbcf8839be0685d98d91e6fb44ec010f3dd2c3e80469b57b1138465701b3b0168da508aa3f7c8a3e46897c8135b337b2b64e1d17fb058e4de02a11efc4e984
data/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  This project uses [Semantic Versioning 2.0.0](https://semver.org/).
4
4
 
5
5
 
6
+ ## 7.0.0
7
+
8
+ ### Changed
9
+
10
+ - Updated definitions.
11
+ - Minimum Ruby version is 3.2
12
+
13
+
6
14
  ## 6.0.2
7
15
 
8
16
  ### Changed
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 >= 3.0**. 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
@@ -106,9 +106,9 @@ PublicSuffix.valid?("example.tldnotlisted", default_rule: nil)
106
106
  ```
107
107
 
108
108
 
109
- ## Fully Qualified Domain Names
109
+ ## Fully qualified domain names
110
110
 
111
- 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.
112
112
 
113
113
  ```ruby
114
114
  # Parse a standard domain name
@@ -122,7 +122,7 @@ PublicSuffix.domain("www.google.com.")
122
122
 
123
123
  ## Private domains
124
124
 
125
- This library has support for switching off support for private (non-ICANN).
125
+ This library supports toggling private (non-ICANN) domain handling.
126
126
 
127
127
  ```ruby
128
128
  # Extract a domain including private domains (by default)
@@ -148,15 +148,15 @@ PublicSuffix.domain("something.blogspot.com")
148
148
  # => "blogspot.com"
149
149
  ```
150
150
 
151
- ## Add domain to list
151
+ ## Adding custom domains
152
152
 
153
- If you want to manually add a domain to the list just run:
153
+ To manually add a domain to the list:
154
154
 
155
155
  ```ruby
156
156
  PublicSuffix::List.default << PublicSuffix::Rule.factory('onmicrosoft.com')
157
157
  ```
158
158
 
159
- ## What is the Public Suffix List?
159
+ ## What is the public suffix list?
160
160
 
161
161
  The [Public Suffix List](https://publicsuffix.org) is a cross-vendor initiative to provide an accurate list of domain name suffixes.
162
162
 
@@ -165,7 +165,7 @@ The Public Suffix List is an initiative of the Mozilla Project, but is maintaine
165
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.
166
166
 
167
167
 
168
- ## Why the Public Suffix List is better than any available Regular Expression parser?
168
+ ## Why use the public suffix list instead of regular expressions?
169
169
 
170
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.
171
171
 
@@ -180,43 +180,52 @@ Source: https://wiki.mozilla.org/Public_Suffix_List
180
180
  Not convinced yet? Check out [this real world example](https://stackoverflow.com/q/288810/123527).
181
181
 
182
182
 
183
- ## Does <tt>PublicSuffix</tt> make requests to Public Suffix List website?
183
+ ## Does PublicSuffix make network requests?
184
184
 
185
- 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.
186
186
 
187
187
 
188
- ## Support
188
+ ## Terminology
189
189
 
190
- 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.
191
191
 
192
- - The PublicSuffix bug tracker is here: https://github.com/weppos/publicsuffix-ruby/issues
193
- - 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.
194
193
 
195
- [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.
196
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.`).
197
197
 
198
- ## Security and Vulnerability Reporting
199
198
 
200
- Full information and description of our security policy please visit [`SECURITY.md`](SECURITY.md)
199
+ ## Documentation and support
201
200
 
201
+ ### Documentation
202
202
 
203
- ## 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.
204
204
 
205
- See the [CHANGELOG.md](CHANGELOG.md) file for details.
205
+ ### Bug reports and contributions
206
206
 
207
+ - **Bug Tracker**: https://github.com/weppos/publicsuffix-ruby/issues
208
+ - **Code Repository**: https://github.com/weppos/publicsuffix-ruby
207
209
 
208
- ## 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.
209
211
 
210
- Copyright (c) 2009-2025 Simone Carletti. This is Free Software distributed under the MIT license.
212
+ ### Enterprise support
211
213
 
212
- 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.
213
215
 
214
- ## Definitions
215
216
 
216
- 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.
217
+ ## Security and vulnerability reporting
217
218
 
218
- 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.
219
+ For full information and details about our security policy, please visit [`SECURITY.md`](SECURITY.md).
220
+
221
+
222
+ ## Changelog
219
223
 
220
- 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.
224
+ See [CHANGELOG.md](CHANGELOG.md) for details.
221
225
 
222
- 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]`.
226
+
227
+ ## License
228
+
229
+ Copyright (c) 2009-2025 Simone Carletti. This is Free Software distributed under the MIT license.
230
+
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