public_suffix 5.0.1 → 5.0.5

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.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +25 -0
  3. data/LICENSE.txt +1 -1
  4. data/README.md +9 -2
  5. data/SECURITY.md +2 -81
  6. data/data/list.txt +3256 -1855
  7. data/lib/public_suffix/domain.rb +1 -1
  8. data/lib/public_suffix/errors.rb +1 -1
  9. data/lib/public_suffix/list.rb +1 -1
  10. data/lib/public_suffix/rule.rb +1 -1
  11. data/lib/public_suffix/version.rb +3 -4
  12. data/lib/public_suffix.rb +1 -1
  13. metadata +8 -42
  14. data/.github/FUNDING.yml +0 -12
  15. data/.github/dependabot.yml +0 -19
  16. data/.github/workflows/psl-update.yml +0 -38
  17. data/.github/workflows/release.yml +0 -18
  18. data/.github/workflows/tests.yml +0 -29
  19. data/.gitignore +0 -8
  20. data/.rubocop.yml +0 -37
  21. data/.rubocop_opinionated.yml +0 -135
  22. data/Gemfile +0 -14
  23. data/Rakefile +0 -52
  24. data/bin/console +0 -15
  25. data/public_suffix.gemspec +0 -29
  26. data/test/.empty +0 -2
  27. data/test/acceptance_test.rb +0 -131
  28. data/test/benchmarks/bm_find.rb +0 -66
  29. data/test/benchmarks/bm_find_all.rb +0 -102
  30. data/test/benchmarks/bm_names.rb +0 -91
  31. data/test/benchmarks/bm_select.rb +0 -26
  32. data/test/benchmarks/bm_select_incremental.rb +0 -25
  33. data/test/benchmarks/bm_valid.rb +0 -101
  34. data/test/profilers/domain_profiler.rb +0 -12
  35. data/test/profilers/find_profiler.rb +0 -12
  36. data/test/profilers/find_profiler_jp.rb +0 -12
  37. data/test/profilers/initialization_profiler.rb +0 -11
  38. data/test/profilers/list_profsize.rb +0 -11
  39. data/test/profilers/object_binsize.rb +0 -57
  40. data/test/psl_test.rb +0 -52
  41. data/test/test_helper.rb +0 -10
  42. data/test/tests.txt +0 -98
  43. data/test/unit/domain_test.rb +0 -106
  44. data/test/unit/errors_test.rb +0 -25
  45. data/test/unit/list_test.rb +0 -241
  46. data/test/unit/public_suffix_test.rb +0 -188
  47. data/test/unit/rule_test.rb +0 -222
@@ -4,7 +4,7 @@
4
4
  #
5
5
  # Domain name parser based on the Public Suffix List.
6
6
  #
7
- # Copyright (c) 2009-2022 Simone Carletti <weppos@weppos.net>
7
+ # Copyright (c) 2009-2024 Simone Carletti <weppos@weppos.net>
8
8
 
9
9
  module PublicSuffix
10
10
 
@@ -4,7 +4,7 @@
4
4
  #
5
5
  # Domain name parser based on the Public Suffix List.
6
6
  #
7
- # Copyright (c) 2009-2022 Simone Carletti <weppos@weppos.net>
7
+ # Copyright (c) 2009-2024 Simone Carletti <weppos@weppos.net>
8
8
 
9
9
  module PublicSuffix
10
10
 
@@ -4,7 +4,7 @@
4
4
  #
5
5
  # Domain name parser based on the Public Suffix List.
6
6
  #
7
- # Copyright (c) 2009-2022 Simone Carletti <weppos@weppos.net>
7
+ # Copyright (c) 2009-2024 Simone Carletti <weppos@weppos.net>
8
8
 
9
9
  module PublicSuffix
10
10
 
@@ -4,7 +4,7 @@
4
4
  #
5
5
  # Domain name parser based on the Public Suffix List.
6
6
  #
7
- # Copyright (c) 2009-2022 Simone Carletti <weppos@weppos.net>
7
+ # Copyright (c) 2009-2024 Simone Carletti <weppos@weppos.net>
8
8
 
9
9
  module PublicSuffix
