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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e751ac66842f4f9505abdccaaea22a47097b4efe
4
- data.tar.gz: 83e5a8460ad487ce4050e4f95f2be444f4b406d8
3
+ metadata.gz: 40c6ae14c79d9950e205b8bff5082d1d9ec685a0
4
+ data.tar.gz: e6fd638deb44a160b1283cca17f1a2a4825ae292
5
5
  SHA512:
6
- metadata.gz: 036ac86f06ac51bb87b8c3ff021b63c603d4be2caa2a57bb09d455a8a28545b20a8e083cb92bc41ade2146dcbc01e6d4cd967191c71cef7617799a9df11fa96e
7
- data.tar.gz: da4406469449d45d9351b1980a4be9ff8a809101eda659098421db6c7663edf71dc95f62b3f2f925189cda874213d376aaecac50de2a37b45038e54eac3d6b81
6
+ metadata.gz: ab01ed208a5d9c28e9027e08e37c197125ce6a19a4bbaae01d1f50df203e3ceb252b771c7522a9d2bfb5018900793449b2498c0b4863a8682076404b23f03fd5
7
+ data.tar.gz: b17e16c4812c53ec7247798ca6039d9b527d29304d3e0dace0bc4ca9c8c59a820d0cbe22d7e00864f729c6157b0a5b817ed7e54065c9677345791482310bde8b
@@ -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, :port => @service_checker.port)
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 = 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
@@ -1,3 +1,3 @@
1
1
  module Sonic
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
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.3
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-03-25 00:00:00.000000000 Z
11
+ date: 2014-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails