sonic 0.1.3 → 0.1.4
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/amqp.rb +6 -2
- data/lib/sonic/service_checker.rb +8 -2
- data/lib/sonic/service_checker_builder.rb +4 -1
- data/lib/sonic/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40c6ae14c79d9950e205b8bff5082d1d9ec685a0
|
4
|
+
data.tar.gz: e6fd638deb44a160b1283cca17f1a2a4825ae292
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab01ed208a5d9c28e9027e08e37c197125ce6a19a4bbaae01d1f50df203e3ceb252b771c7522a9d2bfb5018900793449b2498c0b4863a8682076404b23f03fd5
|
7
|
+
data.tar.gz: b17e16c4812c53ec7247798ca6039d9b527d29304d3e0dace0bc4ca9c8c59a820d0cbe22d7e00864f729c6157b0a5b817ed7e54065c9677345791482310bde8b
|
data/lib/sonic/protocols/amqp.rb
CHANGED
@@ -6,12 +6,16 @@ module Sonic
|
|
6
6
|
include Protocol::Base
|
7
7
|
|
8
8
|
def initialize(service_checker)
|
9
|
-
@service_checker = service_checker
|
9
|
+
@service_checker = service_checker
|
10
10
|
end
|
11
11
|
|
12
12
|
def check
|
13
13
|
begin
|
14
|
-
conn = ::Bunny.new(:host => @service_checker.host,
|
14
|
+
conn = ::Bunny.new(:host => @service_checker.host,
|
15
|
+
:port => @service_checker.port,
|
16
|
+
:username => @service_checker.username,
|
17
|
+
:password => @service_checker.password,
|
18
|
+
:vhost => @service_checker.vhost)
|
15
19
|
conn.start
|
16
20
|
@service_checker.response = conn.status
|
17
21
|
if @service_checker.response == :open
|
@@ -4,6 +4,9 @@ module Sonic
|
|
4
4
|
attr_accessor :protocol
|
5
5
|
attr_accessor :host
|
6
6
|
attr_accessor :port
|
7
|
+
attr_accessor :username
|
8
|
+
attr_accessor :password
|
9
|
+
attr_accessor :vhost
|
7
10
|
attr_accessor :path
|
8
11
|
attr_accessor :payload
|
9
12
|
attr_accessor :ssl_key
|
@@ -11,14 +14,17 @@ module Sonic
|
|
11
14
|
attr_accessor :response
|
12
15
|
attr_accessor :error
|
13
16
|
|
14
|
-
def initialize(protocol, host, port, path=nil, payload=nil, ssl_cert=nil, ssl_key=nil)
|
17
|
+
def initialize(protocol, host, port, username=nil, password=nil, vhost=nil, path=nil, payload=nil, ssl_cert=nil, ssl_key=nil)
|
15
18
|
@protocol = protocol
|
16
19
|
@host = host
|
17
20
|
@port = port
|
21
|
+
@username = username
|
22
|
+
@password = password
|
23
|
+
@vhost = vhost
|
18
24
|
@path = path
|
19
25
|
@payload = payload
|
20
26
|
@ssl_key = ssl_key
|
21
|
-
@ssl_cert
|
27
|
+
@ssl_cert = ssl_cert
|
22
28
|
end
|
23
29
|
|
24
30
|
def check_service()
|
@@ -2,13 +2,16 @@ module Sonic
|
|
2
2
|
class ServiceCheckerBuilder
|
3
3
|
def protocol(v=nil); @protocol = v; self; end
|
4
4
|
def host(v=nil); @host = v; self; end
|
5
|
+
def username(v=nil); @username = v; self; end
|
6
|
+
def password(v=nil); @password = v; self; end
|
7
|
+
def vhost(v=nil); @vhost = v; self; end
|
5
8
|
def port(v=nil); @port = v; self; end
|
6
9
|
def path(v=nil); @path = v; self; end
|
7
10
|
def payload(v=nil); @payload = v; self; end
|
8
11
|
def ssl_cert(v=nil); @ssl_cert = v; self; end
|
9
12
|
def ssl_key(v=nil); @ssl_key = v; self; end
|
10
13
|
def build
|
11
|
-
Sonic::ServiceChecker.new(@protocol, @host, @port, @path, @payload, @ssl_cert, @ssl_key)
|
14
|
+
Sonic::ServiceChecker.new(@protocol, @host, @port, @username, @password, @vhost, @path, @payload, @ssl_cert, @ssl_key)
|
12
15
|
end
|
13
16
|
end
|
14
17
|
end
|
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.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Bulat
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|