bugs_bunny 0.0.7 → 0.0.8
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/README.rdoc +73 -8
- data/VERSION +1 -1
- data/bin/bbunny +14 -8
- data/bugs_bunny.gemspec +1 -1
- data/lib/bugs_bunny/cli.rb +7 -7
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -1,16 +1,81 @@
|
|
1
|
-
=
|
1
|
+
= Bugs Bunny
|
2
|
+
|
3
|
+
RabbitMQ Playground
|
4
|
+
|
5
|
+
|
6
|
+
== Qual é o pó, doutor?
|
7
|
+
|
8
|
+
Run 'bbunny config' to create a rabbitmq.yml conf file, edit it, play.
|
9
|
+
|
10
|
+
|
11
|
+
=== bbunny queues
|
12
|
+
|
13
|
+
Lists all queues in the vhost.
|
14
|
+
|
15
|
+
works (volatile): 0 messages
|
16
|
+
todo (volatile): 0 messages
|
17
|
+
|
18
|
+
|
19
|
+
=== bbunny queues new works
|
20
|
+
|
21
|
+
Creates a queue 'works'.
|
22
|
+
|
23
|
+
|
24
|
+
=== bbunny queue works add "Nice message"
|
25
|
+
|
26
|
+
Adds a message to the queue.
|
27
|
+
|
28
|
+
|
29
|
+
=== bbunny queue works pop
|
30
|
+
|
31
|
+
Pops a message from the queue.
|
32
|
+
|
33
|
+
Pop => MQ::Header...
|
34
|
+
Body => "Improve Bugs Bunny"
|
35
|
+
|
36
|
+
|
37
|
+
=== bbunny queue works inspect
|
38
|
+
|
39
|
+
Live inspection of the queue.
|
40
|
+
|
41
|
+
-------
|
42
|
+
QUEUE 1 (application/octet-stream): Mode 1
|
43
|
+
Consumer: todo-908051891800 Exchange:
|
44
|
+
|
45
|
+
Body:
|
46
|
+
Improve Bugs Bunny
|
47
|
+
|
48
|
+
-------
|
49
|
+
QUEUE 2 (application/octet-stream): Mode 1
|
50
|
+
Consumer: todo-908051891800 Exchange:
|
51
|
+
|
52
|
+
Body:
|
53
|
+
{:ruby => "object"}
|
54
|
+
|
55
|
+
|
56
|
+
=== Check out -h for all commands
|
57
|
+
|
58
|
+
Purge, delete, full CRUD ;)
|
59
|
+
|
60
|
+
|
61
|
+
== Marshal/JSON
|
62
|
+
|
63
|
+
Bugs Bunny will try to load your data using Marshal.
|
64
|
+
You may define json on the conf file.
|
65
|
+
|
66
|
+
|
67
|
+
=== Nanite
|
68
|
+
|
69
|
+
Bugs Bunny will load the nanite gem if you have it avaiable.
|
70
|
+
So you can Unmarshal it's objects.
|
2
71
|
|
3
|
-
Description goes here.
|
4
72
|
|
5
73
|
== Note on Patches/Pull Requests
|
6
|
-
|
74
|
+
|
7
75
|
* Fork the project.
|
8
76
|
* Make your feature addition or bug fix.
|
9
|
-
* Add
|
10
|
-
|
11
|
-
* Commit, do not mess with rakefile, version, or history.
|
12
|
-
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
13
|
-
* Send me a pull request. Bonus points for topic branches.
|
77
|
+
* Add and run our cli cuke suite ;)
|
78
|
+
* Send me a pull request.
|
14
79
|
|
15
80
|
== Copyright
|
16
81
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.8
|
data/bin/bbunny
CHANGED
@@ -14,21 +14,27 @@ Commands:
|
|
14
14
|
|
15
15
|
vhosts - List vhosts
|
16
16
|
users - List and filter items
|
17
|
-
queues -
|
17
|
+
queues - List queues
|
18
|
+
new - Create a new queue
|
19
|
+
purge - Purge all queues
|
20
|
+
delete - Remove all the queues closing all connections
|
21
|
+
queue - Expects the queue name
|
22
|
+
add - Create a new message on the queue
|
23
|
+
pop - Pop a message from the queue
|
24
|
+
list - Snapshot of the queue
|
25
|
+
inspect - Live view
|
26
|
+
purge - Purge a queue
|
27
|
+
delete - Remove the queue closing all connections
|
18
28
|
clear - Wipe out mnesia
|
19
|
-
config -
|
20
|
-
|
21
|
-
Common usage:
|
22
|
-
|
23
|
-
pyradise queue foo
|
29
|
+
config - Generates a config file for the AMQP connection
|
24
30
|
|
25
31
|
Options:
|
26
32
|
|
27
33
|
BANNER
|
28
34
|
o.on('-c CONFIG', "Config file path") { |path| Opt[:config] = path }
|
29
35
|
o.on('-p PATH', "Output path for config file") { |path| Opt[:out] = path }
|
30
|
-
o.on('-v', "
|
31
|
-
o.on('-f', "
|
36
|
+
o.on('-v', "--verbose") { |b| Opt[:verbose] = true }
|
37
|
+
o.on('-f', "--force") { |b| Opt[:force] = true }
|
32
38
|
o.on('-h') { puts o; exit }
|
33
39
|
o.parse!
|
34
40
|
end
|
data/bugs_bunny.gemspec
CHANGED
data/lib/bugs_bunny/cli.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Command Line Stuff
|
2
2
|
require 'yaml'
|
3
3
|
begin # Needed (really?) for ruby 1.8
|
4
|
-
|
4
|
+
require 'ftools'
|
5
5
|
rescue LoadError
|
6
6
|
end
|
7
7
|
|
@@ -34,7 +34,7 @@ module BugsBunny
|
|
34
34
|
puts "Config file already exists"
|
35
35
|
exit
|
36
36
|
else
|
37
|
-
|
37
|
+
FileUtils.copy(File.dirname(__FILE__) + "/#{CONFIG_FILE}", path)
|
38
38
|
puts "Copied config file to #{path}"
|
39
39
|
end
|
40
40
|
end
|
@@ -46,17 +46,17 @@ module BugsBunny
|
|
46
46
|
puts *args
|
47
47
|
end
|
48
48
|
|
49
|
-
def config_exists?(path
|
50
|
-
File.exists?(path +
|
49
|
+
def config_exists?(path)
|
50
|
+
File.exists?(path + CONFIG_FILE)
|
51
51
|
end
|
52
52
|
|
53
53
|
def parse_config
|
54
54
|
unless file = Opt[:config]
|
55
55
|
file = ["", "config/"].select { |p| config_exists?(p) }[0]
|
56
|
-
file += CONFIG_FILE
|
56
|
+
file += CONFIG_FILE if file
|
57
57
|
end
|
58
|
-
unless File.exists?(file)
|
59
|
-
puts "No config file"; exit
|
58
|
+
unless file && File.exists?(file)
|
59
|
+
puts "No config file.\nCreate one with 'config'"; exit
|
60
60
|
end
|
61
61
|
Opt[:rabbit].merge! YAML.load(File.read(file))
|
62
62
|
end
|