euston-rabbitmq 1.0.3-java → 1.0.4-java

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'euston-rabbitmq'
3
- s.version = '1.0.3'
3
+ s.version = '1.0.4'
4
4
  s.platform = RUBY_PLATFORM.to_s == 'java' ? 'java' : Gem::Platform::RUBY
5
5
  s.authors = ['Lee Henson', 'Guy Boertje']
6
6
  s.email = ['lee.m.henson@gmail.com', 'guyboertje@gmail.com']
@@ -38,7 +38,6 @@ Gem::Specification.new do |s|
38
38
  spec/spec_helper.rb
39
39
  spec/support/filters.rb
40
40
  spec/support/queue_subscription_thread_harness.rb
41
- spec/support/rabbitmqadmin.rb
42
41
  ]
43
42
  # = MANIFEST =
44
43
 
@@ -59,7 +58,8 @@ Gem::Specification.new do |s|
59
58
  s.add_dependency 'jessica', '~> 1.0.0'
60
59
  end
61
60
 
62
- s.add_development_dependency 'awesome_print', '~> 0.4.0'
63
- s.add_development_dependency 'fuubar', '~> 0.0.0'
64
- s.add_development_dependency 'rspec', '~> 2.6.0'
61
+ s.add_development_dependency 'awesome_print', '~> 0.4.0'
62
+ s.add_development_dependency 'fuubar', '~> 0.0.0'
63
+ s.add_development_dependency 'rabbitmqadmin-cli', '~> 1.0.0'
64
+ s.add_development_dependency 'rspec', '~> 2.6.0'
65
65
  end
@@ -1,5 +1,5 @@
1
1
  module Euston
2
2
  module RabbitMq
3
- VERSION = "1.0.3"
3
+ VERSION = "1.0.4"
4
4
  end
5
5
  end
data/spec/spec_helper.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'ap'
2
+ require 'rabbitmqadmin-cli'
2
3
  require 'euston-rabbitmq'
3
4
 
4
5
  def jruby?
@@ -4,7 +4,7 @@ def initialize_amqp
4
4
  end
5
5
 
6
6
  def initialize_rabbitmq
7
- @rabbitmqadmin = RabbitMqAdmin.new
7
+ @rabbitmqadmin = RabbitMqAdminCli.new
8
8
  @rabbitmqadmin.initialize_vhost AMQP_OPTS[:vhost]
9
9
  @rabbitmqadmin.initialize_user AMQP_OPTS[:vhost], AMQP_OPTS[:user], AMQP_OPTS[:pass]
10
10
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: euston-rabbitmq
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.0.3
5
+ version: 1.0.4
6
6
  platform: java
7
7
  authors:
8
8
  - Lee Henson
@@ -10,150 +10,161 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2011-09-27 00:00:00.000000000 +01:00
13
+ date: 2011-09-28 00:00:00.000000000 +01:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activesupport
18
- version_requirements: &2170 !ruby/object:Gem::Requirement
18
+ version_requirements: &2174 !ruby/object:Gem::Requirement
19
19
  requirements:
20
20
  - - ~>
21
21
  - !ruby/object:Gem::Version
22
22
  version: 3.0.10
23
23
  none: false
24
- requirement: *2170
24
+ requirement: *2174
25
25
  prerelease: false
26
26
  type: :runtime
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: euston
29
- version_requirements: &2188 !ruby/object:Gem::Requirement
29
+ version_requirements: &2192 !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: 1.0.1
34
34
  none: false
35
- requirement: *2188
35
+ requirement: *2192
36
36
  prerelease: false
37
37
  type: :runtime
38
38
  - !ruby/object:Gem::Dependency
39
39
  name: euston-eventstore
40
- version_requirements: &2204 !ruby/object:Gem::Requirement
40
+ version_requirements: &2208 !ruby/object:Gem::Requirement
41
41
  requirements:
42
42
  - - ~>
43
43
  - !ruby/object:Gem::Version
44
44
  version: 1.0.0
45
45
  none: false
46
- requirement: *2204
46
+ requirement: *2208
47
47
  prerelease: false
48
48
  type: :runtime
49
49
  - !ruby/object:Gem::Dependency
