public_suffix 5.0.5 → 5.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -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(value: value, length: length, private: private)
233
+ super
234
234
  length or @length += 1 # * counts as 1
235
235
  end
236
236
 
@@ -9,6 +9,6 @@
9
9
  module PublicSuffix
10
10
 
11
11
  # @return [String] the current library version
12
- VERSION = "5.0.5"
12
+ VERSION = "5.1.0"
13
13
 
14
14
  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: 5.0.5
4
+ version: 5.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simone Carletti
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-04-02 00:00:00.000000000 Z
11
+ date: 2024-06-15 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.
@@ -20,7 +20,6 @@ extra_rdoc_files:
20
20
  - LICENSE.txt
21
21
  files:
22
22
  - ".yardopts"
23
- - 2.0-Upgrade.md
24
23
  - CHANGELOG.md
25
24
  - LICENSE.txt
26
25
  - README.md
@@ -38,9 +37,9 @@ licenses:
38
37
  metadata:
39
38
  bug_tracker_uri: https://github.com/weppos/publicsuffix-ruby/issues
40
39
  changelog_uri: https://github.com/weppos/publicsuffix-ruby/blob/master/CHANGELOG.md
41
- documentation_uri: https://rubydoc.info/gems/public_suffix/5.0.5
40
+ documentation_uri: https://rubydoc.info/gems/public_suffix/5.1.0
42
41
  homepage_uri: https://simonecarletti.com/code/publicsuffix-ruby
43
- source_code_uri: https://github.com/weppos/publicsuffix-ruby/tree/v5.0.5
42
+ source_code_uri: https://github.com/weppos/publicsuffix-ruby/tree/v5.1.0
44
43
  post_install_message:
45
44
  rdoc_options: []
46
45
  require_paths:
@@ -49,14 +48,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
49
48
  requirements:
50
49
  - - ">="
51
50
  - !ruby/object:Gem::Version
52
- version: '2.6'
51
+ version: '3.0'
53
52
  required_rubygems_version: !ruby/object:Gem::Requirement
54
53
  requirements:
55
54
  - - ">="
56
55
  - !ruby/object:Gem::Version
57
56
  version: '0'
58
57
  requirements: []
59
- rubygems_version: 3.5.3
58
+ rubygems_version: 3.5.11
60
59
  signing_key:
61
60
  specification_version: 4
62
61
  summary: Domain name parser based on the Public Suffix List.
data/2.0-Upgrade.md DELETED
@@ -1,52 +0,0 @@
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
- ````