public_suffix 5.1.0 → 5.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 327877edc15d2e701fe28dde5ebee9822842233c92796337604bf4b27db58c4a
4
- data.tar.gz: c209561b2462cdee41e5752592781ee9ac598d314c0cf2743a32e904e6b1243b
3
+ metadata.gz: f95fd278200cbe3922d07b90ca7b51231509770ff2df64b45f1f0dd0aae532b5
4
+ data.tar.gz: 8ca654313480fdb64b80d1ac2e54150cc594d731a88dfee4a125c8a32bb6aecc
5
5
  SHA512:
6
- metadata.gz: 0fc0513322551207e40fb215cf9b23470cf4c543d327ed66f87d0e05975c19eac11565102a80a1ec3bc97faa5dbdfc16d453b8172e994b31b8c8070de15a31a3
7
- data.tar.gz: dea7ecb1c8486167400761171c38d521b2b29e36a11ae61180a888159381f725548bef7f1c61101fdf018f8faab5ac1366afb1e1b2627f90143b8d906bb7d906
6
+ metadata.gz: e7f9ae38d463e8ef8355e033606d5f0a7689976054127f9d5a32b9e0af0bca7f54fa3287678d85def68e73a3fc466fc01d4b39db511386e121ac8bab1fe8c728
7
+ data.tar.gz: 22bf9f457b5d961de5a8e40de03558bdca814bf565343ed0024be69b71b789b538ca497b856bfa9f294b9cbfcf4c9cf48d9fd7670628f5e0684dc05afa528d1c
data/2.0-Upgrade.md ADDED
@@ -0,0 +1,52 @@
1
+ # Welcome to PublicSuffix 2.0!
2
+
3
+ PublicSuffix 2.0 contains a rewritten internal representation and comparison logic, that drastically increases the lookup performance. The new version also changes several internal and external API.
4
+
5
+ This document documents the most relevant changes to help you upgrading from PublicSuffix 1.0 to 2.0.
6
+
7
+ ## What's New
8
+
9
+ - The library is now 100% compliants with the official PublicSuffix tests. The major breaking change you may experience, is that if a domain passed as input doesn't match any rule, the rule `*` is assumed. You can override this behavior by passing a custom default rule with the `default_rule` option. The old behavior can be restored by passing `default_rule: nil`.
10
+ - `PublicSuffix.domain` is a new method that parses the input and returns the domain (combination of second level domain + suffix). This is a convenient helper to parse a domain name, for example when you need to determine the cookie or SSL scope.
11
+ - Added the ability to disable the use of private domains either at runtime, in addition to the ability to not load the private domains section when reading the list (`private_domains: false`). This feature also superseded the `private_domains` class-level attribute, that is no longer available.
12
+
13
+ ## Upgrade
14
+
15
+ When upgrading, here's the most relevant changes to keep an eye on:
16
+
17
+ - Several futile utility helpers were removed, such as `Domain#rule`, `Domain#is_a_domain?`, `Domain#is_a_subdomain?`, `Domain#valid?`. You can easily obtain the same result by having a custom method that reconstructs the logic, and/or calling `PublicSuffix.{domain|parse}(domain.to_s)`.
18
+ - `PublicSuffix::List.private_domains` is no longer available. Instead, you now have two ways to enable/disable the private domains:
19
+
20
+ 1. At runtime, by using the `ignore_private` option
21
+
22
+ ```ruby
23
+ PublicSuffix.domain("something.blogspot.com", ignore_private: true)
24
+ ```
25
+
26
+ 1. Loading a filtered list:
27
+
28
+ ```ruby
29
+ # Disable support for private TLDs
30
+ PublicSuffix::List.default = PublicSuffix::List.parse(File.read(PublicSuffix::List::DEFAULT_LIST_PATH), private_domains: false)
31
+ # => "blogspot.com"
32
+ PublicSuffix.domain("something.blogspot.com")
33
+ # => "blogspot.com"
34
+ ```
35
+ - Now that the library is 100% compliant with the official PublicSuffix algorithm, if a domain passed as input doesn't match any rule, the wildcard rule `*` is assumed. This means that unlisted TLDs will be considered valid by default, when they would have been invalid in 1.x. However, you can override this behavior to emulate the 1.x behavior if needed:
36
+
37
+ ```ruby
38
+ # 1.x:
39
+
40
+ PublicSuffix.valid?("google.commm")
41
+ # => false
42
+
43
+ # 2.x:
44
+
45
+ PublicSuffix.valid?("google.commm")
46
+ # => true
47
+
48
+ # Overriding 2.x behavior if needed:
49
+
50
+ PublicSuffix.valid?("google.commm", default_rule: nil)
51
+ # => false
52
+ ````
data/CHANGELOG.md CHANGED
@@ -2,13 +2,9 @@
2
2
 
3
3
  This project uses [Semantic Versioning 2.0.0](https://semver.org/).
4
4
 
5
+ ## 5.1.1
5
6
 
6
- ## 5.1.0
7
-
8
- ### Changed
9
-
10
- - Updated definitions.
11
- - Minimum Ruby version is 3.0
7
+ No significant changes. Releasing a mini version to address 5.1.0 release with major ruby requirement change (GH-315).
12
8
 
13
9
 
14
10
  ## 5.0.5
@@ -17,7 +13,6 @@ This project uses [Semantic Versioning 2.0.0](https://semver.org/).
17
13
 
18
14
  - Updated definitions.
19
15
 
20
-
21
16
  ## 5.0.4
22
17
 
23
18
  ### Changed
@@ -25,21 +20,18 @@ This project uses [Semantic Versioning 2.0.0](https://semver.org/).
25
20
  - Reduced .gem file size (GH-258). [Thanks @ybiquitous]
26
21
  - Updated definitions.
27
22
 
28
-
29
23
  ## 5.0.3
30
24
 
31
25
  ### Fixed
32
26
 
33
27
  - Fixed automated release workflow.
34
28
 
35
-
36
29
  ## 5.0.2
37
30
 
38
31
  ### Changed
39
32
 
40
33
  - Updated definitions.
41
34
 
42
-
43
35
  ## 5.0.1
44
36
 
45
37
  ### Changed
@@ -52,6 +44,7 @@ This project uses [Semantic Versioning 2.0.0](https://semver.org/).
52
44
  ### Changed
53
45
 
54
46
  - Minimum Ruby version is 2.6
47
+
55
48
  - Updated definitions.
56
49
 
57
50
 
data/README.md CHANGED
@@ -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
+ <tt>PublicSuffix</tt> requires **Ruby >= 2.6**. For an older versions of Ruby use a previous release.
20
20
 
21
21
 
22
22
  ## Installation
@@ -33,6 +33,8 @@ 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
+
36
38
  ## Usage
37
39
 
38
40
  Extract the domain out from a name:
data/SECURITY.md CHANGED
@@ -4,7 +4,8 @@
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. 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.
8
+ This project uses [semantic versioning](https://semver.org/), therefore you can upgrade to a more recent minor version without incurring into breaking changes.
8
9
 
9
10
  Exceptionally, we may support previous minor versions upon request if there are significant reasons preventing to immediately switch the latest minor version.
10
11