10
10
 
@@ -1,15 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- #
4
3
  # = Public Suffix
5
4
  #
6
5
  # Domain name parser based on the Public Suffix List.
7
6
  #
8
- # Copyright (c) 2009-2022 Simone Carletti <weppos@weppos.net>
7
+ # Copyright (c) 2009-2024 Simone Carletti <weppos@weppos.net>
9
8
 
10
9
  module PublicSuffix
11
10
 
12
- # @return [String] The current library version.
13
- VERSION = "5.0.1"
11
+ # @return [String] the current library version
12
+ VERSION = "5.0.5"
14
13
 
15
14
  end
data/lib/public_suffix.rb CHANGED
@@ -4,7 +4,7 @@
4
4
  #
5
5
  # Domain name parser based on the Public Suffix List.
6
6
  #
7
- # Copyright (c) 2009-2022 Simone Carletti <weppos@weppos.net>
7
+ # Copyright (c) 2009-2024 Simone Carletti <weppos@weppos.net>
8
8
 
9
9
  require_relative "public_suffix/domain"
10
10
  require_relative "public_suffix/version"
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.1
4
+ version: 5.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simone Carletti
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-07 00:00:00.000000000 Z
11
+ date: 2024-04-02 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.
@@ -19,23 +19,12 @@ extensions: []
19
19
  extra_rdoc_files:
20
20
  - LICENSE.txt
21
21
  files:
22
- - ".github/FUNDING.yml"
23
- - ".github/dependabot.yml"
24
- - ".github/workflows/psl-update.yml"
25
- - ".github/workflows/release.yml"
26
- - ".github/workflows/tests.yml"
27
- - ".gitignore"
28
- - ".rubocop.yml"
29
- - ".rubocop_opinionated.yml"
30
22
  - ".yardopts"
31
23
  - 2.0-Upgrade.md
32
24
  - CHANGELOG.md
33
- - Gemfile
34
25
  - LICENSE.txt
35
26
  - README.md
36
- - Rakefile
37
27
  - SECURITY.md
38
- - bin/console
39
28
  - data/list.txt
40
29
  - lib/public_suffix.rb
41
30
  - lib/public_suffix/domain.rb
@@ -43,39 +32,16 @@ files:
43
32
  - lib/public_suffix/list.rb
44
33
  - lib/public_suffix/rule.rb
45
34
  - lib/public_suffix/version.rb
46
- - public_suffix.gemspec
47
- - test/.empty
48
- - test/acceptance_test.rb
49
- - test/benchmarks/bm_find.rb
50
- - test/benchmarks/bm_find_all.rb
51
- - test/benchmarks/bm_names.rb
52
- - test/benchmarks/bm_select.rb
53
- - test/benchmarks/bm_select_incremental.rb
54
- - test/benchmarks/bm_valid.rb
55
- - test/profilers/domain_profiler.rb
56
- - test/profilers/find_profiler.rb
57
- - test/profilers/find_profiler_jp.rb
58
- - test/profilers/initialization_profiler.rb
59
- - test/profilers/list_profsize.rb
60
- - test/profilers/object_binsize.rb
61
- - test/psl_test.rb
62
- - test/test_helper.rb
63
- - test/tests.txt
64
- - test/unit/domain_test.rb
65
- - test/unit/errors_test.rb
66
- - test/unit/list_test.rb
67
- - test/unit/public_suffix_test.rb
68
- - test/unit/rule_test.rb
69
35
  homepage: https://simonecarletti.com/code/publicsuffix-ruby
70
36
  licenses:
71
37
  - MIT
72
38
  metadata:
73
39
  bug_tracker_uri: https://github.com/weppos/publicsuffix-ruby/issues
74
40
  changelog_uri: https://github.com/weppos/publicsuffix-ruby/blob/master/CHANGELOG.md
75
- documentation_uri: https://rubydoc.info/gems/public_suffix/5.0.1
41
+ documentation_uri: https://rubydoc.info/gems/public_suffix/5.0.5
76
42
  homepage_uri: https://simonecarletti.com/code/publicsuffix-ruby
