public_suffix 4.0.7 → 5.0.0

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: 4ea7129dc0659a87fad96459afefddaafdb4280eac62895e036ce1e2bcf14d91
4
- data.tar.gz: a335705e6ba76d959f52b3e4acea7be1f97c472af3b05a34cd15bae9a3301582
3
+ metadata.gz: 5b1625010ec369824aa7c3dd4e4b8aa63cf7f87566d7bcfc2a9784f0ff5fca09
4
+ data.tar.gz: 4bbc75c106415e2d8500d208d347bb0ccdd05c1f5d3a45f2f0f46a8e8793540c
5
5
  SHA512:
6
- metadata.gz: 1d1a8d2f55e733e6f2ed7f7ed233cda997e55b0838b2926488c15e86586a72329ee2392af7ccc94dd3a5b04c60f3bbd0358fe38c0f4e82e0c13ae513a0dafdf4
7
- data.tar.gz: aced9afff807ed3c71457871d68b56f7288cff8e5379da534f9deccea735ca1911074b7f300795f021e7b17a1ccf4ced27630efd3d1dd667c10a998b611fb71c
6
+ metadata.gz: f55456d5f1c4e679b99339578d4da0c3f5462dfdf9969fcabca658748d3d72acf6036ae79db13d6db6a3b04b78be94ee079d1f28d065c2b416ec7bf21fb6ba7d
7
+ data.tar.gz: 0b2705ab2b6e8d743d54b6bb4cf22d306d215dcac11a4b49d1dd0ac1c04332ae80dcb87f305c2a2ebf7a554b24ad31dd31525f5be6fb7858e67e5ebfcc53d8ff
@@ -0,0 +1,38 @@
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,14 +1,16 @@
1
- name: release
1
+ name: Release
2
2
 
3
3
  on:
4
4
  push:
5
5
  tags:
6
6
  - v*.*.*
7
+
7
8
  jobs:
8
9
  release:
9
10
  runs-on: ubuntu-latest
10
11
  steps:
11
- - uses: actions/checkout@v2
12
+ - name: Checkout
13
+ uses: actions/checkout@v3
12
14
  - name: Release Gem
13
15
  uses: cadwallion/publish-rubygems-action@8f9e0538302643309e4e43bf48cd34173ca48cfc
14
16
  env:
@@ -6,7 +6,7 @@ on:
6
6
  workflow_dispatch:
7
7
 
8
8
  jobs:
9
- build:
9
+ test:
10
10
  strategy:
11
11
  matrix:
12
12
  ruby-version:
@@ -14,15 +14,16 @@ jobs:
14
14
  - "2.7"
15
15
  - "3.0"
16
16
  - "3.1"
17
- platform: [ubuntu-latest]
18
- runs-on: ${{ matrix.platform }}
17
+ runs-on: ubuntu-latest
19
18
  steps:
20
- - uses: actions/checkout@v2
19
+ - name: Checkout
20
+ uses: actions/checkout@v3
21
21
  - name: Set up Ruby
22
22
  uses: ruby/setup-ruby@v1
23
23
  with:
24
24
  ruby-version: ${{ matrix.ruby-version }}
25
- - name: Install dependencies
26
- run: bundle install
25
+ bundler-cache: true
26
+ - name: Rubocop
27
+ run: bundle exec rake rubocop
27
28
  - name: Run tests
28
- run: bundle exec rake
29
+ run: bundle exec rake test
data/.rubocop.yml CHANGED
@@ -13,6 +13,7 @@ AllCops:
13
13
  # Other
14
14
  - 'test/benchmarks/**/*'
15
15
  - 'test/profilers/**/*'
16
+ TargetRubyVersion: 2.6
16
17
 
17
18
  # I often use @_variable to avoid clashing.
18
19
  Naming/MemoizedInstanceVariableName:
@@ -15,12 +15,6 @@ Layout/LineLength:
15
15
  - 'test/**/*_test.rb'
16
16
  Max: 100
17
17
 
18
- Lint/ConstantDefinitionInBlock:
19
- Exclude:
20
- - 'Rakefile'
21
- - 'spec/**/*'
22
- - 'test/**/*'
23
-
24
18
  # [codesmell]
25
19
  Metrics/AbcSize:
26
20
  Enabled: false
