docheck 1.1.2 → 2.0.0

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: 8f7bf3c5c959d8f90649fc37b83fa1b41dbf548a233561db21a6f74ae8346613
4
- data.tar.gz: 78a1e8780b9c83c76380646e89a6936cf18a3c97264a91529b261fbe979b0c4f
3
+ metadata.gz: c34fd2f75f10db6e9de801f8054aedc6b548fa38088b241c20ba7c500cbc99b9
4
+ data.tar.gz: c385a234aa9d58ea84ec21cfd5bbda42be9adc7c464ba81719e7654479531b4d
5
5
  SHA512:
6
- metadata.gz: 58de693d6de2cf0c16f9968eed20e638884db8f8f471bb392b5bbc9a1b899a9ffb55eef76af9bafbfc1173f340f5610f872349afe3d2d17920e482f9d03bcc3b
7
- data.tar.gz: 7a3b94d469bc9afbf3ac3a4d68cb2b534ba62111451800c12162b708a56c903978189ff7ea4333a84045f2d61eacb5a70433eb7ae3634fbdd27b25f73e12ba73
6
+ metadata.gz: 50861c23841c8595b5294611d5fbba7dd400297c09fa533b96102c0c4b32ed2fb1ec3b7a52e96049e32048092c9e2c1751538f443d914987ac11008d5db54de7
7
+ data.tar.gz: d91bd42c3182dd4cc35d743f3e448be4fc0d7d83eeee24422589a98564df83ba09e3360edd55514cc4604e3b9d62c107bad4ce056f7abbd1cc100d4809d05ad2
data/CHANGELOG.md ADDED
@@ -0,0 +1,23 @@
1
+ # Changelog
2
+
3
+ ## 2.0.0 - Unreleased
4
+
5
+ ### Breaking changes
6
+
7
+ - Require Ruby 3.2 or later. Tested on Ruby 3.2 to 4.0.
8
+ - Look up domains with RDAP instead of WHOIS. The `whois` dependency is gone.
9
+ - Drop `edu`, `gov`, `int`, and `mil` from the default TLDs. Only institutions can register them.
10
+ - Raise `Docheck::InvalidNameError` for a name that is not a single DNS label.
11
+ - The `docheck` command prints errors to stderr and exits with status 64 on a usage error. It also lists domains whose lookup failed or whose TLD has no RDAP server.
12
+ - `Docheck::Application#print` no longer prints the "Docheck Result" header.
13
+
14
+ ### Added
15
+
16
+ - `Docheck.check` and `Docheck::Checker`, which return `Docheck::Result` objects with a status of `:available`, `:registered`, `:unknown`, or `:unsupported`.
17
+ - Parallel lookups with an overall deadline.
18
+ - `rake rdap:update` to refresh the bundled IANA RDAP bootstrap file.
19
+
20
+ ### Fixed
21
+
22
+ - Calling `Docheck::Application#fetch` twice no longer duplicates results.
23
+ - A failed lookup no longer uses up the retry budget of the TLDs after it.
data/README.rdoc CHANGED
@@ -1,8 +1,14 @@
1
1
  = Docheck
2
- Domain name availability checker. By default, It will return all available and registered domains.
2
+
3
+ Domain name availability checker. Docheck checks a name against generic TLDs
4
+ and reports which domains are available and which are registered.
5
+
6
+ Docheck uses RDAP (RFC 9082/9083), the protocol that replaced WHOIS for gTLDs.
7
+ It sends one HTTPS request per TLD to the registry's RDAP server, all in
8
+ parallel. It has no runtime dependencies.
3
9
 
4
10
  == Requirements
5
- Ruby >= 1.9.2
11
+ Ruby >= 3.2
6
12
 
7
13
  == Installation
8
14
 
@@ -11,25 +17,42 @@ Ruby >= 1.9.2
11
17
  == Usage
12
18
  From the command line:
13
19
 
14
- docheck -n google
20
+ $ docheck -n google
21
+
22
+ The command exits with status 0 on success and 64 on a usage error or an
23
+ invalid name.
24
+
25
+ From Ruby:
26
+
27
+ require "docheck"
28
+
29
+ results = Docheck.check("github")
30
+ results.first # => #<data Docheck::Result domain="github.com", status=:registered>
31
+ results.select(&:available?).map(&:domain)
15
32
 
16
- From the Ruby file or IRB.
33
+ # Custom TLDs and deadline (seconds for the whole check)
34
+ checker = Docheck::Checker.new(tlds: %w[com net io], deadline: 5)
35
+ checker.check("github")
17
36
 
18
- require 'docheck'
37
+ Each Docheck::Result has a +status+:
19
38
 
20
- docheck = Docheck::Application.new('github')
39
+ * +:available+ - the registry has no record of the domain
40
+ * +:registered+ - the registry has a record of the domain
41
+ * +:unknown+ - the lookup failed (timeout, rate limit, or server error)
42
+ * +:unsupported+ - the TLD has no RDAP server in the IANA bootstrap data
21
43
 
22
- # returns two elements array. first array is available domains, last array is registered domains
23
- docheck.fetch
44
+ Docheck::Checker#check raises Docheck::InvalidNameError when the name is not a
45
+ single DNS label (1-63 letters, digits, or hyphens). Pass IDNs in punycode
46
+ (+xn--...+).
24
47
 
25
- # returns all available domains
26
- docheck.available_domains
48
+ The 1.x API (Docheck::Application with +fetch+, +available_domains+,
49
+ +registered_domains+, and +print+) still works.
27
50
 
28
- # returns all registered domains
29
- docheck.registered_domains
51
+ == Development
30
52
 
31
- # print all available and registered domains
32
- docheck.print
53
+ $ bundle install
54
+ $ bundle exec rake # tests and RuboCop
55
+ $ bundle exec rake rdap:update # refresh data/rdap_dns.json from IANA
33
56
 
34
57
  == License
35
- Copyright (c) 2010 - 2019 Kunto Aji Kristianto, Docheck is released under the MIT license.
58
+ Copyright (c) 2010 - 2026 Kunto Aji Kristianto, Docheck is released under the MIT license.