50
50
  name: hash-keys
51
- version_requirements: &2220 !ruby/object:Gem::Requirement
51
+ version_requirements: &2224 !ruby/object:Gem::Requirement
52
52
  requirements:
53
53
  - - ~>
54
54
  - !ruby/object:Gem::Version
55
55
  version: 1.0.0
56
56
  none: false
57
- requirement: *2220
57
+ requirement: *2224
58
58
  prerelease: false
59
59
  type: :runtime
60
60
  - !ruby/object:Gem::Dependency
61
61
  name: hollywood
62
- version_requirements: &2236 !ruby/object:Gem::Requirement
62
+ version_requirements: &2240 !ruby/object:Gem::Requirement
63
63
  requirements:
64
64
  - - ~>
65
65
  - !ruby/object:Gem::Version
66
66
  version: 1.0.0
67
67
  none: false
68
- requirement: *2236
68
+ requirement: *2240
69
69
  prerelease: false
70
70
  type: :runtime
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: i18n
73
- version_requirements: &2252 !ruby/object:Gem::Requirement
73
+ version_requirements: &2256 !ruby/object:Gem::Requirement
74
74
  requirements:
75
75
  - - ~>
76
76
  - !ruby/object:Gem::Version
77
77
  version: 0.5.0
78
78
  none: false
79
- requirement: *2252
79
+ requirement: *2256
80
80
  prerelease: false
81
81
  type: :runtime
82
82
  - !ruby/object:Gem::Dependency
83
83
  name: require_all
84
- version_requirements: &2268 !ruby/object:Gem::Requirement
84
+ version_requirements: &2272 !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - ~>
87
87
  - !ruby/object:Gem::Version
88
88
  version: 1.2.0
89
89
  none: false
90
- requirement: *2268
90
+ requirement: *2272
91
91
  prerelease: false
92
92
  type: :runtime
93
93
  - !ruby/object:Gem::Dependency
94
94
  name: robustthread
95
- version_requirements: &2284 !ruby/object:Gem::Requirement
95
+ version_requirements: &2288 !ruby/object:Gem::Requirement
96
96
  requirements:
97
97
  - - ~>
98
98
  - !ruby/object:Gem::Version
99
99
  version: 0.5.2
100
100
  none: false
101
- requirement: *2284
101
+ requirement: *2288
102
102
  prerelease: false
103
103
  type: :runtime
104
104
  - !ruby/object:Gem::Dependency
105
105
  name: safely
106
- version_requirements: &2300 !ruby/object:Gem::Requirement
106
+ version_requirements: &2304 !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - ~>
109
109
  - !ruby/object:Gem::Version
110
110
  version: 0.3.0
111
111
  none: false
112
- requirement: *2300
112
+ requirement: *2304
113
113
  prerelease: false
114
114
  type: :runtime
115
115
  - !ruby/object:Gem::Dependency
116
116
  name: jessica
117
- version_requirements: &2316 !ruby/object:Gem::Requirement
117
+ version_requirements: &2320 !ruby/object:Gem::Requirement
118
118
  requirements:
119
119
  - - ~>
120
120
  - !ruby/object:Gem::Version
121
121
  version: 1.0.0
122
122
  none: false
123
- requirement: *2316
123
+ requirement: *2320
124
124
  prerelease: false
125
125
  type: :runtime
126
126
  - !ruby/object:Gem::Dependency
127
127
  name: awesome_print
128
- version_requirements: &2332 !ruby/object:Gem::Requirement
128
+ version_requirements: &2336 !ruby/object:Gem::Requirement
129
129
  requirements:
130
130
  - - ~>
131
131
  - !ruby/object:Gem::Version
132
132
  version: 0.4.0
133
133
  none: false
134
- requirement: *2332
134
+ requirement: *2336
135
135
  prerelease: false
136
136
  type: :development
137
137
  - !ruby/object:Gem::Dependency
138
138
  name: fuubar
139
- version_requirements: &2350 !ruby/object:Gem::Requirement
139
+ version_requirements: &2354 !ruby/object:Gem::Requirement
140
140
  requirements:
141
141
  - - ~>