@@ -101,12 +95,6 @@ Layout/EmptyLinesAroundModuleBody:
101
95
  Layout/EmptyLineBetweenDefs:
102
96
  Enabled: false
103
97
 
104
- # I personally don't care about the format style.
105
- # In most cases I like to use %, but not at the point I want to enforce it
106
- # as a convention in the entire code.
107
- Style/FormatString:
108
- Enabled: false
109
-
110
98
  # Annotated tokens (like %<foo>s) are a good thing, but in most cases we don't need them.
111
99
  # %s is a simpler and straightforward version that works in almost all cases. So don't complain.
112
100
  Style/FormatStringToken:
@@ -116,11 +104,6 @@ Style/FormatStringToken:
116
104
  Style/NegatedIf:
117
105
  Enabled: false
118
106
 
119
- # For years, %w() has been the de-facto standard. A lot of libraries are using ().
120
- # Switching to [] would be a nightmare.
121
- Style/PercentLiteralDelimiters:
122
- Enabled: false
123
-
124
107
  # There are cases were the inline rescue is ok. We can either downgrade the severity,
125
108
  # or rely on the developer judgement on a case-by-case basis.
126
109
  Style/RescueModifier:
@@ -129,17 +112,6 @@ Style/RescueModifier:
129
112
  Style/SymbolArray:
130
113
  EnforcedStyle: brackets
131
114
 
132
- # Sorry, but using trailing spaces helps readability.
133
- #
134
- # %w( foo bar )
135
- #
136
- # looks better to me than
137
- #
138
- # %w( foo bar )
139
- #
140
- Layout/SpaceInsidePercentLiteralDelimiters:
141
- Enabled: false
142
-
143
115
  # Hate It or Love It, I prefer double quotes as this is more consistent
144
116
  # with several other programming languages and the output of puts and inspect.
145
117
  Style/StringLiterals:
data/CHANGELOG.md CHANGED
@@ -3,6 +3,15 @@
3
3
  This project uses [Semantic Versioning 2.0.0](https://semver.org/).
4
4
 
5
5
 
6
+ ## 5.0.0
7
+
8
+ ### Changed
9
+
10
+ - Minimum Ruby version is 2.6
11
+
12
+ - Updated definitions.
13
+
14
+
6
15
  ## 4.0.7
7
16
 
8
17
  ### Fixes
data/Gemfile CHANGED
@@ -10,5 +10,5 @@ gem "memory_profiler", require: false
10
10
  gem "minitest"
11
11
  gem "minitest-reporters"
12
12
  gem "mocha"
13
- gem "rubocop", "~>0.90", require: false
13
+ gem "rubocop", require: false
14
14
  gem "yard"
data/README.md CHANGED
@@ -16,7 +16,7 @@
16
16
 
17
17
  ## Requirements
18
18
 
19
- <tt>PublicSuffix</tt> requires **Ruby >= 2.3**. 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
data/Rakefile CHANGED
@@ -9,7 +9,7 @@ task default: [:test, :rubocop]
9
9
  require "rake/testtask"
10
10
 
11
11
  Rake::TestTask.new do |t|
12
- t.libs = %w( lib test )
12
+ t.libs = %w[lib test]
13
13
  t.pattern = "test/**/*_test.rb"
14
14
  t.verbose = !ENV["VERBOSE"].nil?
15
15
  t.warning = !ENV["WARNING"].nil?
@@ -42,10 +42,10 @@ desc "Downloads the Public Suffix List file from the repository and stores it lo
42
42
  task :"update-list" do
43
43
  require "net/http"
44
44
 
45
- DEFINITION_URL = "https://raw.githubusercontent.com/publicsuffix/list/master/public_suffix_list.dat"
45
+ definition_url = "https://raw.githubusercontent.com/publicsuffix/list/master/public_suffix_list.dat"
46
46
 
47
47
  File.open("data/list.txt", "w+") do |f|
48
- response = Net::HTTP.get_response(URI.parse(DEFINITION_URL))
48
+ response = Net::HTTP.get_response(URI.parse(definition_url))
49
49
  response.body
50
50
  f.write(response.body)
51
51
  end
data/data/list.txt CHANGED
@@ -1340,7 +1340,7 @@ tt.im
1340
1340
  tv.im
1341
1341
 
1342
1342
  // in : https://en.wikipedia.org/wiki/.in
1343
- // see also: https://registry.in/Policies
1343
+ // see also: https://registry.in/policies
1344
1344
  // Please note, that nic.in is not an official eTLD, but used by most
1345
1345
  // government institutions.
1346
1346
  in
@@ -7130,7 +7130,7 @@ org.zw
7130
7130
 
7131
7131
  // newGTLDs
7132
7132
 
7133
- // List of new gTLDs imported from https://www.icann.org/resources/registries/gtlds/v2/gtlds.json on 2022-03-27T15:13:38Z
7133
+ // List of new gTLDs imported from https://www.icann.org/resources/registries/gtlds/v2/gtlds.json on 2022-07-03T15:13:53Z
7134
7134
  // This list is auto-generated, don't edit it manually.
7135
7135
  // aaa : 2015-02-26 American Automobile Association, Inc.
7136
7136
  aaa
@@ -7471,7 +7471,7 @@ bio
7471
7471
  // black : 2014-01-16 Afilias Limited
7472
7472
  black
7473
7473
 
7474
- // blackfriday : 2014-01-16 UNR Corp.
7474
+ // blackfriday : 2014-01-16 Registry Services, LLC
7475
7475
  blackfriday
7476
7476
 
7477
7477
  // blockbuster : 2015-07-30 Dish DBS Corporation
@@ -7687,7 +7687,7 @@ chanel
7687
7687
  // channel : 2014-05-08 Charleston Road Registry Inc.
7688
7688
  channel
7689
7689
 
7690
- // charity : 2018-04-11 Binky Moon, LLC
7690
+ // charity : 2018-04-11 Public Interest Registry
7691
7691
  charity
7692
7692
 
7693
7693
  // chase : 2015-04-30 JPMorgan Chase Bank, National Association
@@ -7834,7 +7834,7 @@ coupon
7834
7834
  // coupons : 2015-03-26 Binky Moon, LLC
7835
7835
  coupons
7836
7836
 
7837
- // courses : 2014-12-04 OPEN UNIVERSITIES AUSTRALIA PTY LTD
7837
+ // courses : 2014-12-04 Registry Services, LLC
7838
7838
  courses
7839
7839
 
7840
7840
  // cpa : 2019-06-10 American Institute of Certified Public Accountants
@@ -8020,7 +8020,7 @@ dvag
8020
8020
  // dvr : 2016-05-26 DISH Technologies L.L.C.
8021
8021
  dvr
8022
8022
 
8023
- // earth : 2014-12-04 Interlink Co., Ltd.
8023
+ // earth : 2014-12-04 Interlink Systems Innovation Institute K.K.
8024
8024
  earth
8025
8025
 
8026
8026
  // eat : 2014-01-23 Charleston Road Registry Inc.
@@ -8227,7 +8227,7 @@ forsale
8227
8227
  // forum : 2015-04-02 Fegistry, LLC
8228
8228
  forum
8229
8229
 
8230
- // foundation : 2013-12-05 Binky Moon, LLC
8230
+ // foundation : 2013-12-05 Public Interest Registry
8231
8231
  foundation
8232
8232
 
8233
8233
  // fox : 2015-09-11 FOX Registry, LLC
@@ -8308,7 +8308,7 @@ gdn
8308
8308
  // gea : 2014-12-04 GEA Group Aktiengesellschaft
8309
8309
  gea
8310
8310
 
8311
- // gent : 2014-01-23 COMBELL NV
8311
+ // gent : 2014-01-23 Easyhost BV
8312
8312
  gent
8313
8313
 
8314
8314
  // genting : 2015-03-12 Resorts World Inc Pte. Ltd.
@@ -8326,7 +8326,7 @@ gift
8326
8326
  // gifts : 2014-07-03 Binky Moon, LLC
8327
8327
  gifts
8328
8328
 
8329
- // gives : 2014-03-06 Dog Beach, LLC
8329
+ // gives : 2014-03-06 Public Interest Registry
8330
8330
  gives
8331
8331
 
8332
8332
  // giving : 2014-11-13 Giving Limited
@@ -8452,7 +8452,7 @@ health
8452
8452
  // healthcare : 2014-06-12 Binky Moon, LLC
8453
8453
  healthcare
8454
8454
 
8455
- // help : 2014-06-26 UNR Corp.
8455
+ // help : 2014-06-26 Innovation service Limited
8456
8456
  help
8457
8457
 
8458
8458
  // helsinki : 2015-02-05 City of Helsinki
@@ -8851,7 +8851,7 @@ lincoln
8851
8851
  // linde : 2014-12-04 Linde Aktiengesellschaft
8852
8852
  linde
8853
8853
 
8854
- // link : 2013-11-14 UNR Corp.
8854
+ // link : 2013-11-14 Nova Registry Ltd
8855
8855
  link
8856
8856
 
8857
8857
  // lipsy : 2015-06-25 Lipsy Ltd
@@ -8866,7 +8866,7 @@ living
8866
8866
  // llc : 2017-12-14 Afilias Limited
8867
8867
  llc
8868
8868
 
8869
- // llp : 2019-08-26 UNR Corp.
8869
+ // llp : 2019-08-26 Intercap Registry Inc.
8870
8870
  llp
8871
8871
 
8872
8872
  // loan : 2014-11-20 dot Loan Limited
@@ -9034,7 +9034,7 @@ mobile
9034
9034
  // moda : 2013-11-07 Dog Beach, LLC
9035
9035
  moda
9036
9036
 
9037
- // moe : 2013-11-13 Interlink Co., Ltd.
9037
+ // moe : 2013-11-13 Interlink Systems Innovation Institute K.K.
9038
9038
  moe
9039
9039
 
9040
9040
  // moi : 2014-12-18 Amazon Registry Services, Inc.
@@ -9307,7 +9307,7 @@ philips
9307
9307
  // phone : 2016-06-02 Dish DBS Corporation
9308
9308
  phone
9309
9309
 
9310
- // photo : 2013-11-14 UNR Corp.
9310
+ // photo : 2013-11-14 Registry Services, LLC
9311
9311
  photo
9312
9312
 
9313
9313
  // photography : 2013-09-20 Binky Moon, LLC
@@ -9550,7 +9550,7 @@ rsvp
9550
9550
  // rugby : 2016-12-15 World Rugby Strategic Developments Limited
9551
9551
  rugby
9552
9552
 
9553
- // ruhr : 2013-10-02 regiodot GmbH & Co. KG
9553
+ // ruhr : 2013-10-02 dotSaarland GmbH
9554
9554
  ruhr
9555
9555
 
9556
9556
  // run : 2015-03-19 Binky Moon, LLC
@@ -9841,7 +9841,7 @@ stream
9841
9841
  // studio : 2015-02-11 Dog Beach, LLC
9842
9842
  studio
9843
9843
 
9844
- // study : 2014-12-11 OPEN UNIVERSITIES AUSTRALIA PTY LTD
9844
+ // study : 2014-12-11 Registry Services, LLC
9845
9845
  study
9846
9846
 
9847
9847
  // style : 2014-12-04 Binky Moon, LLC
@@ -9901,7 +9901,7 @@ tatamotors
9901
9901
  // tatar : 2014-04-24 Limited Liability Company "Coordination Center of Regional Domain of Tatarstan Republic"
9902
9902
  tatar
9903
9903
 
9904
- // tattoo : 2013-08-30 UNR Corp.
9904
+ // tattoo : 2013-08-30 Top Level Design, LLC
9905
9905
  tattoo
9906
9906
 
9907
9907
  // tax : 2014-03-20 Binky Moon, LLC
@@ -12111,6 +12111,7 @@ kill.jp
12111
12111
  kilo.jp
12112
12112
  kuron.jp
12113
12113
  littlestar.jp
12114
+ lolipopmc.jp
12114
12115
  lolitapunk.jp
12115
12116
  lomo.jp
12116
12117
  lovepop.jp
@@ -12281,6 +12282,10 @@ blogspot.vn
12281
12282
  // Submitted by Niels Martignene <hello@goupile.fr>
12282
12283
  goupile.fr
12283
12284
 
12285
+ // Government of the Netherlands: https://www.government.nl
12286
+ // Submitted by <domeinnaam@minaz.nl>
12287
+ gov.nl
12288
+
12284
12289
  // Group 53, LLC : https://www.group53.com
12285
12290
  // Submitted by Tyler Todd <noc@nova53.net>
12286
12291
  awsmppl.com
@@ -12357,7 +12362,6 @@ ltd.ng
12357
12362
  ngo.ng
12358
12363
  edu.scot
12359
12364
  sch.so
12360
- org.yt
12361
12365
 
12362
12366
  // HostyHosting (hostyhosting.com)
12363
12367
  hostyhosting.io
@@ -12375,6 +12379,11 @@ moonscale.net
12375
12379
  // Submitted by Hannu Aronsson <haa@iki.fi>
12376
12380
  iki.fi
12377
12381
 
12382
+ // iliad italia: https://www.iliad.it
12383
+ // Submitted by Marios Makassikis <mmakassikis@freebox.fr>
12384
+ ibxos.it
12385
+ iliadboxos.it
12386
+
12378
12387
  // Impertrix Solutions : <https://impertrixcdn.com>
12379
12388
  // Submitted by Zhixiang Zhao <csuite@impertrix.com>
12380
12389
  impertrixcdn.com
@@ -12455,9 +12464,11 @@ iopsys.se
12455
12464
  // Submitted by Matthew Hardeman <mhardeman@ipifony.com>
12456
12465
  ipifony.net
12457
12466
 
12458
- // IServ GmbH : https://iserv.eu
12459
- // Submitted by Kim-Alexander Brodowski <info@iserv.eu>
12467
+ // IServ GmbH : https://iserv.de
12468
+ // Submitted by Mario Hoberg <info@iserv.de>
12469
+ iservschule.de
12460
12470
  mein-iserv.de
12471
+ schulplattform.de
12461
12472
  schulserver.de
12462
12473
  test-iserv.de
12463
12474
  iserv.dev
@@ -12779,6 +12790,10 @@ hra.health
12779
12790
  miniserver.com
12780
12791
  memset.net
12781
12792
 
12793
+ // Messerli Informatik AG : https://www.messerli.ch/
12794
+ // Submitted by Ruben Schmidmeister <psl-maintainers@messerli.ch>
12795
+ messerli.app
12796
+
12782
12797
  // MetaCentrum, CESNET z.s.p.o. : https://www.metacentrum.cz/en/
12783
12798
  // Submitted by Zdeněk Šustr <zdenek.sustr@cesnet.cz>
12784
12799
  *.cloud.metacentrum.cz
@@ -12798,12 +12813,13 @@ eu.meteorapp.com
12798
12813
  co.pl
12799
12814
 
12800
12815
  // Microsoft Corporation : http://microsoft.com
12801
- // Submitted by Mitch Webster <miwebst@microsoft.com>
12816
+ // Submitted by Public Suffix List Admin <msftpsladmin@microsoft.com>
12802
12817
  *.azurecontainer.io
12803
12818
  azurewebsites.net
12804
12819
  azure-mobile.net
12805
12820
  cloudapp.net
12806
12821
  azurestaticapps.net
12822
+ 1.azurestaticapps.net
12807
12823
  centralus.azurestaticapps.net
12808
12824
  eastasia.azurestaticapps.net
12809
12825
  eastus2.azurestaticapps.net
@@ -13388,6 +13404,12 @@ rocky.page
13388
13404
  спб.рус
13389
13405
  я.рус
13390
13406
 
13407
+ // Salesforce.com, Inc. https://salesforce.com/
13408
+ // Submitted by Michael Biven <mbiven@salesforce.com>
13409
+ *.builder.code.com
13410
+ *.dev-builder.code.com
13411
+ *.stg-builder.code.com
13412
+
13391
13413
  // Sandstorm Development Group, Inc. : https://sandcats.io/
13392
13414
  // Submitted by Asheesh Laroia <asheesh@sandstorm.io>
13393
13415
  sandcats.io
@@ -13811,6 +13833,15 @@ hk.org
13811
13833
  ltd.hk
13812
13834
  inc.hk
13813
13835
 
13836
+ // UNIVERSAL DOMAIN REGISTRY : https://www.udr.org.yt/
13837
+ // see also: whois -h whois.udr.org.yt help
13838
+ // Submitted by Atanunu Igbunuroghene <publicsuffixlist@udr.org.yt>
13839
+ name.pm
13840
+ sch.tf
13841
+ biz.wf
13842
+ sch.wf
13843
+ org.yt
13844
+
13814
13845
  // United Gameserver GmbH : https://united-gameserver.de
13815
13846
  // Submitted by Stefan Schwarz <sysadm@united-gameserver.de>
13816
13847
  virtualuser.de
@@ -87,7 +87,7 @@ module PublicSuffix
87
87
  section = 2
88
88
 
89
89
  # skip comments
90
- when line.start_with?(comment_token)
90
+ when line.start_with?(comment_token) # rubocop:disable Lint/DuplicateBranch
91
91
  next
92
92
 
93
93
  else
@@ -125,7 +125,7 @@ module PublicSuffix
125
125
  # @param private [Boolean]
126
126
  def initialize(value:, length: nil, private: false)
127
127
  @value = value.to_s
128
- @length = length || @value.count(DOT) + 1
128
+ @length = length || (@value.count(DOT) + 1)
129
129
  @private = private
130
130
  end
131
131
 
@@ -161,7 +161,7 @@ module PublicSuffix
161
161
  # @param name [String] the domain name to check
162
162
  # @return [Boolean]
163
163
  def match?(name)
164
- # Note: it works because of the assumption there are no
164
+ # NOTE: it works because of the assumption there are no
165
165
  # rules like foo.*.com. If the assumption is incorrect,
166
166
  # we need to properly walk the input and skip parts according
167
167
  # to wildcard component.
@@ -221,7 +221,7 @@ module PublicSuffix
221
221
  # @param content [String] the content of the rule
222
222
  # @param private [Boolean]
223
223
  def self.build(content, private: false)
224
- new(value: content.to_s[2..-1], private: private)
224
+ new(value: content.to_s[2..], private: private)
225
225
  end
226
226
 
227
227
  # Initializes a new rule.
@@ -269,7 +269,7 @@ module PublicSuffix
269
269
  # @param content [#to_s] the content of the rule
270
270
  # @param private [Boolean]
271
271
  def self.build(content, private: false)
272
- new(value: content.to_s[1..-1], private: private)
272
+ new(value: content.to_s[1..], private: private)
273
273
  end
274
274
 
275
275
  # Gets the original rule definition.
@@ -299,7 +299,7 @@ module PublicSuffix
299
299
  #
300
300
  # @return [Array<String>]
301
301
  def parts
302
- @value.split(DOT)[1..-1]
302
+ @value.split(DOT)[1..]
303
303
  end
304
304
 
305
305
  end
@@ -10,6 +10,6 @@
10
10
  module PublicSuffix
11
11
 
12
12
  # @return [String] The current library version.
13
- VERSION = "4.0.7"
13
+ VERSION = "5.0.0"
14
14
 
15
15
  end
data/lib/public_suffix.rb CHANGED
@@ -169,7 +169,7 @@ module PublicSuffix
169
169
 
170
170
  return DomainInvalid.new("Name is blank") if name.empty?
171
171
  return DomainInvalid.new("Name starts with a dot") if name.start_with?(DOT)
172
- return DomainInvalid.new("%s is not expected to contain a scheme" % name) if name.include?("://")
172
+ return DomainInvalid.new(format("%s is not expected to contain a scheme", name)) if name.include?("://")
173
173
 
174
174
  name
175
175
  end
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
  "source_code_uri" => "https://github.com/weppos/publicsuffix-ruby/tree/v#{s.version}",
21
21
  }
