<commit_before># GitHub Pages Health Check

*Checks your GitHub Pages site for common DNS configuration issues*

## Installation

`gem install github-pages-health-check`

## Usage

### Basic Usage

```ruby
> check = GitHubPages::HealthCheck.new("choosealicense.com")
=> #<GitHubPages::HealthCheck @domain="choosealicense.com" valid?=true>
> check.valid?
=> true
```

### An invalid domain

```ruby
> check = GitHubPages::HealthCheck.new("foo.github.com")
> check.valid?
=> false
> check.valid!
=> GitHubPages::HealthCheck::InvalidCNAME
```


### Retrieving specific checks

``` ruby
> check.should_be_a_record?
=> true
> check.a_record?
=> true
```

### Getting checks in bulk

```ruby
> 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

```ruby
> 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"
```
<commit_msg>add badges<commit_after># GitHub Pages Health Check

*Checks your GitHub Pages site for common DNS configuration issues*

[![Build Status](https://travis-ci.org/github/pages-health-check.svg)](https://travis-ci.org/github/pages-health-check) [![Gem Version](https://badge.fury.io/rb/github-pages-health-check.svg)](http://badge.fury.io/rb/github-pages-health-check)

## Installation

`gem install github-pages-health-check`

## Usage

### Basic Usage

```ruby
> check = GitHubPages::HealthCheck.new("choosealicense.com")
=> #<GitHubPages::HealthCheck @domain="choosealicense.com" valid?=true>
> check.valid?
=> true
```

### An invalid domain

```ruby
> check = GitHubPages::HealthCheck.new("foo.github.com")
> check.valid?
=> false
> check.valid!
=> GitHubPages::HealthCheck::InvalidCNAME
```


### Retrieving specific checks

``` ruby
> check.should_be_a_record?
=> true
> check.a_record?
=> true
```

### Getting checks in bulk

```ruby
> 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

```ruby
> check = GitHubPages::HealthCheck.new "developer.facebook.<EMAIL>"
> check.valid?
=> false
> check.reason
=> #<GitHubPages::HealthCheck::InvalidCNAME>
> check.reason.message
=> "CNAME does not point to GitHub Pages"
```

{'fraction_non_alphanumeric': 0.19395770392749245, 'fraction_numerical': 0.0, 'mean_word_length': 6.407158836689038, 'pattern_counts': {'":': 20, '<': 8, '<?xml version=': 0, '>': 78, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1804633', 'n_tokens_mistral': 1231, 'n_tokens_neox': 1156, 'n_words': 187}