hot_bunnies 1.3.4-java → 1.3.5-java
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +5 -5
- data/lib/hot_bunnies.rb +20 -0
- data/lib/hot_bunnies/version.rb +1 -1
- data/spec/integration/connection_spec.rb +19 -0
- metadata +25 -43
data/.travis.yml
CHANGED
data/lib/hot_bunnies.rb
CHANGED
@@ -17,6 +17,7 @@ module HotBunnies
|
|
17
17
|
def self.connect(options={})
|
18
18
|
cf = ConnectionFactory.new
|
19
19
|
|
20
|
+
cf.uri = options[:uri] if options[:uri]
|
20
21
|
cf.host = hostname_from(options) if include_host?(options)
|
21
22
|
cf.port = options[:port] if options[:port]
|
22
23
|
cf.virtual_host = vhost_from(options) if include_vhost?(options)
|
@@ -24,6 +25,9 @@ module HotBunnies
|
|
24
25
|
cf.username = username_from(options) if include_username?(options)
|
25
26
|
cf.password = password_from(options) if include_password?(options)
|
26
27
|
|
28
|
+
cf.requested_heartbeat = heartbeat_from(options) if include_heartbeat?(options)
|
29
|
+
cf.connection_timeout = connection_timeout_from(options) if include_connection_timeout?(options)
|
30
|
+
|
27
31
|
cf.new_connection
|
28
32
|
end
|
29
33
|
|
@@ -58,6 +62,14 @@ module HotBunnies
|
|
58
62
|
options[:username] || options[:user] || ConnectionFactory.DEFAULT_USER
|
59
63
|
end
|
60
64
|
|
65
|
+
def self.heartbeat_from(options)
|
66
|
+
options[:heartbeat_interval] || options[:requested_heartbeat] || ConnectionFactory.DEFAULT_HEARTBEAT
|
67
|
+
end
|
68
|
+
|
69
|
+
def self.connection_timeout_from(options)
|
70
|
+
options[:connection_timeout_interval] || options[:connection_timeout] || ConnectionFactory.DEFAULT_CONNECTION_TIMEOUT
|
71
|
+
end
|
72
|
+
|
61
73
|
def self.include_username?(options)
|
62
74
|
!!(options[:username] || options[:user])
|
63
75
|
end
|
@@ -69,6 +81,14 @@ module HotBunnies
|
|
69
81
|
def self.include_password?(options)
|
70
82
|
!!(options[:password] || options[:pass])
|
71
83
|
end
|
84
|
+
|
85
|
+
def self.include_heartbeat?(options)
|
86
|
+
!!(options[:heartbeat_interval] || options[:requested_heartbeat] || options[:heartbeat])
|
87
|
+
end
|
88
|
+
|
89
|
+
def self.include_connection_timeout?(options)
|
90
|
+
!!(options[:connection_timeout_interval] || options[:connection_timeout])
|
91
|
+
end
|
72
92
|
end
|
73
93
|
|
74
94
|
require 'hot_bunnies/channel'
|
data/lib/hot_bunnies/version.rb
CHANGED
@@ -0,0 +1,19 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
|
4
|
+
describe "HotBunnies" do
|
5
|
+
|
6
|
+
#
|
7
|
+
# Examples
|
8
|
+
#
|
9
|
+
|
10
|
+
it "lets you specify requested heartbeat interval" do
|
11
|
+
c1 = HotBunnies.connect(:requested_heartbeat => 10)
|
12
|
+
c1.close
|
13
|
+
end
|
14
|
+
|
15
|
+
it "lets you specify connection timeout interval" do
|
16
|
+
c1 = HotBunnies.connect(:connection_timeout => 3)
|
17
|
+
c1.close
|
18
|
+
end
|
19
|
+
end
|
metadata
CHANGED
@@ -1,34 +1,24 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: hot_bunnies
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 3
|
9
|
-
- 4
|
10
|
-
version: 1.3.4
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: 1.3.5
|
11
6
|
platform: java
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Theo Hultberg
|
14
9
|
- Michael S. Klishin
|
15
|
-
autorequire:
|
10
|
+
autorequire:
|
16
11
|
bindir: bin
|
17
12
|
cert_chain: []
|
18
|
-
|
19
|
-
date: 2012-01-04 00:00:00 Z
|
13
|
+
date: 2012-02-07 00:00:00.000000000Z
|
20
14
|
dependencies: []
|
21
|
-
|
22
15
|
description: A object oriented interface to RabbitMQ that uses the Java driver under the hood
|
23
|
-
email:
|
16
|
+
email:
|
24
17
|
- theo@burtcorp.com
|
25
18
|
executables: []
|
26
|
-
|
27
19
|
extensions: []
|
28
|
-
|
29
20
|
extra_rdoc_files: []
|
30
|
-
|
31
|
-
files:
|
21
|
+
files:
|
32
22
|
- .gitignore
|
33
23
|
- .rvmrc
|
34
24
|
- .travis.yml
|
@@ -49,6 +39,7 @@ files:
|
|
49
39
|
- lib/hot_bunnies/version.rb
|
50
40
|
- spec/integration/alternate_exchanges_spec.rb
|
51
41
|
- spec/integration/basic_consume_spec.rb
|
42
|
+
- spec/integration/connection_spec.rb
|
52
43
|
- spec/integration/exchange_bind_spec.rb
|
53
44
|
- spec/integration/exchange_declare_spec.rb
|
54
45
|
- spec/integration/publisher_confirmations_spec.rb
|
@@ -61,36 +52,27 @@ files:
|
|
61
52
|
- spec/spec_helper.rb
|
62
53
|
homepage: http://github.com/iconara/hot_bunnies
|
63
54
|
licenses: []
|
64
|
-
|
65
|
-
post_install_message:
|
55
|
+
post_install_message:
|
66
56
|
rdoc_options: []
|
67
|
-
|
68
|
-
require_paths:
|
57
|
+
require_paths:
|
69
58
|
- lib
|
70
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
59
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - ! '>='
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '0'
|
71
64
|
none: false
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
- 0
|
78
|
-
version: "0"
|
79
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
65
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
80
70
|
none: false
|
81
|
-
requirements:
|
82
|
-
- - ">="
|
83
|
-
- !ruby/object:Gem::Version
|
84
|
-
hash: 3
|
85
|
-
segments:
|
86
|
-
- 0
|
87
|
-
version: "0"
|
88
71
|
requirements: []
|
89
|
-
|
90
72
|
rubyforge_project: hot_bunnies
|
91
|
-
rubygems_version: 1.8.
|
92
|
-
signing_key:
|
73
|
+
rubygems_version: 1.8.15
|
74
|
+
signing_key:
|
93
75
|
specification_version: 3
|
94
76
|
summary: Ruby wrapper for the RabbitMQ Java driver
|
95
77
|
test_files: []
|
96
|
-
|
78
|
+
...
|