hare 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/hare/runner.rb +9 -4
- data/lib/hare/version.rb +1 -1
- metadata +4 -4
data/lib/hare/runner.rb
CHANGED
@@ -48,9 +48,14 @@ module Hare
|
|
48
48
|
opts.on("--exchange_name EXCHANGE", "The name of the AMQP exchange on which to connect") {
|
49
49
|
|exc| @options[:amqp][:exchange][:name] = exc
|
50
50
|
}
|
51
|
-
opts.on("--exchange_type TYPE", "The type of the AMQP exchange on which to connect")
|
52
|
-
|
53
|
-
|
51
|
+
opts.on("--exchange_type TYPE", "The type of the AMQP exchange on which to connect") do |type|
|
52
|
+
if ['topic', 'direct', 'fanout'].member? type
|
53
|
+
@options[:amqp][:exchange][:type] = type.to_sym
|
54
|
+
else
|
55
|
+
puts "Exchange type must be (topic|direct|fanout), not #{type}."
|
56
|
+
exit 1
|
57
|
+
end
|
58
|
+
end
|
54
59
|
opts.on("--username NAME", "The AMQP username.") {
|
55
60
|
|u| @options[:amqp][:username] = u
|
56
61
|
}
|
@@ -102,7 +107,7 @@ module Hare
|
|
102
107
|
b.start
|
103
108
|
|
104
109
|
eopts = amqp[:exchange]
|
105
|
-
exch = b.exchange(
|
110
|
+
exch = b.exchange(eopts[:name], :type => eopts[:type])
|
106
111
|
|
107
112
|
if @options[:publish]
|
108
113
|
exch.publish(@arguments[0], :key => amqp[:key])
|
data/lib/hare/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hare
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-11-
|
12
|
+
date: 2011-11-14 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bunny
|
16
|
-
requirement: &
|
16
|
+
requirement: &84422010 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: 0.7.8
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *84422010
|
25
25
|
description: The one pain-point I have had with AMQP is the lack of a series of command
|
26
26
|
line tools for smoke-testing components or sending my own messages through a queue.
|
27
27
|
Hare can be toggled either to produce messages, or to sit and listen/report for
|