github-pages-health-check 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/github-pages-health-check/domain.rb +10 -6
- data/lib/github-pages-health-check/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ae14ced41d6ce019b7d842dadd4eb7869c772f4
|
4
|
+
data.tar.gz: a55009148b66e16360fa82fef97fb12151645b04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f7294eea6132d79bb8b4894c841627af1bd7ab4f97a02dd24e8cb0b901ea564da11c338d7c017e2d7e73430e344510f82f6c9cee1253a5111704521c062b8ae
|
7
|
+
data.tar.gz: 0b1208f94e784bf3f9acfab628b5e5886ddd4569fd50186516bf7e62c8f4dce8dc3353ec268e4a94d2be951d8abe9895a4e07b0ac146e439b5c783eb573002b0
|
@@ -29,7 +29,7 @@ module GitHubPages
|
|
29
29
|
raise ArgumentError, "Expected string, got #{host.class}"
|
30
30
|
end
|
31
31
|
|
32
|
-
@host =
|
32
|
+
@host = normalize_host(host)
|
33
33
|
end
|
34
34
|
|
35
35
|
# Runs all checks, raises an error if invalid
|
@@ -241,16 +241,20 @@ module GitHubPages
|
|
241
241
|
#
|
242
242
|
# Examples
|
243
243
|
#
|
244
|
-
#
|
244
|
+
# normalize_host("benbalter.github.com")
|
245
245
|
# # => 'benbalter.github.com'
|
246
|
-
#
|
246
|
+
# normalize_host("https://benbalter.github.com")
|
247
247
|
# # => 'benbalter.github.com'
|
248
|
-
#
|
248
|
+
# normalize_host("benbalter.github.com/help-me-im-a-path/")
|
249
249
|
# # => 'benbalter.github.com'
|
250
250
|
#
|
251
251
|
# Return the hostname.
|
252
|
-
def
|
253
|
-
|
252
|
+
def normalize_host(domain)
|
253
|
+
domain = domain.strip.chomp(".")
|
254
|
+
host = Addressable::URI.parse(domain).host || Addressable::URI.parse("http://#{domain}").host
|
255
|
+
host unless host.to_s.empty?
|
256
|
+
rescue Addressable::URI::InvalidURIError
|
257
|
+
nil
|
254
258
|
end
|
255
259
|
|
256
260
|
# Adjust `domain` so that it won't be searched for with /etc/resolv.conf's search rules.
|
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.1.
|
4
|
+
version: 1.1.1
|
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-03-
|
11
|
+
date: 2016-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-dns
|