what 0.3.6 → 0.3.7

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
  !binary "U0hBMQ==":
3
- metadata.gz: caebdb83a2b6cec1541c7b2ec45630db05a7befe
4
- data.tar.gz: 3c953a8a838ec1583272569c4da7da3dabf4b0f2
3
+ metadata.gz: 6407be24b6758f507d8e8b28c4ae63dbdf039d74
4
+ data.tar.gz: 73cb58507f9827c8e9144ad55ff30b980b37ba5a
5
5
  !binary "U0hBNTEy":
6
- metadata.gz: 85712eea83510e0052cb44cabd828e9645948d8ca6ffcf6225687c362dd1a5def6368b873d43ed3964a217447082984bdb9d97c64b6c3754486665ca4462e361
7
- data.tar.gz: 6af36b9d606608572913a284ad93bb929d885add6cb6661e8b2b0af062bda4edb16034f629487dfde3a2ea71d9b34df31555de8674fee3f2269e2e6cefe07e43
6
+ metadata.gz: 982b7cf3236bbb129438e2809f5542c6b5a4a67ab88d1747387f9c96cd3a41b4c4f3cb6c47d12f9d5df1e9b621e68766e0d99610da85eba097806e59dd50cfbf
7
+ data.tar.gz: 71a35f66e54708af03567ee7fe5a05c6d190c70d63e842ec726820435d3a5c26ed43da49a059ea5d05b93c3f9ed59c4d7a39630c7df478f04095c6cb5fb1be29
@@ -14,10 +14,15 @@ module What
14
14
  resp = Net::HTTP.get_response(@url)
15
15
  @status = resp.code.to_i
16
16
  @body = resp.body.strip
17
+ @got_response = true
18
+ rescue Net::ReadTimeout => e
19
+ @got_response = false
17
20
  end
18
21
 
19
22
  def health
20
- if @status != 200
23
+ if !@got_response
24
+ 'alert'
25
+ elsif @status != 200
21
26
  'alert'
22
27
  elsif @expect && @expect != @body
23
28
  'alert'
@@ -27,7 +32,11 @@ module What
27
32
  end
28
33
 
29
34
  def details
30
- { 'status' => @status, 'last_response' => @body[0..200] }
35
+ {
36
+ 'status' => @status,
37
+ 'last_response' => @body[0..200],
38
+ 'got_response' => @got_response
39
+ }
31
40
  end
32
41
  end
33
42
  end
data/lib/what/modules.rb CHANGED
@@ -17,8 +17,6 @@ module What
17
17
  end
18
18
  end
19
19
 
20
- # TODO: Load modules in the correct order (i.e., superclasses before
21
- # subclasses).
22
20
  def self.require_dir(path)
23
21
  Dir[File.join(path, '*.rb')].each do |fn|
24
22
  require fn
data/lib/what/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module What
2
- VERSION = "0.3.6"
2
+ VERSION = "0.3.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: what
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Fitzgerald
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-10-30 00:00:00.000000000 Z
13
+ date: 2014-10-31 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rack