github-pages-health-check 1.0.0 → 1.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f39bbd059617a66074ecfefd2e099a8642f8f02a
4
- data.tar.gz: 3d515c8fa894e296b042c23ca6729849f1fcc114
3
+ metadata.gz: 4f409efbf6ec37c64dfbfe36da471390fe9ea878
4
+ data.tar.gz: 678295ff98baed01729af19b92d48bd1ddbc3209
5
5
  SHA512:
6
- metadata.gz: 4687d324883562a5424f698643b1beed8bd737581e8d07ba0a5090990016dd68409790c4f075ca96e4fccef7c49b94ae0063cd7eaa0aa1cd3313e0216c55aac9
7
- data.tar.gz: d3545668fa5b774dbf5b7d74ecbb1fc37ea97d36e55242f32221e087ba1bca1cc26f315126d4b9b3059a806f99175774c2b777918e4a2f4f87c4168ca6ee93eb
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.to_yaml.sub(/\A---\n/, "").gsub(/^:/, "")
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.message unless built?
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
@@ -1,5 +1,5 @@
1
1
  module GitHubPages
2
2
  module HealthCheck
3
- VERSION = "1.0.0"
3
+ VERSION = "1.0.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: github-pages-health-check
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitHub, Inc.