77
- source_code_uri: https://github.com/weppos/publicsuffix-ruby/tree/v5.0.1
78
- post_install_message:
43
+ source_code_uri: https://github.com/weppos/publicsuffix-ruby/tree/v5.0.5
44
+ post_install_message:
79
45
  rdoc_options: []
80
46
  require_paths:
81
47
  - lib
@@ -90,8 +56,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
90
56
  - !ruby/object:Gem::Version
91
57
  version: '0'
92
58
  requirements: []
93
- rubygems_version: 3.3.26
94
- signing_key:
59
+ rubygems_version: 3.5.3
60
+ signing_key:
95
61
  specification_version: 4
96
62
  summary: Domain name parser based on the Public Suffix List.
97
63
  test_files: []
data/.github/FUNDING.yml DELETED
@@ -1,12 +0,0 @@
1
- # These are supported funding model platforms
2
-
3
- github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4
- patreon: # Replace with a single Patreon username
5
- open_collective: # Replace with a single Open Collective username
6
- ko_fi: # Replace with a single Ko-fi username
7
- tidelift: "rubygems/public_suffix"
8
- community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9
- liberapay: # Replace with a single Liberapay username
10
- issuehunt: # Replace with a single IssueHunt username
11
- otechie: # Replace with a single Otechie username
12
- custom: # Replace with a single custom sponsorship URL
@@ -1,19 +0,0 @@
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
@@ -1,38 +0,0 @@
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 }}"
@@ -1,18 +0,0 @@
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
@@ -1,29 +0,0 @@
1
- name: Tests
2
-
3
- on:
4
- push:
5
- pull_request:
6
- workflow_dispatch:
7
-
8
- jobs:
9
- test:
10
- strategy:
11
- matrix:
12
- ruby-version:
13
- - "2.6"
14
- - "2.7"
15
- - "3.0"
16
- - "3.1"
17
- runs-on: ubuntu-latest
18
- steps:
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/.gitignore DELETED
@@ -1,8 +0,0 @@
1
- # Bundler
2
- /.bundle
3
- /Gemfile.lock
4
- /pkg/*
5
-
6
- # YARD
7
- /.yardoc
8
- /yardoc/
data/.rubocop.yml DELETED
@@ -1,37 +0,0 @@
1
- inherit_from:
2
- - .rubocop_opinionated.yml
3
-
4
- AllCops:
5
- Exclude:
6
- # Exclude .gemspec files because they are generally auto-generated
7
- - '*.gemspec'
8
- # Exclude vendored folders
9
- - 'tmp/**/*'
10
- - 'vendor/**/*'
11
- # Exclude artifacts
12
- - 'pkg/**/*'
13
- # Other
14
- - 'test/benchmarks/**/*'
15
- - 'test/profilers/**/*'
16
- TargetRubyVersion: 2.6
17
-
18
- # I often use @_variable to avoid clashing.
19
- Naming/MemoizedInstanceVariableName:
20
- Enabled: false
21
-
22
- Style/ClassAndModuleChildren:
23
- Exclude:
24
- - 'spec/**/*_spec.rb'
25
- - 'test/**/*_test.rb'
26
-
27
- # Dear Rubocop, I don't want to use String#strip_heredoc
28
- Layout/HeredocIndentation:
29
- Enabled: false
30
-
31
- Style/WordArray:
32
- Enabled: false
33
- MinSize: 3
34
-
35
- Style/SymbolArray:
36
- Enabled: false
37
- MinSize: 3
@@ -1,135 +0,0 @@
1
- AllCops:
2
- Exclude:
3
- # Exclude .gemspec files because they are generally auto-generated
4
- - '*.gemspec'
5
- # Exclude vendored folders
6
- - 'tmp/**/*'
7
- - 'vendor/**/*'
8
- NewCops: enable
9
-
10
- # [codesmell]
11
- Layout/LineLength:
12
- Enabled: false
13
- Exclude:
14
- - 'spec/**/*_spec.rb'
15
- - 'test/**/*_test.rb'
16
- Max: 100
17
-
18
- # [codesmell]
19
- Metrics/AbcSize:
20
- Enabled: false
21
- Exclude:
22
- - 'spec/**/*_spec.rb'
23
- - 'test/**/*_test.rb'
24
-
25
- # [codesmell]
26
- Metrics/BlockLength:
27
- Enabled: false
28
-
29
- # [codesmell]
30
- Metrics/CyclomaticComplexity:
31
- Enabled: false
32
- Exclude:
33
- - 'spec/**/*_spec.rb'
34
- - 'test/**/*_test.rb'
35
-
36
- # [codesmell]
37
- Metrics/ClassLength:
38
- Enabled: false
39
- Exclude:
40
- - 'spec/**/*_spec.rb'
41
- - 'test/**/*_test.rb'
42
-
43
- # [codesmell]
44
- Metrics/MethodLength:
45
- Enabled: false
46
- Exclude:
47
- - 'spec/**/*_spec.rb'
48
- - 'test/**/*_test.rb'
49
- Max: 10
50
-
51
- # [codesmell]
52
- Metrics/ModuleLength:
53
- Enabled: false
54
- Exclude:
55
- - 'spec/**/*_spec.rb'
56
- - 'test/**/*_test.rb'
57
-
58
- # [codesmell]
59
- Metrics/ParameterLists:
60
- Enabled: false
61
- Max: 5
62
-
63
- # [codesmell]
64
- Metrics/PerceivedComplexity:
65
- Enabled: false
66
-
67
- # Do not use "and" or "or" in conditionals, but for readability we can use it
68
- # to chain executions. Just beware of operator order.
69
- Style/AndOr:
70
- EnforcedStyle: conditionals
71
-
72
- Style/Documentation:
73
- Exclude:
74
- - 'spec/**/*'
75
- - 'test/**/*'
76
-
77
- # Double empty lines are useful to separate conceptually different methods
78
- # in the same class or module.
79
- Layout/EmptyLines:
80
- Enabled: false
81
-
82
- # In most cases, a space is nice. Sometimes, it's not.
83
- # Just be consistent with the rest of the surrounding code.
84
- Layout/EmptyLinesAroundClassBody:
85
- Enabled: false
86
-
87
- # In most cases, a space is nice. Sometimes, it's not.
88
- # Just be consistent with the rest of the surrounding code.
89
- Layout/EmptyLinesAroundModuleBody:
90
- Enabled: false
91
-
92
- # This is quite buggy, as it doesn't recognize double lines.
93
- # Double empty lines are useful to separate conceptually different methods
94
- # in the same class or module.
95
- Layout/EmptyLineBetweenDefs:
96
- Enabled: false
97
-
98
- # Annotated tokens (like %<foo>s) are a good thing, but in most cases we don't need them.
99
- # %s is a simpler and straightforward version that works in almost all cases. So don't complain.
100
- Style/FormatStringToken:
101
- Enabled: false
102
-
103
- # unless is not always cool.
104
- Style/NegatedIf:
105
- Enabled: false
106
-
107
- # There are cases were the inline rescue is ok. We can either downgrade the severity,
108
- # or rely on the developer judgement on a case-by-case basis.
109
- Style/RescueModifier:
110
- Enabled: false
111
-
112
- Style/SymbolArray:
113
- EnforcedStyle: brackets
114
-
115
- # Hate It or Love It, I prefer double quotes as this is more consistent
116
- # with several other programming languages and the output of puts and inspect.
117
- Style/StringLiterals:
118
- EnforcedStyle: double_quotes
119
-
120
- # It's nice to be consistent. The trailing comma also allows easy reordering,
121
- # and doesn't cause a diff in Git when you add a line to the bottom.
122
- Style/TrailingCommaInArrayLiteral:
123
- EnforcedStyleForMultiline: consistent_comma
124
- Style/TrailingCommaInHashLiteral:
125
- EnforcedStyleForMultiline: consistent_comma
126
-
127
- Style/TrivialAccessors:
128
- # IgnoreClassMethods because I want to be able to define class-level accessors
129
- # that sets an instance variable on the metaclass, such as:
130
- #
131
- # def self.default=(value)
132
- # @default = value
133
- # end
134
- #
135
- IgnoreClassMethods: true
data/Gemfile DELETED
@@ -1,14 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source "https://rubygems.org"
4
-
5
- gemspec
6
-
7
- gem "rake"
8
-
9
- gem "memory_profiler", require: false
10
- gem "minitest"
11
- gem "minitest-reporters"
12
- gem "mocha", "~> 2.0.1"
13
- gem "rubocop", require: false
14
- gem "yard"
data/Rakefile DELETED
@@ -1,52 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "bundler/gem_tasks"
4
-
5
- # By default, run tests and linter.
6
- task default: [:test, :rubocop]
7
-
8
-
9
- require "rake/testtask"
10
-
11
- Rake::TestTask.new do |t|
12
- t.libs = %w[lib test]
13
- t.pattern = "test/**/*_test.rb"
14
- t.verbose = !ENV["VERBOSE"].nil?
15
- t.warning = !ENV["WARNING"].nil?
16
- end
17
-
18
- require "rubocop/rake_task"
19
-
20
- RuboCop::RakeTask.new
21
-
22
-
23
- require "yard"
24
- require "yard/rake/yardoc_task"
25
-
26
- YARD::Rake::YardocTask.new(:yardoc) do |y|
27
- y.options = ["--output-dir", "yardoc"]
28
- end
29
-
30
- CLOBBER.include "yardoc"
31
-
32
-
33
- task :benchmarks do
34
- Dir["benchmarks/bm_*.rb"].each do |file|
35
- sh "ruby #{file}"
36
- end
37
- end
38
- task default: [:benchmarks] if ENV["BENCHMARKS"] == "1"
39
-
40
-
41
- desc "Downloads the Public Suffix List file from the repository and stores it locally."
42
- task :"update-list" do
43
- require "net/http"
44
-
45
- definition_url = "https://raw.githubusercontent.com/publicsuffix/list/master/public_suffix_list.dat"
46
-
47
- File.open("data/list.txt", "w+") do |f|
48
- response = Net::HTTP.get_response(URI.parse(definition_url))
49
- response.body
50
- f.write(response.body)
51
- end
52
- end
data/bin/console DELETED
@@ -1,15 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require "bundler/setup"
5
- require "public_suffix"
6
-
7
- # You can add fixtures and/or initialization code here to make experimenting
8
- # with your gem easier. You can also use a different console, if you like.
9
-
10
- # (If you use this, don't forget to add pry to your Gemfile!)
11
- # require "pry"
12
- # Pry.start
13
-
14
- require "irb"
15
- IRB.start
@@ -1,29 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
- $LOAD_PATH.push File.expand_path("../lib", __FILE__)
3
- require "public_suffix/version"
4
-
5
- Gem::Specification.new do |s|
6
- s.name = "public_suffix"
7
- s.version = PublicSuffix::VERSION
8
- s.authors = ["Simone Carletti"]
9
- s.email = ["weppos@weppos.net"]
10
- s.homepage = "https://simonecarletti.com/code/publicsuffix-ruby"
11
- s.summary = "Domain name parser based on the Public Suffix List."
12
- s.description = "PublicSuffix can parse and decompose a domain name into top level domain, domain and subdomains."
13
- s.licenses = ["MIT"]
14
-
15
- s.metadata = {
16
- "bug_tracker_uri" => "https://github.com/weppos/publicsuffix-ruby/issues",
17
- "changelog_uri" => "https://github.com/weppos/publicsuffix-ruby/blob/master/CHANGELOG.md",
18
- "documentation_uri" => "https://rubydoc.info/gems/#{s.name}/#{s.version}",
19
- "homepage_uri" => s.homepage,
20
- "source_code_uri" => "https://github.com/weppos/publicsuffix-ruby/tree/v#{s.version}",
21
- }
22
-
23
- s.required_ruby_version = ">= 2.6"
24
-
25
- s.require_paths = ["lib"]
26
- s.files = `git ls-files`.split("\n")
27
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
28
- s.extra_rdoc_files = %w( LICENSE.txt )
29
- end
data/test/.empty DELETED
@@ -1,2 +0,0 @@
1
- # This is an empty file I use to force a non-empty commit when I only need to store notes
2
- ..