22
22
 
23
- s.required_ruby_version = ">= 2.3"
23
+ s.required_ruby_version = ">= 2.6"
24
24
 
25
25
  s.require_paths = ["lib"]
26
26
  s.files = `git ls-files`.split("\n")
@@ -64,7 +64,7 @@ class AcceptanceTest < Minitest::Test
64
64
  def test_rejected
65
65
  REJECTED_CASES.each do |name, expected|
66
66
  assert_equal expected, PublicSuffix.valid?(name),
67
- "Expected %s to be %s" % [name.inspect, expected.inspect]
67
+ format("Expected %s to be %s", name.inspect, expected.inspect)
68
68
  assert !valid_domain?(name),
69
69
  "#{name} expected to be invalid"
70
70
  end
@@ -72,9 +72,9 @@ class AcceptanceTest < Minitest::Test
72
72
 
73
73
 
74
74
  CASE_CASES = [
75
- ["Www.google.com", %w( www google com )],
76
- ["www.Google.com", %w( www google com )],
77
- ["www.google.Com", %w( www google com )],
75
+ ["Www.google.com", %w[www google com]],
76
+ ["www.Google.com", %w[www google com]],
77
+ ["www.google.Com", %w[www google com]],
78
78
  ].freeze
79
79
 
80
80
  def test_ignore_case
