hot_bunnies 1.2.2-java → 1.3.1-java
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/hot_bunnies.rb +51 -7
- data/lib/hot_bunnies/queue.rb +4 -0
- data/lib/hot_bunnies/version.rb +1 -1
- metadata +43 -26
data/lib/hot_bunnies.rb
CHANGED
@@ -14,17 +14,61 @@ module HotBunnies
|
|
14
14
|
|
15
15
|
import com.rabbitmq.client.AMQP
|
16
16
|
|
17
|
-
CONNECTION_PROPERTIES = [:host, :port, :virtual_host, :connection_timeout, :username, :password]
|
18
|
-
|
19
17
|
def self.connect(options={})
|
20
18
|
cf = ConnectionFactory.new
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
19
|
+
|
20
|
+
cf.host = hostname_from(options) if include_host?(options)
|
21
|
+
cf.port = options[:port] if options[:port]
|
22
|
+
cf.virtual_host = vhost_from(options) if include_vhost?(options)
|
23
|
+
cf.connection_timeout = timeout_from(options) if include_timeout?(options)
|
24
|
+
cf.username = username_from(options) if include_username?(options)
|
25
|
+
cf.password = password_from(options) if include_password?(options)
|
26
|
+
|
26
27
|
cf.new_connection
|
27
28
|
end
|
29
|
+
|
30
|
+
|
31
|
+
protected
|
32
|
+
|
33
|
+
def self.hostname_from(options)
|
34
|
+
options[:host] || options[:hostname] || ConnectionFactory.DEFAULT_HOST
|
35
|
+
end
|
36
|
+
|
37
|
+
def self.include_host?(options)
|
38
|
+
!!(options[:host] || options[:hostname])
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.vhost_from(options)
|
42
|
+
options[:virtual_host] || options[:vhost] || ConnectionFactory.DEFAULT_VHOST
|
43
|
+
end
|
44
|
+
|
45
|
+
def self.include_vhost?(options)
|
46
|
+
!!(options[:virtual_host] || options[:vhost])
|
47
|
+
end
|
48
|
+
|
49
|
+
def self.timeout_from(options)
|
50
|
+
options[:connection_timeout] || options[:timeout]
|
51
|
+
end
|
52
|
+
|
53
|
+
def self.include_timeout?(options)
|
54
|
+
!!(options[:connection_timeout] || options[:timeout])
|
55
|
+
end
|
56
|
+
|
57
|
+
def self.username_from(options)
|
58
|
+
options[:username] || options[:user] || ConnectionFactory.DEFAULT_USER
|
59
|
+
end
|
60
|
+
|
61
|
+
def self.include_username?(options)
|
62
|
+
!!(options[:username] || options[:user])
|
63
|
+
end
|
64
|
+
|
65
|
+
def self.password_from(options)
|
66
|
+
options[:password] || options[:pass] || ConnectionFactory.DEFAULT_PASS
|
67
|
+
end
|
68
|
+
|
69
|
+
def self.include_password?(options)
|
70
|
+
!!(options[:password] || options[:pass])
|
71
|
+
end
|
28
72
|
end
|
29
73
|
|
30
74
|
require 'hot_bunnies/channel'
|
data/lib/hot_bunnies/queue.rb
CHANGED
data/lib/hot_bunnies/version.rb
CHANGED
metadata
CHANGED
@@ -1,25 +1,34 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: hot_bunnies
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 25
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 3
|
9
|
+
- 1
|
10
|
+
version: 1.3.1
|
6
11
|
platform: java
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Theo Hultberg
|
9
14
|
- Michael S. Klishin
|
10
|
-
autorequire:
|
15
|
+
autorequire:
|
11
16
|
bindir: bin
|
12
17
|
cert_chain: []
|
13
|
-
|
14
|
-
|
18
|
+
|
19
|
+
date: 2011-11-10 00:00:00 Z
|
15
20
|
dependencies: []
|
21
|
+
|
16
22
|
description: A object oriented interface to RabbitMQ that uses the Java driver under the hood
|
17
|
-
email:
|
23
|
+
email:
|
18
24
|
- theo@burtcorp.com
|
19
25
|
executables: []
|
26
|
+
|
20
27
|
extensions: []
|
28
|
+
|
21
29
|
extra_rdoc_files: []
|
22
|
-
|
30
|
+
|
31
|
+
files:
|
23
32
|
- .gitignore
|
24
33
|
- .rvmrc
|
25
34
|
- .travis.yml
|
@@ -49,30 +58,38 @@ files:
|
|
49
58
|
- spec/integration/queue_unbind_spec.rb
|
50
59
|
- spec/integration/sender_selected_distribution_spec.rb
|
51
60
|
- spec/spec_helper.rb
|
52
|
-
has_rdoc: true
|
53
61
|
homepage: http://github.com/iconara/hot_bunnies
|
54
62
|
licenses: []
|
55
|
-
|
63
|
+
|
64
|
+
post_install_message:
|
56
65
|
rdoc_options: []
|
57
|
-
|
66
|
+
|
67
|
+
require_paths:
|
58
68
|
- lib
|
59
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
60
|
-
requirements:
|
61
|
-
- - ! '>='
|
62
|
-
- !ruby/object:Gem::Version
|
63
|
-
version: '0'
|
69
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
64
70
|
none: false
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
hash: 3
|
75
|
+
segments:
|
76
|
+
- 0
|
77
|
+
version: "0"
|
78
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
70
79
|
none: false
|
80
|
+
requirements:
|
81
|
+
- - ">="
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
hash: 3
|
84
|
+
segments:
|
85
|
+
- 0
|
86
|
+
version: "0"
|
71
87
|
requirements: []
|
88
|
+
|
72
89
|
rubyforge_project: hot_bunnies
|
73
|
-
rubygems_version: 1.
|
74
|
-
signing_key:
|
90
|
+
rubygems_version: 1.8.10
|
91
|
+
signing_key:
|
75
92
|
specification_version: 3
|
76
93
|
summary: Ruby wrapper for the RabbitMQ Java driver
|
77
94
|
test_files: []
|
78
|
-
|
95
|
+
|