sonic 0.1.4 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sonic/protocols/http.rb +10 -5
- data/lib/sonic/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b6c5652075a03c1f0e63272586097e509bb059f
|
4
|
+
data.tar.gz: 6a4ceeacc4d74eb0a001adf4e5dd4db26f8b63ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d26f4e9bf0b77664af99329fdb56ef2ceb09c228eb58d269bd6e8681e8eec456ad73644c6c1144b4edfa73d16e9d5aadb9b5a19150212d32efebb3186f71333
|
7
|
+
data.tar.gz: b1ae123f0960e2d04936a20d75670b299c1cd96b266004b19c3259b4bec1b76a94d9ab9f79ebacdd42db35ad4d0c23c1eb43b7c7f1eabf65651ea96f4410c2e8
|
data/lib/sonic/protocols/http.rb
CHANGED
@@ -7,18 +7,23 @@ module Sonic
|
|
7
7
|
|
8
8
|
def initialize(service_checker)
|
9
9
|
@service_checker = service_checker
|
10
|
-
|
11
|
-
|
10
|
+
@http = Net::HTTP.new(service_checker.host, service_checker.port)
|
11
|
+
if service_checker.protocol == :https
|
12
|
+
@http.use_ssl = true
|
13
|
+
@http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
14
|
+
end
|
15
|
+
@request = Net::HTTP::Get.new(service_checker.path)
|
12
16
|
end
|
13
17
|
|
14
18
|
def get
|
15
19
|
begin
|
16
|
-
|
17
|
-
|
20
|
+
response = @http.request(@request)
|
21
|
+
@service_checker.response = response.body
|
22
|
+
case response.code
|
18
23
|
when '200', '201', '202', '203', '204', '205', '206'
|
19
24
|
true
|
20
25
|
else
|
21
|
-
@service_checker.error =
|
26
|
+
@service_checker.error = response.error
|
22
27
|
false
|
23
28
|
end
|
24
29
|
rescue Exception => e
|
data/lib/sonic/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sonic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Bulat
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -298,7 +298,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
298
298
|
version: '0'
|
299
299
|
requirements: []
|
300
300
|
rubyforge_project:
|
301
|
-
rubygems_version: 2.
|
301
|
+
rubygems_version: 2.4.5.1
|
302
302
|
signing_key:
|
303
303
|
specification_version: 4
|
304
304
|
summary: Sonic is a Rails Engine status page and services checker.
|