apollo-tools 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/apollo/rabbitmq.rb +3 -1
- data/lib/apollo/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: dad0a81ddb78aa0caeb2fc24b57dcc6fef939632
|
4
|
+
data.tar.gz: 41333fbf3c7cbb2476fb4e474818c78f8e44a0c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 067d2d43fb6857d9028e723309b4972bbef86579d97ed3fada1a13691dacde8cdad85e75f4937ca86f87d0bfe7e5c90500cc010c0712204611b243df8a0754b2
|
7
|
+
data.tar.gz: 67bed98e61298663404bcb84c5897b6d962fb858228f1bc83e7bdbbb30a29d6ac9e17909b2aaac1b3433860bf843e33b142d05aaa21ecd740a75208eef639d48
|
data/lib/apollo/rabbitmq.rb
CHANGED
@@ -12,13 +12,15 @@ module Apollo
|
|
12
12
|
# @option opts [String] :rmq_username The username to connect to the rabbitmq server
|
13
13
|
# @option opts [String] :rmq_password The password to connect to the rabbitmq server
|
14
14
|
# @option opts [String] :address the hostname or ip to connect to the rabbitmq server
|
15
|
+
# @option opts [String] :vhost the vhost to connect to
|
15
16
|
# @option opts [Integer] :port the port to connect to the rabbitmq server
|
16
17
|
def initialize(exchange, key, opts = {})
|
17
18
|
username = CGI.escape opts.fetch(:rmq_username, 'guest')
|
18
19
|
password = CGI.escape opts.fetch(:rmq_password, 'guest')
|
19
20
|
host = opts.fetch(:ip, opts.fetch(:hostname, '127.0.0.1'))
|
20
21
|
port = opts.fetch(:port, 5672)
|
21
|
-
|
22
|
+
vhost = opts.fetch(:vhost, '/')
|
23
|
+
@conn = Bunny.new("amqp://#{username}:#{password}@#{host}:#{port}#{vhost}")
|
22
24
|
@conn.start
|
23
25
|
raise 'connection is nil' if @conn.nil?
|
24
26
|
@ch = @conn.create_channel
|
data/lib/apollo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apollo-tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brendan Tobolaski
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|