github-pages-health-check 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa3d74adf88a4ef1a35fe97bb48a41c4ddf355c1
|
4
|
+
data.tar.gz: 6087da3407bc4f842b86663f115d12aeff5b3e40
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a9290587e49058b6bf7b162b3bf64c0395255039c38484f02386fcb4d1476ee491d6f1554cc5e09ffce95997ecb3a045c4dd22708afef32b81768210b8c4df8
|
7
|
+
data.tar.gz: e0804bdec43fd0a892d005df9bae2dcdea39e478ff2f26af215f0ed71c14f5f1f622b5e52469303a7952c4c6da5c0640f8538a0c705271faa25814547e97c583
|
@@ -34,7 +34,8 @@ module GitHubPages
|
|
34
34
|
|
35
35
|
# Runs all checks, raises an error if invalid
|
36
36
|
def check!
|
37
|
-
raise Errors::
|
37
|
+
raise Errors::InvalidDomainError unless valid_domain?
|
38
|
+
raise Errors::InvalidDNSError unless dns_resolves?
|
38
39
|
return true if proxied?
|
39
40
|
raise Errors::DeprecatedIPError if deprecated_ip?
|
40
41
|
raise Errors::InvalidARecordError if invalid_a_record?
|
@@ -45,7 +46,7 @@ module GitHubPages
|
|
45
46
|
|
46
47
|
def deprecated_ip?
|
47
48
|
return @deprecated_ip if defined? @deprecated_ip
|
48
|
-
@deprecated_ip = (a_record? && old_ip_address?)
|
49
|
+
@deprecated_ip = (valid_domain? && a_record? && old_ip_address?)
|
49
50
|
end
|
50
51
|
|
51
52
|
def invalid_a_record?
|
@@ -73,10 +74,16 @@ module GitHubPages
|
|
73
74
|
# Is this domain an apex domain, meaning a CNAME would be innapropriate
|
74
75
|
def apex_domain?
|
75
76
|
return @apex_domain if defined?(@apex_domain)
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
77
|
+
return unless valid_domain?
|
78
|
+
|
79
|
+
answers = begin
|
80
|
+
Resolv::DNS.open { |dns|
|
81
|
+
dns.timeouts = TIMEOUT
|
82
|
+
dns.getresources(absolute_domain, Resolv::DNS::Resource::IN::NS)
|
83
|
+
}
|
84
|
+
rescue Timeout::Error, NoMethodError
|
85
|
+
[]
|
86
|
+
end
|
80
87
|
|
81
88
|
@apex_domain = answers.any?
|
82
89
|
end
|
@@ -154,6 +161,7 @@ module GitHubPages
|
|
154
161
|
# Returns an array of DNS answers
|
155
162
|
def dns
|
156
163
|
return @dns if defined? @dns
|
164
|
+
return unless valid_domain?
|
157
165
|
@dns = Timeout.timeout(TIMEOUT) do
|
158
166
|
GitHubPages::HealthCheck.without_warnings do
|
159
167
|
Net::DNS::Resolver.start(absolute_domain).answer unless host.nil?
|
@@ -198,6 +206,7 @@ module GitHubPages
|
|
198
206
|
|
199
207
|
def served_by_pages?
|
200
208
|
return @served_by_pages if defined? @served_by_pages
|
209
|
+
return unless dns_resolves?
|
201
210
|
|
202
211
|
@served_by_pages = begin
|
203
212
|
response = Typhoeus.head(uri, TYPHOEUS_OPTIONS)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: github-pages-health-check
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GitHub, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-dns
|
@@ -212,7 +212,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
212
212
|
version: '0'
|
213
213
|
requirements: []
|
214
214
|
rubyforge_project:
|
215
|
-
rubygems_version: 2.
|
215
|
+
rubygems_version: 2.6.1
|
216
216
|
signing_key:
|
217
217
|
specification_version: 4
|
218
218
|
summary: Checks your GitHub Pages site for commons DNS configuration issues
|