mirror of
https://github.com/Evolix/chexpire.git
synced 2024-05-08 19:48:38 +02:00
Jérémy Lecour
3990771767
PIR is technically managed by Afilias (like many other registries). Renaming/replacing PIR with Afilias brings support to dozens of other TLDs.
25 lines
650 B
Ruby
25 lines
650 B
Ruby
# Copyright (C) 2018 Colin Darie <colin@darie.eu>, 2018 Evolix <info@evolix.fr>
|
|
# License: GNU AGPL-3+ (see full text in LICENSE file)
|
|
|
|
require "null_logger"
|
|
require "whois/errors"
|
|
require "whois/parser/afilias"
|
|
require "whois/parser/afnic"
|
|
require "whois/parser/verisign"
|
|
|
|
module Whois
|
|
module Parser
|
|
PARSERS = [AFNIC, Verisign, Afilias].freeze
|
|
|
|
class << self
|
|
def for(domain, logger: NullLogger.new)
|
|
parser_class = PARSERS.find { |k| k.supports?(domain) }
|
|
|
|
fail UnsupportedDomainError, "Unsupported domain '#{domain}'" if parser_class.nil?
|
|
|
|
parser_class.new(domain, logger: logger)
|
|
end
|
|
end
|
|
end
|
|
end
|