server_health_check 1.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: a0408992ef46a4d25aa4076b83d7c7906e3c9345
4
- data.tar.gz: 01ac50965154187b4fee108d1b9220e605f2b92e
3
+ metadata.gz: 1980c0a16cbdaca5e280995a96ee9d5f185b4389
4
+ data.tar.gz: 4f06712ed902413536a8207ecc106feab43b261f
5
5
  SHA512:
6
- metadata.gz: 3b60f1e3c20983646e1b04a541076b73ac056e17381a0bc2fcbabbe4f69c170c60734d8ade3445065eb8c91729730b2701756fc6acb1333ca29af63d79939152
7
- data.tar.gz: 3195fbb59e6764370d9fcb75256ab204e828557411c1fa4ea9d112c2ef38679dd1daa4e64dfbb3fe4ed0678ac8f26d4bb8dab223632e2f2debdc887fac0f2b82
6
+ metadata.gz: b26ab14fc7a1cbd14d91da86f6ad6b91892024604f0aae73247b3a8e1bc6f57711c29660dd2b4d320a2d1cc49887b12a3857cc780f143e8fa8662f7b41a46d17
7
+ data.tar.gz: 6393cb1717860463f731797b28886e1129a377b0948612ed23f9f43d3d4406e668875266a6089166c6491abb06a36bbbfba0c46537fe0b9f7dfa2627d0b2359c
@@ -1,3 +1,3 @@
1
1
  class ServerHealthCheck
2
- VERSION = "1.0".freeze
2
+ VERSION = "1.0.1".freeze
3
3
  end
@@ -2,8 +2,10 @@ require "server_health_check/version"
2
2
 
3
3
  class ServerHealthCheck
4
4
  OK = 'OK'.freeze
5
+ attr_reader :logger
5
6
 
6
- def initialize
7
+ def initialize(options = {})
8
+ @logger = options[:logger]
7
9
  @results = {}
8
10
  end
9
11
 
@@ -32,7 +34,9 @@ class ServerHealthCheck
32
34
  end
33
35
 
34
36
  def aws_s3!(bucket = nil)
35
- bucket = Aws::S3::Bucket.new(bucket)
37
+ options = {}
38
+ options[:logger] = logger if logger
39
+ bucket = Aws::S3::Bucket.new(bucket, options)
36
40
  if bucket.exists?
37
41
  @results[:S3] = OK
38
42
  true
@@ -43,7 +47,9 @@ class ServerHealthCheck
43
47
  end
44
48
 
45
49
  def aws_creds!
46
- aws = Aws::S3::Client.new
50
+ options = {}
51
+ options[:logger] = logger if logger
52
+ aws = Aws::S3::Client.new(options)
47
53
  begin
48
54
  aws.list_buckets
49
55
  @results[:AWS] = OK
@@ -63,8 +69,8 @@ class ServerHealthCheck
63
69
  @results[name.to_sym] = "Failed"
64
70
  false
65
71
  end
66
- rescue => e
67
- @results[name.to_sym] = e.to_s
72
+ rescue => e
73
+ @results[name.to_sym] = e.to_s
68
74
  end
69
75
 
70
76
  def ok?
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: server_health_check
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.0'
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Quenten Griffith
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-09-12 00:00:00.000000000 Z
11
+ date: 2017-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -92,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
92
92
  version: '0'
93
93
  requirements: []
94
94
  rubyforge_project:
95
- rubygems_version: 2.4.5.1
95
+ rubygems_version: 2.4.8
96
96
  signing_key:
97
97
  specification_version: 4
98
98
  summary: Healthcheck for web apps.