github-pages-health-check 1.0.0 → 1.0.1
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: 4f409efbf6ec37c64dfbfe36da471390fe9ea878
|
4
|
+
data.tar.gz: 678295ff98baed01729af19b92d48bd1ddbc3209
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14f33be101c2b6cc8ad42e827642c05b0c30579e4cb6445dd8bfde8480041cd45873b8cc13ce5e7b00a242e2f0b740b5165fdf3d9cac183f1f1eae6f39e6d0df
|
7
|
+
data.tar.gz: e65246b1a721c6bfe00d446fda2a1eb675b9df92128de07dd75424297e0c4e3507ce0a237c717432e28789f4092a1f5737669b0d3ce6352359f202856cf250ef
|
@@ -12,7 +12,9 @@ module GitHubPages
|
|
12
12
|
|
13
13
|
def simple_string
|
14
14
|
require 'yaml'
|
15
|
-
health_check.to_hash
|
15
|
+
hash = health_check.to_hash
|
16
|
+
hash[:reason] = hash[:reason].to_s if hash[:reason]
|
17
|
+
hash.to_yaml.sub(/\A---\n/, "").gsub(/^:/, "")
|
16
18
|
end
|
17
19
|
|
18
20
|
def pretty_print
|
@@ -5,7 +5,7 @@ module GitHubPages
|
|
5
5
|
attr_reader :name, :owner
|
6
6
|
|
7
7
|
REPO_REGEX = %r{\A[a-z0-9_\-]+/[a-z0-9_\-\.]+\z}i
|
8
|
-
|
8
|
+
|
9
9
|
HASH_METHODS = [
|
10
10
|
:name_with_owner, :built?, :last_built, :build_duration, :build_error
|
11
11
|
].freeze
|
@@ -39,7 +39,7 @@ module GitHubPages
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def build_error
|
42
|
-
last_build.error
|
42
|
+
last_build.error["message"] unless built?
|
43
43
|
end
|
44
44
|
alias_method :reason, :build_error
|
45
45
|
|
@@ -52,6 +52,7 @@ module GitHubPages
|
|
52
52
|
end
|
53
53
|
|
54
54
|
def domain
|
55
|
+
return if cname.nil?
|
55
56
|
@domain ||= GitHubPages::HealthCheck::Domain.new(cname)
|
56
57
|
end
|
57
58
|
|
@@ -13,13 +13,12 @@ module GitHubPages
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def check!
|
16
|
-
domain.check!
|
17
|
-
repository.check! unless repository.nil?
|
16
|
+
[domain, repository].each { |check| check.check! unless check.nil? }
|
18
17
|
true
|
19
18
|
end
|
20
19
|
|
21
20
|
def to_hash
|
22
|
-
hash = domain.to_hash.dup
|
21
|
+
hash = (domain || {}).to_hash.dup
|
23
22
|
hash = hash.merge(repository.to_hash) unless repository.nil?
|
24
23
|
hash[:valid?] = valid?
|
25
24
|
hash[:reason] = reason
|