data/test/psl_test.rb CHANGED
@@ -45,7 +45,7 @@ class PslTest < Minitest::Test
45
45
  end
46
46
 
47
47
  message = "The following #{failures.size} tests fail:\n"
48
- failures.each { |i, o, d| message += "Expected %s to be %s, got %s\n" % [i.inspect, o.inspect, d.inspect] }
48
+ failures.each { |i, o, d| message += format("Expected %s to be %s, got %s\n", i.inspect, o.inspect, d.inspect) }
49
49
  assert_equal 0, failures.size, message
50
50
  end
51
51
 
@@ -10,15 +10,15 @@ class PublicSuffix::DomainTest < Minitest::Test
10
10
 
11
11
  # Tokenizes given input into labels.
12
12
  def test_self_name_to_labels
13
- assert_equal %w( someone spaces live com ),
13
+ assert_equal %w[someone spaces live com],
14
14
  PublicSuffix::Domain.name_to_labels("someone.spaces.live.com")
15
- assert_equal %w( leontina23samiko wiki zoho com ),
15
+ assert_equal %w[leontina23samiko wiki zoho com],
16
16
  PublicSuffix::Domain.name_to_labels("leontina23samiko.wiki.zoho.com")
17
17
  end
18
18
 
19
19
  # Converts input into String.
