baton 0.5.5 → 0.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/baton/configuration.rb +2 -0
- data/lib/baton/version.rb +1 -1
- data/spec/baton/configuration_spec.rb +6 -0
- data/spec/fixtures/config.cfg +1 -0
- metadata +2 -2
data/lib/baton/configuration.rb
CHANGED
@@ -75,6 +75,7 @@ module Baton
|
|
75
75
|
# Pick a random host to connect to
|
76
76
|
self.host = rabbit_hosts[Kernel.rand(rabbit_hosts.size)]
|
77
77
|
self.amqp_host_list = rabbit_hosts
|
78
|
+
self.port = config["RABBIT_PORT"]
|
78
79
|
|
79
80
|
self.vhost = config["RABBIT_VHOST"]
|
80
81
|
self.user = config["RABBIT_USER"]
|
@@ -93,6 +94,7 @@ module Baton
|
|
93
94
|
def connection_opts
|
94
95
|
{
|
95
96
|
:host => host,
|
97
|
+
:port => port,
|
96
98
|
:vhost => vhost,
|
97
99
|
:user => user,
|
98
100
|
:password => password,
|
data/lib/baton/version.rb
CHANGED
@@ -12,6 +12,10 @@ describe Baton::Configuration do
|
|
12
12
|
subject.host.should eq("fromconfig.com")
|
13
13
|
end
|
14
14
|
|
15
|
+
it "will set the port" do
|
16
|
+
subject.port.should eq(12345)
|
17
|
+
end
|
18
|
+
|
15
19
|
it "will set the vhost" do
|
16
20
|
subject.vhost.should eq("fromconfig")
|
17
21
|
end
|
@@ -46,6 +50,7 @@ describe Baton::Configuration do
|
|
46
50
|
it "will return a config hash" do
|
47
51
|
subject.connection_opts.should eq({
|
48
52
|
host: "fromconfig.com",
|
53
|
+
port: 12345,
|
49
54
|
vhost: "fromconfig",
|
50
55
|
user: "fromconfiguser",
|
51
56
|
password: "fromconfigpass",
|
@@ -60,6 +65,7 @@ describe Baton::Configuration do
|
|
60
65
|
subject.vhost = nil
|
61
66
|
subject.connection_opts.should eq({
|
62
67
|
host: "fromconfig.com",
|
68
|
+
port: 12345,
|
63
69
|
user: "fromconfiguser",
|
64
70
|
password: "fromconfigpass",
|
65
71
|
pass: "fromconfigpass",
|
data/spec/fixtures/config.cfg
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: baton
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-07-
|
13
|
+
date: 2013-07-10 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: amqp
|