142
142
  - !ruby/object:Gem::Version
143
143
  version: 0.0.0
144
144
  none: false
145
- requirement: *2350
145
+ requirement: *2354
146
+ prerelease: false
147
+ type: :development
148
+ - !ruby/object:Gem::Dependency
149
+ name: rabbitmqadmin-cli
150
+ version_requirements: &2370 !ruby/object:Gem::Requirement
151
+ requirements:
152
+ - - ~>
153
+ - !ruby/object:Gem::Version
154
+ version: 1.0.0
155
+ none: false
156
+ requirement: *2370
146
157
  prerelease: false
147
158
  type: :development
148
159
  - !ruby/object:Gem::Dependency
149
160
  name: rspec
150
- version_requirements: &2366 !ruby/object:Gem::Requirement
161
+ version_requirements: &2386 !ruby/object:Gem::Requirement
151
162
  requirements:
152
163
  - - ~>
153
164
  - !ruby/object:Gem::Version
154
165
  version: 2.6.0
155
166
  none: false
156
- requirement: *2366
167
+ requirement: *2386
157
168
  prerelease: false
158
169
  type: :development
159
170
  description: JRuby RabbitMq bindings
@@ -192,7 +203,6 @@ files:
192
203
  - spec/spec_helper.rb
193
204
  - spec/support/filters.rb
194
205
  - spec/support/queue_subscription_thread_harness.rb
195
- - spec/support/rabbitmqadmin.rb
196
206
  has_rdoc: true
197
207
  homepage: http://github.com/leemhenson/euston-rabbitmq
198
208
  licenses: []
@@ -1,74 +0,0 @@
1
- class RabbitMqAdmin
2
- def initialize admin_user = 'guest', admin_password = 'guest'
3
- @admin_user = admin_user
4
- @admin_password = admin_password
5
- end
6
-
7
- def delete_exchanges
8
- list_exchanges.each { |exchange| `#{run vhost} delete exchange name=#{exchange[:name]}` }
9
- end
10
-
11
- def delete_queues
12
- list_queues.each { |queue| `#{run vhost} delete queue name=#{queue[:name]}` }
13
- end
14
-
15
- def initialize_user vhost, user, password, tags = ''
16
- `#{run} delete user name=#{user}` if user_exists? user
17
- `#{run} declare user name=#{user} password=#{password} tags=#{tags}`
18
- add_user_to_vhost vhost, user
19
- end
20
-
21
- def initialize_vhost vhost
22
- `#{run} delete vhost name=#{vhost}` if vhost_exists? vhost
23
- `#{run} declare vhost name=#{vhost}`
24
- add_user_to_vhost vhost, @admin_user
25
- end
26
-
27
- def run vhost = nil
28
- vhost_arg = vhost.nil? ? '' : "-V #{vhost}"
29
-
30
- "rabbitmqadmin -u #{@admin_user} -p #{@admin_password} -f raw_json #{vhost_arg}"
31
- end
32
-
33
- def list_bindings vhost
34
- parse `#{run vhost} list bindings`
35
- end
36
-
37
- def list_exchanges vhost
38
- parse `#{run vhost} list exchanges`
39
- end
40
-
41
- def list_queues vhost
42
- parse `#{run vhost} list queues`
43
- end
44
-
45
- def list_users
46
- parse `#{run} list users`
47
- end
48
-
49
- def list_vhosts
50
- parse `#{run} list vhosts`
51
- end
52
-
53
- def purge_queues
54
- list_queues.each { |queue| `#{run vhost} purge queue name=#{queue[:name]}` }
55
- end
56
-
57
- def user_exists? user
58
- list_users.any? { |u| u[:name] == user }
59
- end
60
-
61
- def vhost_exists? vhost
62
- list_vhosts.any? { |h| h[:name] == vhost }
63
- end
64
-
65
- private
66
-
67
- def parse json
68
- JSON.parse json, :symbolize_names => true
69
- end
70
-
71
- def add_user_to_vhost vhost, user
72
- `#{run} -V #{vhost} declare permission vhost=#{vhost} user=#{user} configure=\"\.\*\" write=\"\.\*\" read=\"\.\*\"`
73
- end
74
- end