20
20
  def test_self_name_to_labels_converts_input_to_string
21
- assert_equal %w( someone spaces live com ),
21
+ assert_equal %w[someone spaces live com],
22
22
  PublicSuffix::Domain.name_to_labels(:"someone.spaces.live.com")
23
23
  end
24
24
 
@@ -214,7 +214,7 @@ LIST
214
214
  assert_instance_of PublicSuffix::List, list
215
215
  assert_equal 4, list.size
216
216
 
217
- rules = %w( com *.uk !british-library.uk blogspot.com ).map { |name| PublicSuffix::Rule.factory(name) }
217
+ rules = %w[com *.uk !british-library.uk blogspot.com].map { |name| PublicSuffix::Rule.factory(name) }
218
218
  assert_equal rules, list.each.to_a
219
219
 
220
220
  # private domains
@@ -29,8 +29,8 @@ class PublicSuffix::RuleTest < Minitest::Test
29
29
  def test_default_returns_default_wildcard
30
30
  default = PublicSuffix::Rule.default
31
31
  assert_equal PublicSuffix::Rule::Wildcard.build("*"), default
32
- assert_equal %w( example tldnotlisted ), default.decompose("example.tldnotlisted")
33
- assert_equal %w( www.example tldnotlisted ), default.decompose("www.example.tldnotlisted")
32
+ assert_equal %w[example tldnotlisted], default.decompose("example.tldnotlisted")
33
+ assert_equal %w[www.example tldnotlisted], default.decompose("www.example.tldnotlisted")
34
34
  end
