whois 4.0.6 → 6.0.3
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 +4 -4
- data/.github/FUNDING.yml +12 -0
- data/.github/dependabot.yml +17 -0
- data/.github/workflows/release.yml +19 -0
- data/.github/workflows/tests.yml +29 -0
- data/.gitignore +11 -0
- data/.rspec +1 -0
- data/.rubocop.yml +27 -0
- data/.rubocop_opinionated.yml +115 -0
- data/.rubocop_todo.yml +89 -0
- data/.simplecov +6 -0
- data/.tool-versions +1 -0
- data/CHANGELOG.md +147 -44
- data/CONTRIBUTING.md +18 -6
- data/Gemfile +8 -0
- data/LICENSE.txt +1 -1
- data/README.md +4 -4
- data/Rakefile +28 -0
- data/SECURITY.md +24 -0
- data/bin/console +1 -0
- data/bin/whoisrb +6 -5
- data/data/ipv4.json +1 -3
- data/data/tld.json +125 -1049
- data/lib/whois/client.rb +5 -7
- data/lib/whois/errors.rb +4 -6
- data/lib/whois/record/part.rb +5 -6
- data/lib/whois/record.rb +5 -8
- data/lib/whois/server/adapters/afilias.rb +4 -5
- data/lib/whois/server/adapters/arin.rb +7 -8
- data/lib/whois/server/adapters/arpa.rb +19 -24
- data/lib/whois/server/adapters/base.rb +29 -46
- data/lib/whois/server/adapters/formatted.rb +4 -6
- data/lib/whois/server/adapters/none.rb +4 -6
- data/lib/whois/server/adapters/not_implemented.rb +4 -6
- data/lib/whois/server/adapters/standard.rb +4 -6
- data/lib/whois/server/adapters/verisign.rb +4 -5
- data/lib/whois/server/adapters/web.rb +4 -6
- data/lib/whois/server/socket_handler.rb +11 -12
- data/lib/whois/server.rb +73 -64
- data/lib/whois/version.rb +4 -2
- data/lib/whois.rb +32 -33
- data/spec/fixtures/referrals/afilias.bz.txt +23 -0
- data/spec/fixtures/referrals/arin_referral_apnic.txt +78 -0
- data/spec/fixtures/referrals/arin_referral_missing.txt +52 -0
- data/spec/fixtures/referrals/arin_referral_ripe.txt +50 -0
- data/spec/fixtures/referrals/arin_referral_rwhois.txt +63 -0
- data/spec/fixtures/referrals/arin_referral_servernap.txt +63 -0
- data/spec/fixtures/referrals/arin_referral_whois.txt +56 -0
- data/spec/fixtures/referrals/crsnic.com.txt +60 -0
- data/spec/fixtures/referrals/crsnic.com_referral.txt +56 -0
- data/spec/fixtures/referrals/crsnic.com_referral_missing.txt +50 -0
- data/spec/integration/whois_spec.rb +73 -0
- data/spec/spec_helper.rb +19 -0
- data/spec/support/helpers/connectivity_helper.rb +15 -0
- data/spec/support/helpers/spec_helper.rb +31 -0
- data/spec/whois/client_spec.rb +143 -0
- data/spec/whois/record/part_spec.rb +38 -0
- data/spec/whois/record_spec.rb +168 -0
- data/spec/whois/server/adapters/afilias_spec.rb +49 -0
- data/spec/whois/server/adapters/arin_spec.rb +83 -0
- data/spec/whois/server/adapters/arpa_spec.rb +29 -0
- data/spec/whois/server/adapters/base_spec.rb +155 -0
- data/spec/whois/server/adapters/formatted_spec.rb +53 -0
- data/spec/whois/server/adapters/none_spec.rb +23 -0
- data/spec/whois/server/adapters/not_implemented_spec.rb +24 -0
- data/spec/whois/server/adapters/standard_spec.rb +42 -0
- data/spec/whois/server/adapters/verisign_spec.rb +60 -0
- data/spec/whois/server/adapters/web_spec.rb +24 -0
- data/spec/whois/server/socket_handler_spec.rb +33 -0
- data/spec/whois/server_spec.rb +302 -0
- data/spec/whois/web_interface_error_spec.rb +23 -0
- data/spec/whois/whois_spec.rb +15 -0
- data/utils/compare-whois.rb +30 -0
- data/utils/deftld.rb +230 -0
- data/utils/defutils.rb +26 -0
- data/utils/fixupd.rb +60 -0
- data/utils/matrix.rb +68 -0
- data/utils/mkwhois.rb +31 -0
- data/whois.gemspec +19 -32
- metadata +58 -11
- data/4.0-Upgrade.md +0 -143
- data/bin/setup +0 -8
data/utils/deftld.rb
ADDED
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
require 'optparse'
|
|
4
|
+
require 'pathname'
|
|
5
|
+
require 'json'
|
|
6
|
+
|
|
7
|
+
class TldDefs
|
|
8
|
+
|
|
9
|
+
KEY_SCHEMA = "_".freeze
|
|
10
|
+
|
|
11
|
+
# The current schema version for the definition file
|
|
12
|
+
#
|
|
13
|
+
# @return [String] version
|
|
14
|
+
SCHEMA_VERSION = "2".freeze
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class ChangeError < StandardError
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
class TldDef
|
|
21
|
+
attr_accessor :name
|
|
22
|
+
|
|
23
|
+
attr_accessor :host
|
|
24
|
+
attr_accessor :adapter
|
|
25
|
+
attr_accessor :format
|
|
26
|
+
attr_accessor :url
|
|
27
|
+
|
|
28
|
+
attr_accessor :type
|
|
29
|
+
attr_accessor :group
|
|
30
|
+
attr_accessor :note
|
|
31
|
+
|
|
32
|
+
ATTRIBUTES = {
|
|
33
|
+
host: :host,
|
|
34
|
+
adapter: :adapter,
|
|
35
|
+
format: :format,
|
|
36
|
+
url: :url,
|
|
37
|
+
|
|
38
|
+
note: :_note,
|
|
39
|
+
type: :_type,
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
# Normalizes the TLD name by appending the dot, if missing.
|
|
44
|
+
#
|
|
45
|
+
# @return [String] the normalized TLD name
|
|
46
|
+
def self.name(string)
|
|
47
|
+
string = string.to_str.downcase
|
|
48
|
+
string.start_with?(".") ? string[1..-1] : string
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def initialize(name, attributes = {})
|
|
52
|
+
@name = self.class.name(name)
|
|
53
|
+
@attributes = {}
|
|
54
|
+
|
|
55
|
+
update(attributes)
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def load(attributes = {})
|
|
59
|
+
validate(ATTRIBUTES.values, attributes)
|
|
60
|
+
|
|
61
|
+
attributes.each do |key, value|
|
|
62
|
+
@attributes[key.to_sym] = value
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
self
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# Updates the definition attributes.
|
|
69
|
+
#
|
|
70
|
+
# @param attributes [Hash]
|
|
71
|
+
# @return [void]
|
|
72
|
+
def update(attributes = {})
|
|
73
|
+
validate(ATTRIBUTES.keys, attributes)
|
|
74
|
+
|
|
75
|
+
attributes.each do |key, value|
|
|
76
|
+
@attributes[ATTRIBUTES[key.to_sym]] = value
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
self
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# Validates the definitions to make sure there are no unknown attributes.
|
|
83
|
+
#
|
|
84
|
+
# @param allowed [Array]
|
|
85
|
+
# @param attributes [Hash]
|
|
86
|
+
# @return [void]
|
|
87
|
+
# @raise [ArgumentError] when a definition attribute is unknown
|
|
88
|
+
def validate(allowed, attributes)
|
|
89
|
+
attributes.each do |key, _|
|
|
90
|
+
allowed.include?(key.to_sym) or
|
|
91
|
+
raise ArgumentError, "Invalid attribute `#{key}`"
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Dump the definition object into a serializable Hash.
|
|
96
|
+
#
|
|
97
|
+
# Private attributes (starting by _) are added on top.
|
|
98
|
+
# Keys are sorted alphabetically.
|
|
99
|
+
#
|
|
100
|
+
# @return [Hash] the serializable hash
|
|
101
|
+
def dump
|
|
102
|
+
Hash[@attributes.reject { |_, value| value.nil? }.sort]
|
|
103
|
+
end
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
# @param file_path [String] path to the TLD definition file
|
|
108
|
+
# @param ignore_missing [Boolean] set to true to silently skip missing TLDs on update.
|
|
109
|
+
# When set to false, an error will be raised.
|
|
110
|
+
def initialize(file_path, ignore_missing: true)
|
|
111
|
+
@path = Pathname.new(file_path)
|
|
112
|
+
@settings = {
|
|
113
|
+
ignore_missing: ignore_missing
|
|
114
|
+
}
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
def read
|
|
118
|
+
JSON.load(@path)
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
def write(data)
|
|
122
|
+
data[KEY_SCHEMA] = schema_attributes
|
|
123
|
+
data = Hash[data.sort_by { |tld, _| tld.split(".").reverse.join(".") }]
|
|
124
|
+
File.write(@path, JSON.pretty_generate(data))
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
def count
|
|
128
|
+
read.count
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
def tlds_add(*tlds, **attributes)
|
|
132
|
+
update do |defs|
|
|
133
|
+
tlds.each do |tld|
|
|
134
|
+
tld = TldDef.name(tld)
|
|
135
|
+
tlddef = TldDef.new(tld, attributes)
|
|
136
|
+
defs[tld] = tlddef.dump
|
|
137
|
+
end
|
|
138
|
+
end
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
def tlds_update(*tlds, **attributes)
|
|
142
|
+
update do |defs|
|
|
143
|
+
tlds.each do |tld|
|
|
144
|
+
tld = TldDef.name(tld)
|
|
145
|
+
# puts(tld) if !defs.key?(tld)
|
|
146
|
+
next if !defs.key?(tld) && @settings[:ignore_missing]
|
|
147
|
+
raise ChangeError, "error updating `#{tld}`, tld is missing" if !defs.key?(tld) && !@settings[:ignore_missing]
|
|
148
|
+
|
|
149
|
+
tlddef = TldDef.new(tld).load(defs[tld]).update(attributes)
|
|
150
|
+
defs[tld] = tlddef.dump
|
|
151
|
+
end
|
|
152
|
+
end
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
def update
|
|
156
|
+
data = read
|
|
157
|
+
puts "#{data.count} definitions read"
|
|
158
|
+
yield data if block_given?
|
|
159
|
+
write(data)
|
|
160
|
+
puts "#{data.count} definitions written"
|
|
161
|
+
data
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
def validate
|
|
165
|
+
read.each do |tld, data|
|
|
166
|
+
TldDef.new(tld, data)
|
|
167
|
+
end; nil
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
private
|
|
171
|
+
|
|
172
|
+
def schema_attributes
|
|
173
|
+
{
|
|
174
|
+
"schema" => SCHEMA_VERSION,
|
|
175
|
+
"updated" => Time.now.utc,
|
|
176
|
+
}
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
defs = TldDefs.new(File.expand_path("../../data/tld.json", __FILE__))
|
|
183
|
+
|
|
184
|
+
args = ARGV
|
|
185
|
+
options = {}
|
|
186
|
+
OptionParser.new do |opts|
|
|
187
|
+
opts.banner = "Usage: deftld command [options]"
|
|
188
|
+
opts.separator <<~EOS
|
|
189
|
+
|
|
190
|
+
Commands:
|
|
191
|
+
\tadd
|
|
192
|
+
\tupdate
|
|
193
|
+
\tvalidate
|
|
194
|
+
\tfmt
|
|
195
|
+
|
|
196
|
+
Options:
|
|
197
|
+
EOS
|
|
198
|
+
|
|
199
|
+
TldDefs::TldDef::ATTRIBUTES.each do |key, _|
|
|
200
|
+
opts.on("--#{key} [VALUE]", String, "set the #{key}") do |value|
|
|
201
|
+
options[key] = value
|
|
202
|
+
end
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
begin
|
|
206
|
+
opts.parse!
|
|
207
|
+
rescue OptionParser::ParseError
|
|
208
|
+
puts opts
|
|
209
|
+
exit 1
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
if args.size.zero?
|
|
213
|
+
puts opts
|
|
214
|
+
exit 1
|
|
215
|
+
end
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
case command = args.shift
|
|
219
|
+
when "validate"
|
|
220
|
+
defs.validate
|
|
221
|
+
when "fmt"
|
|
222
|
+
defs.update
|
|
223
|
+
when "add"
|
|
224
|
+
defs.tlds_add(*args, options)
|
|
225
|
+
when "update"
|
|
226
|
+
defs.tlds_update(*args, options)
|
|
227
|
+
else
|
|
228
|
+
puts "Unknown command `#{command}`"
|
|
229
|
+
exit 1
|
|
230
|
+
end
|
data/utils/defutils.rb
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
args = ARGV
|
|
4
|
+
case command = args.shift
|
|
5
|
+
|
|
6
|
+
# Command retag-newgtld
|
|
7
|
+
when "retag-newgtld"
|
|
8
|
+
require 'open-uri'
|
|
9
|
+
|
|
10
|
+
tlds = []
|
|
11
|
+
count = 0
|
|
12
|
+
open("https://newgtlds.icann.org/newgtlds.csv").each_line do |line|
|
|
13
|
+
count += 1
|
|
14
|
+
next if count < 3
|
|
15
|
+
tlds << line.split(",", 2).first
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
puts "Updating #{tlds.size} newGTLDs..."
|
|
19
|
+
puts "utils/deftld.rb update #{tlds.join(" ")} --type newgtld"
|
|
20
|
+
puts `utils/deftld.rb update #{tlds.join(" ")} --type newgtld`
|
|
21
|
+
|
|
22
|
+
else
|
|
23
|
+
puts "Unknown command `#{command}`"
|
|
24
|
+
exit 1
|
|
25
|
+
end
|
|
26
|
+
|
data/utils/fixupd.rb
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
#!/usr/bin/env ruby -w
|
|
2
|
+
|
|
3
|
+
$:.unshift(File.expand_path("../../lib", __FILE__))
|
|
4
|
+
|
|
5
|
+
require 'fileutils'
|
|
6
|
+
require 'net/https'
|
|
7
|
+
require 'uri'
|
|
8
|
+
require 'yaml'
|
|
9
|
+
require 'whois'
|
|
10
|
+
|
|
11
|
+
# SOURCE = "tlds.yml"
|
|
12
|
+
# defs = YAML.load_file(SOURCE)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
SOURCE = "https://gist.github.com/weppos/3907123/raw/tlds.yml"
|
|
16
|
+
uri = URI.parse(SOURCE)
|
|
17
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
|
18
|
+
http.use_ssl = true
|
|
19
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE # read into this
|
|
20
|
+
defs = YAML.load(http.get(uri.request_uri).body)
|
|
21
|
+
|
|
22
|
+
client = Whois::Client.new
|
|
23
|
+
|
|
24
|
+
defs.each do |tld, node|
|
|
25
|
+
fixtures = node.reject { |k,v| k.index("_") == 0 }
|
|
26
|
+
subdir = node["_subdir"] ? "/#{node["_subdir"]}" : ""
|
|
27
|
+
fixtures.each do |name, domain|
|
|
28
|
+
begin
|
|
29
|
+
record = client.lookup(domain)
|
|
30
|
+
part = record.parts.first
|
|
31
|
+
target = File.expand_path("../../spec/fixtures/responses/#{part.host}#{subdir}/#{name}.txt", __FILE__)
|
|
32
|
+
FileUtils.mkdir_p(File.dirname(target))
|
|
33
|
+
File.open(target, "w+") { |f| f.write(part.body) }
|
|
34
|
+
puts "Saved #{target}"
|
|
35
|
+
rescue => e
|
|
36
|
+
puts "Error for #{domain}: #{e.message}"
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
# skippable = {}
|
|
43
|
+
# defs.each do |tld, node|
|
|
44
|
+
# fixtures = node.reject { |k,v| k.index("_") == 0 }.reject { |k,v| node["_#{k}_skipdiff"].nil? }
|
|
45
|
+
# subdir = node["_subdir"] ? "/#{node["_subdir"]}" : ""
|
|
46
|
+
# fixtures.each do |name, domain|
|
|
47
|
+
# target = "spec/fixtures/responses/#{node["_server"]}#{subdir}/#{name}.txt"
|
|
48
|
+
# skippable[target] = node["_#{name}_skipdiff"]
|
|
49
|
+
# end
|
|
50
|
+
# end
|
|
51
|
+
|
|
52
|
+
# changes = `git status`.scan(/modified:\s+(.+)/).flatten
|
|
53
|
+
# changes.each do |path|
|
|
54
|
+
# next unless (alpha = skippable[path])
|
|
55
|
+
# beta = `git show HEAD~1:#{path} | diff - #{path}`.scan(/^(\d+)c\1/).flatten.map(&:to_i)
|
|
56
|
+
# if (alpha - beta) == []
|
|
57
|
+
# `git checkout #{path}`
|
|
58
|
+
# puts "Reset #{path}"
|
|
59
|
+
# end
|
|
60
|
+
# end
|
data/utils/matrix.rb
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
#!/usr/bin/env ruby -w
|
|
2
|
+
|
|
3
|
+
ROOT = File.expand_path("../..", __FILE__)
|
|
4
|
+
LIB = File.join(ROOT, "lib")
|
|
5
|
+
|
|
6
|
+
$:.unshift(LIB)
|
|
7
|
+
|
|
8
|
+
def pretty_state(state)
|
|
9
|
+
case state
|
|
10
|
+
when :supported then 'Y'
|
|
11
|
+
when :not_supported then 'N'
|
|
12
|
+
when :not_implemented then '.'
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def matrix(hosts)
|
|
17
|
+
hosts.map do |host|
|
|
18
|
+
klass = P.parser_klass(host)
|
|
19
|
+
props = klass._properties
|
|
20
|
+
PROPERTIES.inject([host]) { |all, property| all << pretty_state(props[property]) }
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def markdown_matrix(matrix, header: nil, formatter: ->(columns) { "| #{columns.join(" | ")} |" })
|
|
25
|
+
matrix = matrix.dup
|
|
26
|
+
length = matrix.inject(0) { |l, row| l = row[0].size > l ? row[0].size : l }
|
|
27
|
+
matrix.each { |row| row[0] = row[0].ljust(length) }
|
|
28
|
+
|
|
29
|
+
output = matrix.map(&formatter)
|
|
30
|
+
if header
|
|
31
|
+
string = formatter.(header)
|
|
32
|
+
output.unshift [string, string.gsub(/([^\|])/, "-")]
|
|
33
|
+
end
|
|
34
|
+
output.join("\n")
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
require 'whois'
|
|
39
|
+
|
|
40
|
+
P = Whois::Record::Parser
|
|
41
|
+
PROPERTIES = [:disclaimer, :domain, :domain_id, :status, :available?, :registered?, :created_on, :updated_on, :expires_on, :registrar, :registrant_contacts, :admin_contacts, :technical_contacts, :nameservers]
|
|
42
|
+
|
|
43
|
+
hosts = Dir.glob(File.join(LIB, "whois/record/parser/*.rb"))
|
|
44
|
+
.reject { |f| f.match?(/\/(base|blank|example)/) }
|
|
45
|
+
.map { |f| File.basename(f, ".rb") }
|
|
46
|
+
|
|
47
|
+
pthin = %w(
|
|
48
|
+
whois.1und1.info
|
|
49
|
+
whois.ascio.com
|
|
50
|
+
whois.comlaude.com
|
|
51
|
+
whois.dreamhost.com
|
|
52
|
+
whois.enom.com
|
|
53
|
+
whois.gandi.net
|
|
54
|
+
whois.godaddy.com
|
|
55
|
+
whois.markmonitor.com
|
|
56
|
+
whois.networksolutions.com
|
|
57
|
+
whois.pairnic.com
|
|
58
|
+
whois.register.com
|
|
59
|
+
whois.rrpproxy.net
|
|
60
|
+
whois.schlund.info
|
|
61
|
+
whois.tucows.com
|
|
62
|
+
whois.udag.net
|
|
63
|
+
whois.yoursrs.com
|
|
64
|
+
)
|
|
65
|
+
ptlds = hosts - pthin
|
|
66
|
+
|
|
67
|
+
puts markdown_matrix(matrix(ptlds), header: ["parser"] + PROPERTIES)
|
|
68
|
+
puts markdown_matrix(matrix(pthin), header: ["parser"] + PROPERTIES)
|
data/utils/mkwhois.rb
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#!/usr/bin/env ruby -w
|
|
2
|
+
|
|
3
|
+
# Usage:
|
|
4
|
+
#
|
|
5
|
+
# $ ./utils/mkwhois.rb google.com.br status_registered
|
|
6
|
+
#
|
|
7
|
+
# It will execute the query and dump the result into a file
|
|
8
|
+
# called status_registered.txt into the appriate folder based
|
|
9
|
+
# on the hostname that was queried, and the TLD.
|
|
10
|
+
|
|
11
|
+
$:.unshift(File.expand_path("../../lib", __FILE__))
|
|
12
|
+
|
|
13
|
+
require 'fileutils'
|
|
14
|
+
require 'whois'
|
|
15
|
+
begin
|
|
16
|
+
require File.expand_path("../whois-utf8", __FILE__)
|
|
17
|
+
rescue LoadError
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
d = ARGV.shift || raise("Missing domain")
|
|
21
|
+
n = ARGV.shift || raise("Missing file name")
|
|
22
|
+
|
|
23
|
+
r = Whois.lookup(d)
|
|
24
|
+
tld = r.server.allocation
|
|
25
|
+
|
|
26
|
+
r.parts.each do |part|
|
|
27
|
+
target = File.expand_path("../../spec/fixtures/responses/#{part.host}/#{tld}/#{n}.txt", __FILE__)
|
|
28
|
+
FileUtils.mkdir_p(File.dirname(target))
|
|
29
|
+
File.open(target, "w+") { |f| f.write(part.body) }
|
|
30
|
+
puts "#{target}"
|
|
31
|
+
end
|
data/whois.gemspec
CHANGED
|
@@ -1,39 +1,26 @@
|
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
|
2
|
-
|
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
|
3
|
+
require "whois/version"
|
|
3
4
|
|
|
4
5
|
Gem::Specification.new do |s|
|
|
5
|
-
s.name
|
|
6
|
-
s.version
|
|
6
|
+
s.name = "whois"
|
|
7
|
+
s.version = Whois::VERSION
|
|
8
|
+
s.authors = ["Simone Carletti"]
|
|
9
|
+
s.email = ["weppos@weppos.net"]
|
|
10
|
+
s.homepage = "https://whoisrb.org/"
|
|
11
|
+
s.summary = "An intelligent pure Ruby WHOIS client and parser."
|
|
12
|
+
s.description = "Whois is an intelligent WHOIS client and parser written in pure Ruby. It can query registry data for IPv4, IPv6 and top level domains, and parse the responses into easy-to-use Ruby objects via the whois-parser library."
|
|
13
|
+
s.license = "MIT"
|
|
7
14
|
|
|
8
|
-
s.
|
|
9
|
-
s.require_paths = ["lib".freeze]
|
|
10
|
-
s.authors = ["Simone Carletti".freeze]
|
|
11
|
-
s.date = "2018-03-26"
|
|
12
|
-
s.description = "Whois is an intelligent WHOIS client and parser written in pure Ruby. It can query registry data for IPv4, IPv6 and top level domains, and parse the responses into easy-to-use Ruby objects via the whois-parser library.".freeze
|
|
13
|
-
s.email = ["weppos@weppos.net".freeze]
|
|
14
|
-
s.executables = ["whoisrb".freeze]
|
|
15
|
-
s.files = [".yardopts".freeze, "4.0-Upgrade.md".freeze, "CHANGELOG.md".freeze, "CONTRIBUTING.md".freeze, "LICENSE.txt".freeze, "README.md".freeze, "bin/console".freeze, "bin/setup".freeze, "bin/whoisrb".freeze, "data/asn16.json".freeze, "data/asn32.json".freeze, "data/ipv4.json".freeze, "data/ipv6.json".freeze, "data/tld.json".freeze, "lib/whois.rb".freeze, "lib/whois/client.rb".freeze, "lib/whois/errors.rb".freeze, "lib/whois/record.rb".freeze, "lib/whois/record/part.rb".freeze, "lib/whois/server.rb".freeze, "lib/whois/server/adapters/afilias.rb".freeze, "lib/whois/server/adapters/arin.rb".freeze, "lib/whois/server/adapters/arpa.rb".freeze, "lib/whois/server/adapters/base.rb".freeze, "lib/whois/server/adapters/formatted.rb".freeze, "lib/whois/server/adapters/none.rb".freeze, "lib/whois/server/adapters/not_implemented.rb".freeze, "lib/whois/server/adapters/standard.rb".freeze, "lib/whois/server/adapters/verisign.rb".freeze, "lib/whois/server/adapters/web.rb".freeze, "lib/whois/server/socket_handler.rb".freeze, "lib/whois/version.rb".freeze, "whois.gemspec".freeze]
|
|
16
|
-
s.homepage = "https://whoisrb.org/".freeze
|
|
17
|
-
s.licenses = ["MIT".freeze]
|
|
18
|
-
s.required_ruby_version = Gem::Requirement.new(">= 2.0.0".freeze)
|
|
19
|
-
s.rubygems_version = "2.7.3".freeze
|
|
20
|
-
s.summary = "An intelligent pure Ruby WHOIS client and parser.".freeze
|
|
15
|
+
s.required_ruby_version = ">= 3.0"
|
|
21
16
|
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
s.require_paths = %w( lib )
|
|
18
|
+
s.executables =%w( whoisrb )
|
|
19
|
+
s.files = `git ls-files`.split("\n")
|
|
20
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
|
21
|
+
s.extra_rdoc_files = %w( LICENSE.txt .yardopts )
|
|
24
22
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
s.add_development_dependency(%q<yard>.freeze, [">= 0"])
|
|
29
|
-
else
|
|
30
|
-
s.add_dependency(%q<rake>.freeze, [">= 0"])
|
|
31
|
-
s.add_dependency(%q<rspec>.freeze, [">= 0"])
|
|
32
|
-
s.add_dependency(%q<yard>.freeze, [">= 0"])
|
|
33
|
-
end
|
|
34
|
-
else
|
|
35
|
-
s.add_dependency(%q<rake>.freeze, [">= 0"])
|
|
36
|
-
s.add_dependency(%q<rspec>.freeze, [">= 0"])
|
|
37
|
-
s.add_dependency(%q<yard>.freeze, [">= 0"])
|
|
38
|
-
end
|
|
23
|
+
s.add_development_dependency "rake"
|
|
24
|
+
s.add_development_dependency "rspec"
|
|
25
|
+
s.add_development_dependency "yard"
|
|
39
26
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: whois
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 6.0.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Simone Carletti
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: rake
|
|
@@ -60,16 +59,30 @@ email:
|
|
|
60
59
|
executables:
|
|
61
60
|
- whoisrb
|
|
62
61
|
extensions: []
|
|
63
|
-
extra_rdoc_files:
|
|
62
|
+
extra_rdoc_files:
|
|
63
|
+
- ".yardopts"
|
|
64
|
+
- LICENSE.txt
|
|
64
65
|
files:
|
|
66
|
+
- ".github/FUNDING.yml"
|
|
67
|
+
- ".github/dependabot.yml"
|
|
68
|
+
- ".github/workflows/release.yml"
|
|
69
|
+
- ".github/workflows/tests.yml"
|
|
70
|
+
- ".gitignore"
|
|
71
|
+
- ".rspec"
|
|
72
|
+
- ".rubocop.yml"
|
|
73
|
+
- ".rubocop_opinionated.yml"
|
|
74
|
+
- ".rubocop_todo.yml"
|
|
75
|
+
- ".simplecov"
|
|
76
|
+
- ".tool-versions"
|
|
65
77
|
- ".yardopts"
|
|
66
|
-
- 4.0-Upgrade.md
|
|
67
78
|
- CHANGELOG.md
|
|
68
79
|
- CONTRIBUTING.md
|
|
80
|
+
- Gemfile
|
|
69
81
|
- LICENSE.txt
|
|
70
82
|
- README.md
|
|
83
|
+
- Rakefile
|
|
84
|
+
- SECURITY.md
|
|
71
85
|
- bin/console
|
|
72
|
-
- bin/setup
|
|
73
86
|
- bin/whoisrb
|
|
74
87
|
- data/asn16.json
|
|
75
88
|
- data/asn32.json
|
|
@@ -94,12 +107,48 @@ files:
|
|
|
94
107
|
- lib/whois/server/adapters/web.rb
|
|
95
108
|
- lib/whois/server/socket_handler.rb
|
|
96
109
|
- lib/whois/version.rb
|
|
110
|
+
- spec/fixtures/referrals/afilias.bz.txt
|
|
111
|
+
- spec/fixtures/referrals/arin_referral_apnic.txt
|
|
112
|
+
- spec/fixtures/referrals/arin_referral_missing.txt
|
|
113
|
+
- spec/fixtures/referrals/arin_referral_ripe.txt
|
|
114
|
+
- spec/fixtures/referrals/arin_referral_rwhois.txt
|
|
115
|
+
- spec/fixtures/referrals/arin_referral_servernap.txt
|
|
116
|
+
- spec/fixtures/referrals/arin_referral_whois.txt
|
|
117
|
+
- spec/fixtures/referrals/crsnic.com.txt
|
|
118
|
+
- spec/fixtures/referrals/crsnic.com_referral.txt
|
|
119
|
+
- spec/fixtures/referrals/crsnic.com_referral_missing.txt
|
|
120
|
+
- spec/integration/whois_spec.rb
|
|
121
|
+
- spec/spec_helper.rb
|
|
122
|
+
- spec/support/helpers/connectivity_helper.rb
|
|
123
|
+
- spec/support/helpers/spec_helper.rb
|
|
124
|
+
- spec/whois/client_spec.rb
|
|
125
|
+
- spec/whois/record/part_spec.rb
|
|
126
|
+
- spec/whois/record_spec.rb
|
|
127
|
+
- spec/whois/server/adapters/afilias_spec.rb
|
|
128
|
+
- spec/whois/server/adapters/arin_spec.rb
|
|
129
|
+
- spec/whois/server/adapters/arpa_spec.rb
|
|
130
|
+
- spec/whois/server/adapters/base_spec.rb
|
|
131
|
+
- spec/whois/server/adapters/formatted_spec.rb
|
|
132
|
+
- spec/whois/server/adapters/none_spec.rb
|
|
133
|
+
- spec/whois/server/adapters/not_implemented_spec.rb
|
|
134
|
+
- spec/whois/server/adapters/standard_spec.rb
|
|
135
|
+
- spec/whois/server/adapters/verisign_spec.rb
|
|
136
|
+
- spec/whois/server/adapters/web_spec.rb
|
|
137
|
+
- spec/whois/server/socket_handler_spec.rb
|
|
138
|
+
- spec/whois/server_spec.rb
|
|
139
|
+
- spec/whois/web_interface_error_spec.rb
|
|
140
|
+
- spec/whois/whois_spec.rb
|
|
141
|
+
- utils/compare-whois.rb
|
|
142
|
+
- utils/deftld.rb
|
|
143
|
+
- utils/defutils.rb
|
|
144
|
+
- utils/fixupd.rb
|
|
145
|
+
- utils/matrix.rb
|
|
146
|
+
- utils/mkwhois.rb
|
|
97
147
|
- whois.gemspec
|
|
98
148
|
homepage: https://whoisrb.org/
|
|
99
149
|
licenses:
|
|
100
150
|
- MIT
|
|
101
151
|
metadata: {}
|
|
102
|
-
post_install_message:
|
|
103
152
|
rdoc_options: []
|
|
104
153
|
require_paths:
|
|
105
154
|
- lib
|
|
@@ -107,16 +156,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
107
156
|
requirements:
|
|
108
157
|
- - ">="
|
|
109
158
|
- !ruby/object:Gem::Version
|
|
110
|
-
version:
|
|
159
|
+
version: '3.0'
|
|
111
160
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
112
161
|
requirements:
|
|
113
162
|
- - ">="
|
|
114
163
|
- !ruby/object:Gem::Version
|
|
115
164
|
version: '0'
|
|
116
165
|
requirements: []
|
|
117
|
-
|
|
118
|
-
rubygems_version: 2.7.3
|
|
119
|
-
signing_key:
|
|
166
|
+
rubygems_version: 3.6.9
|
|
120
167
|
specification_version: 4
|
|
121
168
|
summary: An intelligent pure Ruby WHOIS client and parser.
|
|
122
169
|
test_files: []
|