Sha256: 716921b6b945f8aaa731ae25713c597e65a391940ddc0e87d13853acb4f6f1dc
Contents?: true
Size: 1007 Bytes
Versions: 20
Compression:
Stored size: 1007 Bytes
Contents
# frozen_string_literal: true module GitHubPages module HealthCheck class RedundantCheck extend Forwardable TIMEOUT = 5 # seconds attr_reader :domain def initialize(domain) @domain = domain end def check @check ||= (checks.find(&:valid?) || check_with_default_nameservers) end def_delegator :check, :reason, :reason def_delegator :check, :valid?, :valid? def https_eligible? checks.any?(&:https_eligible?) end private def checks @checks ||= %i[default authoritative public].map do |ns| GitHubPages::HealthCheck::Domain.new(domain, :nameservers => ns) end end def check_with_default_nameservers @check_with_default_nameservers ||= checks.find { |c| c.nameservers == :default } end def check_with_public_nameservers @check_with_public_nameservers ||= checks.find { |c| c.nameservers == :public } end end end end
Version data entries
20 entries across 20 versions & 1 rubygems