35
35
 
36
36
  end
@@ -140,15 +140,15 @@ class PublicSuffix::RuleNormalTest < Minitest::Test
140
140
  end
141
141
 
142
142
  def test_parts
143
- assert_equal %w(com), @klass.build("com").parts
144
- assert_equal %w(co com), @klass.build("co.com").parts
145
- assert_equal %w(mx co com), @klass.build("mx.co.com").parts
143
+ assert_equal %w[com], @klass.build("com").parts
144
+ assert_equal %w[co com], @klass.build("co.com").parts
145
+ assert_equal %w[mx co com], @klass.build("mx.co.com").parts
146
146
  end
147
147
 
148
148
  def test_decompose
149
149
  assert_equal [nil, nil], @klass.build("com").decompose("com")
150
- assert_equal %w( example com ), @klass.build("com").decompose("example.com")
151
- assert_equal %w( foo.example com ), @klass.build("com").decompose("foo.example.com")
150
+ assert_equal %w[example com], @klass.build("com").decompose("example.com")
151
+ assert_equal %w[foo.example com], @klass.build("com").decompose("foo.example.com")
152
152
  end
153
153
 
154
154
  end
@@ -175,14 +175,14 @@ class PublicSuffix::RuleExceptionTest < Minitest::Test
175
175
  end
