amqp-utils 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.0
1
+ 0.5.1
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{amqp-utils}
8
- s.version = "0.5.0"
8
+ s.version = "0.5.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Doug Barth"]
12
- s.date = %q{2011-09-27}
12
+ s.date = %q{2011-10-07}
13
13
  s.description = %q{Command line utilies for interacting with AMQP compliant queues.
14
14
  The intention is provide simple management tools that can be used to complete ad hoc
15
15
  housework on an AMQP queue. In addition, simple scripts can be layered over the tools
@@ -22,6 +22,7 @@ class PeekCommand < AmqpUtils::Command
22
22
  options.opt :quiet, 'Suppresses non-message content output',
23
23
  :short => 'q', :default => false
24
24
  options.opt :num, 'Number of msgs to peek',:short => 'n', :default => 1
25
+ options.opt :raw, 'Do not deserialize message for display', :default => false
25
26
  end
26
27
 
27
28
  def validate
@@ -40,7 +41,13 @@ class PeekCommand < AmqpUtils::Command
40
41
  queue.pop(:ack => true) do |header, message|
41
42
  if message
42
43
  puts "(#{@queue})" unless options[:quiet]
43
- deserialized_message = AmqpUtils::Serialization.deserialize(header.properties[:content_type], message)
44
+
45
+ if options[:raw]
46
+ deserialized_message = message
47
+ else
48
+ deserialized_message = AmqpUtils::Serialization.deserialize(header.properties[:content_type], message)
49
+ end
50
+
44
51
  @formatter.generate(STDOUT, header, deserialized_message)
45
52
  else
46
53
  puts "(#{@queue}) empty"
@@ -42,7 +42,7 @@ class AmqpUtils::Serialization
42
42
  end
43
43
 
44
44
  class Json < Base
45
- content_type 'text/json'
45
+ content_type 'text/json', 'application/json'
46
46
 
47
47
  def self.deserialize(message)
48
48
  ::JSON.parse(message)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amqp-utils
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 9
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 0
10
- version: 0.5.0
9
+ - 1
10
+ version: 0.5.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Doug Barth
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-09-27 00:00:00 -05:00
18
+ date: 2011-10-07 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency