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 +4 -4
- data/lib/what/modules/http.rb +11 -2
- data/lib/what/modules.rb +0 -2
- data/lib/what/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6407be24b6758f507d8e8b28c4ae63dbdf039d74
|
4
|
+
data.tar.gz: 73cb58507f9827c8e9144ad55ff30b980b37ba5a
|
5
5
|
!binary "U0hBNTEy":
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 982b7cf3236bbb129438e2809f5542c6b5a4a67ab88d1747387f9c96cd3a41b4c4f3cb6c47d12f9d5df1e9b621e68766e0d99610da85eba097806e59dd50cfbf
|
7
|
+
data.tar.gz: 71a35f66e54708af03567ee7fe5a05c6d190c70d63e842ec726820435d3a5c26ed43da49a059ea5d05b93c3f9ed59c4d7a39630c7df478f04095c6cb5fb1be29
|
data/lib/what/modules/http.rb
CHANGED
@@ -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
|
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
|
-
{
|
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
data/lib/what/version.rb
CHANGED
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.
|
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-
|
13
|
+
date: 2014-10-31 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rack
|