176
176
 
177
177
  def test_parts
178
- assert_equal %w( uk ), @klass.build("!british-library.uk").parts
179
- assert_equal %w( tokyo jp ), @klass.build("!metro.tokyo.jp").parts
178
+ assert_equal %w[uk], @klass.build("!british-library.uk").parts
179
+ assert_equal %w[tokyo jp], @klass.build("!metro.tokyo.jp").parts
180
180
  end
181
181
 
182
182
  def test_decompose
183
183
  assert_equal [nil, nil], @klass.build("!british-library.uk").decompose("uk")
184
- assert_equal %w( british-library uk ), @klass.build("!british-library.uk").decompose("british-library.uk")
185
- assert_equal %w( foo.british-library uk ), @klass.build("!british-library.uk").decompose("foo.british-library.uk")
184
+ assert_equal %w[british-library uk], @klass.build("!british-library.uk").decompose("british-library.uk")
185
+ assert_equal %w[foo.british-library uk], @klass.build("!british-library.uk").decompose("foo.british-library.uk")
186
186
  end
187
187
 
188
188
  end
@@ -209,14 +209,14 @@ class PublicSuffix::RuleWildcardTest < Minitest::Test
209
209
  end
210
210
 
211
211
  def test_parts
212
- assert_equal %w( uk ), @klass.build("*.uk").parts
213
- assert_equal %w( co uk ), @klass.build("*.co.uk").parts
212
+ assert_equal %w[uk], @klass.build("*.uk").parts
213
+ assert_equal %w[co uk], @klass.build("*.co.uk").parts
214
214
  end
215
215
 
216
216
  def test_decompose
217
217
  assert_equal [nil, nil], @klass.build("*.do").decompose("nic.do")
218
- assert_equal %w( google co.uk ), @klass.build("*.uk").decompose("google.co.uk")
219
- assert_equal %w( foo.google co.uk ), @klass.build("*.uk").decompose("foo.google.co.uk")
218
+ assert_equal %w[google co.uk], @klass.build("*.uk").decompose("google.co.uk")
219
+ assert_equal %w[foo.google co.uk], @klass.build("*.uk").decompose("foo.google.co.uk")
220
220
  end
221
221
 
222
222
  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: 4.0.7
4
+ version: 5.0.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: 2022-04-12 00:00:00.000000000 Z
11
+ date: 2022-07-24 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.
@@ -21,6 +21,7 @@ extra_rdoc_files:
21
21
  files:
22
22
  - ".github/FUNDING.yml"
23
23
  - ".github/dependabot.yml"
24
+ - ".github/workflows/psl-update.yml"
24
25
  - ".github/workflows/release.yml"
25
26
  - ".github/workflows/tests.yml"
26
27
  - ".gitignore"
@@ -71,9 +72,9 @@ licenses:
71
72
  metadata:
72
73
  bug_tracker_uri: https://github.com/weppos/publicsuffix-ruby/issues
73
74
  changelog_uri: https://github.com/weppos/publicsuffix-ruby/blob/master/CHANGELOG.md
74
- documentation_uri: https://rubydoc.info/gems/public_suffix/4.0.7
75
+ documentation_uri: https://rubydoc.info/gems/public_suffix/5.0.0
75
76
  homepage_uri: https://simonecarletti.com/code/publicsuffix-ruby
76
- source_code_uri: https://github.com/weppos/publicsuffix-ruby/tree/v4.0.7
77
+ source_code_uri: https://github.com/weppos/publicsuffix-ruby/tree/v5.0.0
77
78
  post_install_message:
78
79
  rdoc_options: []
79
80
  require_paths:
@@ -82,7 +83,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
82
83
  requirements:
83
84
  - - ">="
84
85
  - !ruby/object:Gem::Version
85
- version: '2.3'
86
+ version: '2.6'
86
87
  required_rubygems_version: !ruby/object:Gem::Requirement
87
88
  requirements:
88
89
  - - ">="