beetle 0.2.9.2 → 0.2.9.3
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/beetle.gemspec +1 -1
- data/lib/beetle/configuration.rb +5 -0
- data/lib/beetle/publisher.rb +2 -1
- data/test/beetle/publisher_test.rb +1 -1
- metadata +4 -4
data/beetle.gemspec
CHANGED
data/lib/beetle/configuration.rb
CHANGED
@@ -47,6 +47,9 @@ module Beetle
|
|
47
47
|
# the password to use when connectiong to the AMQP servers (defaults to <tt>"guest"</tt>)
|
48
48
|
attr_accessor :password
|
49
49
|
|
50
|
+
# the socket timeout in seconds for message publishing (defaults to <tt>10.0</tt>)
|
51
|
+
attr_accessor :publishing_timeout
|
52
|
+
|
50
53
|
# external config file (defaults to <tt>no file</tt>)
|
51
54
|
attr_reader :config_file
|
52
55
|
|
@@ -70,6 +73,8 @@ module Beetle
|
|
70
73
|
self.user = "guest"
|
71
74
|
self.password = "guest"
|
72
75
|
|
76
|
+
self.publishing_timeout = 5.0
|
77
|
+
|
73
78
|
self.log_file = STDOUT
|
74
79
|
end
|
75
80
|
|
data/lib/beetle/publisher.rb
CHANGED
@@ -141,7 +141,8 @@ module Beetle
|
|
141
141
|
|
142
142
|
def new_bunny
|
143
143
|
b = Bunny.new(:host => current_host, :port => current_port, :logging => !!@options[:logging],
|
144
|
-
:user => Beetle.config.user, :pass => Beetle.config.password, :vhost => Beetle.config.vhost
|
144
|
+
:user => Beetle.config.user, :pass => Beetle.config.password, :vhost => Beetle.config.vhost,
|
145
|
+
:socket_timeout => Beetle.config.publishing_timeout)
|
145
146
|
b.start
|
146
147
|
b
|
147
148
|
end
|
@@ -19,7 +19,7 @@ module Beetle
|
|
19
19
|
m = mock("dummy")
|
20
20
|
expected_bunny_options = {
|
21
21
|
:host => @pub.send(:current_host), :port => @pub.send(:current_port),
|
22
|
-
:logging => false, :user => "guest", :pass => "guest", :vhost => "/"
|
22
|
+
:logging => false, :user => "guest", :pass => "guest", :vhost => "/", :socket_timeout => 5.0
|
23
23
|
}
|
24
24
|
Bunny.expects(:new).with(expected_bunny_options).returns(m)
|
25
25
|
m.expects(:start)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: beetle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 125
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
9
|
- 9
|
10
|
-
-
|
11
|
-
version: 0.2.9.
|
10
|
+
- 3
|
11
|
+
version: 0.2.9.3
|
12
12
|
platform: ruby
|
13
13
|
authors:
|
14
14
|
- Stefan Kaes
|
@@ -19,7 +19,7 @@ autorequire:
|
|
19
19
|
bindir: bin
|
20
20
|
cert_chain: []
|
21
21
|
|
22
|
-
date: 2010-11-
|
22
|
+
date: 2010-11-22 00:00:00 +01:00
|
23
23
|
default_executable: beetle
|
24
24
|
dependencies:
|
25
25
|
- !ruby/object:Gem::Dependency
|