4c41c5462f | ||
---|---|---|
config | ||
lib | ||
script | ||
spec | ||
vendor/cache | ||
.gitignore | ||
.rspec | ||
.ruby-version | ||
.travis.yml | ||
Gemfile | ||
LICENSE.md | ||
README.md | ||
github-pages-health-check.gemspec |
README.md
GitHub Pages Health Check
Checks your GitHub Pages site for common DNS configuration issues
Installation
gem install github-pages-health-check
Usage
Basic Usage
> check = GitHubPages::HealthCheck.new("choosealicense.com")
=> #<GitHubPages::HealthCheck @domain="choosealicense.com" valid?=true>
> check.valid?
=> true
An invalid domain
> check = GitHubPages::HealthCheck.new("foo.github.com")
> check.valid?
=> false
> check.valid!
=> GitHubPages::HealthCheck::InvalidCNAME
Retrieving specific checks
> check.should_be_a_record?
=> true
> check.a_record?
=> true
Getting checks in bulk
> check.to_hash
=> {
:cloudflare_ip?=>false,
:old_ip_address?=>false,
:a_record?=>true,
:cname_record?=>false,
:valid_domain?=>true,
:apex_domain?=>true,
:should_be_a_record?=>true,
:pointed_to_github_user_domain?=>false,
:pages_domain?=>false,
:valid?=>true
}
> require 'json'
> check.to_json
=> "{\"cloudflare_ip?\":false,\"old_ip_address?\":false,\"a_record?\":true,\"cname_record?\":false,\"valid_domain?\":true,\"apex_domain?\":true,\"should_be_a_record?\":true,\"pointed_to_github_user_domain?\":false,\"pages_domain?\":false,\"valid?\":true}"
Getting the reason a domain is invalid
> check = GitHubPages::HealthCheck.new "developer.facebook.com"
> check.valid?
=> false
> check.reason
=> #<GitHubPages::HealthCheck::InvalidCNAME>
> check.reason.message
=> "CNAME does not point to GitHub Pages"