module GitHubPages::HealthCheck

Constants

HUMAN_NAME
TIMEOUT

DNS and HTTP timeout, in seconds

URL
USER_AGENT
VERSION

Public Class Methods

check(repository_or_domain, access_token: nil) click to toggle source
# File lib/github-pages-health-check.rb, line 53
def self.check(repository_or_domain, access_token: nil)
  Site.new repository_or_domain, :access_token => access_token
end
set_proxy(proxy_url) click to toggle source

rubocop:disable Naming/AccessorMethodName (this is not an accessor method)

# File lib/github-pages-health-check.rb, line 58
def self.set_proxy(proxy_url)
  @typhoeus_options = typhoeus_options.merge(:proxy => proxy_url).freeze
  nil
end
typhoeus_options() click to toggle source

rubocop:enable Naming/AccessorMethodName

# File lib/github-pages-health-check.rb, line 64
def self.typhoeus_options
  return @typhoeus_options if defined?(@typhoeus_options)

  @typhoeus_options = {
    :followlocation => true,
    :redir_protocols => %i[http https], # don't allow non-http protocols on redirections
    :timeout => TIMEOUT,
    :accept_encoding => "gzip",
    :method => :head,
    :headers => {
      "User-Agent" => USER_AGENT
    },
    :proxy => nil
  }.freeze
end
without_warnings(&block) click to toggle source

suppress warn-level feedback due to unsupported record types

# File lib/github-pages-health-check.rb, line 45
def self.without_warnings(&block)
  warn_level = $VERBOSE
  $VERBOSE = nil
  result = block.call
  $VERBOSE = warn_level
  result
end