validates_hostname 2.0.45 → 2.0.46

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: a5d6bb24a79c20854030b742e3536d1eb2be3e258ab99663672c0c5dee9e04e2
4
- data.tar.gz: 4d22aa6ddcac5913c62864098bc22db2e5e0fc213653c48f60c5f73d7f6f7ab4
3
+ metadata.gz: c479c8efef9b7b4b7e2f3fa9dd80a4597720cb2cec136e1794b816fb9462ca64
4
+ data.tar.gz: d9b13ff0142dc43ba2a0ffacbf00647a3b19586fbdac15e8738b6f0b4e2284db
5
5
  SHA512:
6
- metadata.gz: b526d54359fa3931256740967fda9d28ac57e8b47175a7baf3b35604873fdb80a4db5289f27dcf7fd56a8e1d345e81fdaf5ee071bdcc2b214b9ab0d1305a7f1e
7
- data.tar.gz: cb74c7ef987f0457063764c52b5c8ad41bc92b8274af39a08c4d507d5d47f86e641b003c7d9f4fad463eccae3d18022b790167f17d50a6a3dd38def089fc33ce
6
+ metadata.gz: dd8c3a56fd76476e6181ffaf40fe0dafcc458ec515d89eea5016038a9a1b49dc50edd3ee7385056b3f525212f5208b9ec439f7d33d5fd7dcd6e18f1510bc71fb
7
+ data.tar.gz: 537e1130c16816fb5ef0e6089266c75c4a7e429494226beed15eeb28467af3276e6b82722d6c05ac9f810ed65e00c46b35dc1fa2160652ac0a5caa95fec3d55c
@@ -10,7 +10,7 @@ jobs:
10
10
  name: Release to RubyGems.org
11
11
  runs-on: ubuntu-latest
12
12
  permissions:
13
- contents: read
13
+ contents: write
14
14
 
15
15
  steps:
16
16
  - name: Checkout code
@@ -35,3 +35,8 @@ jobs:
35
35
 
36
36
  - name: Push gem to RubyGems.org
37
37
  run: gem push *.gem
38
+
39
+ - name: Create GitHub Release
40
+ uses: softprops/action-gh-release@v3
41
+ with:
42
+ generate_release_notes: true
@@ -2,7 +2,7 @@ name: Automated TLD Update and Release
2
2
 
3
3
  on:
4
4
  schedule:
5
- - cron: "0 0 * * 0"
5
+ - cron: "0 0 1 */3 *"
6
6
  workflow_dispatch:
7
7
 
8
8
  jobs:
data/README.md CHANGED
@@ -93,6 +93,18 @@ end
93
93
  - `allow_wildcard_hostname`: Permits a wildcard character (`*`) as the first label of the hostname (e.g., `*.example.com`). (default: `false`)
94
94
  - `allow_root_label`: Permits a trailing dot (root label) in the hostname (e.g., `example.com.`). (default: `false`)
95
95
 
96
+ ## TLD Updates
97
+
98
+ The default list of valid TLDs (stored in `data/tlds.txt`) is automatically updated from IANA on a quarterly basis via a GitHub Action. If a new TLD has been released and you need to support it immediately before the next quarterly gem update, you can override the valid TLD list by passing an updated array to the `valid_tlds` option:
99
+
100
+ ```ruby
101
+ # Example of appending a new TLD to the default list
102
+ validates :name, hostname: {
103
+ require_valid_tld: true,
104
+ valid_tlds: ValidatesHostname::TLDs + ['newtld']
105
+ }
106
+ ```
107
+
96
108
  ## Examples
97
109
 
98
110
  Without options:
data/Rakefile CHANGED
@@ -36,6 +36,10 @@ namespace :tlds do
36
36
  begin
37
37
  response = Net::HTTP.get(uri)
38
38
 
39
+ unless response.match?(/^COM$/i) && response.match?(/^ORG$/i) && response.match?(/^NET$/i)
40
+ raise "Downloaded TLD list appears invalid (missing COM, ORG, or NET)."
41
+ end
42
+
39
43
  File.write('data/tlds.txt', response)
40
44
 
41
45
  puts 'Successfully updated data/tlds.txt.'
data/data/tlds.txt CHANGED
@@ -1,4 +1,4 @@
1
- # Version 2026080800, Last Updated Sat Aug 8 07:07:01 2026 UTC
1
+ # Version 2026093000, Last Updated Wed Sep 30 07:07:01 2026 UTC
2
2
  AAA
3
3
  AARP
4
4
  ABB
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ValidatesHostname
4
- VERSION = '2.0.45'
4
+ VERSION = '2.0.46'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: validates_hostname
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.45
4
+ version: 2.0.46
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kim Nøgaard