beetle 0.3.10 → 0.3.11

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 11f94ebbdbb2e69a8f9253fd4bae0141b8c461ed
4
- data.tar.gz: 6fb4333ff041cc5451ddeee58b9f1dda90287b40
3
+ metadata.gz: ad7f15bcc3fc114046b8b145690fa981063556e9
4
+ data.tar.gz: 9ff40b62cb8df60c788a940c70c59a8daa200443
5
5
  SHA512:
6
- metadata.gz: 26833cddbdca71091b8b4be60ffa8880e10542999aac278fd2ac64af27760ba9024f80f2716fccea7a2a57c26db0618b0425f01c831c2c6f66536aa13ba06f9a
7
- data.tar.gz: b226d364d7aa0e135a8d5cebaf5ab5ac1ac7b7eab6d2758ddbb8032a2a3b6b37261b5ed738a680d3d252171ad8d0418590d4f9ecb940bd91d6083dccad0befe0
6
+ metadata.gz: 657f1cd730ec4e339f77cd23037af84f8809fdd2166b4ab5b16e879121149c976dd465c4bd84a7a40eec1c0bacb500d29e01c8921939e5b3228800f08375f461
7
+ data.tar.gz: 1c1faeda610d8fc937ff63a4e7c664be4971e329f00bd120a857e8ec732450fb194c9d9cad5885b4bc8fc04dab005bbf6d72868308c8f020cad2a154a14db9e9
@@ -34,7 +34,7 @@ module Beetle
34
34
  # AMQP options for queue bindings
35
35
  QUEUE_BINDING_KEYS = [:key, :no_wait]
36
36
  # AMQP options for message publishing
37
- PUBLISHING_KEYS = [:key, :mandatory, :immediate, :persistent, :reply_to]
37
+ PUBLISHING_KEYS = [:key, :mandatory, :immediate, :persistent, :reply_to, :headers]
38
38
  # AMQP options for subscribing to queues
39
39
  SUBSCRIPTION_KEYS = [:ack, :key]
40
40
 
@@ -92,11 +92,12 @@ module Beetle
92
92
  expires_at = now + (opts[:ttl] || DEFAULT_TTL)
93
93
  opts = opts.slice(*PUBLISHING_KEYS)
94
94
  opts[:message_id] = generate_uuid.to_s
95
- opts[:headers] = {
95
+ headers = (opts[:headers] ||= {})
96
+ headers.merge!(
96
97
  :format_version => FORMAT_VERSION.to_s,
97
98
  :flags => flags.to_s,
98
99
  :expires_at => expires_at.to_s
99
- }
100
+ )
100
101
  opts
101
102
  end
102
103
 
@@ -1,3 +1,3 @@
1
1
  module Beetle
2
- VERSION = "0.3.10"
2
+ VERSION = "0.3.11"
3
3
  end
@@ -64,9 +64,23 @@ module Beetle
64
64
 
65
65
  test "the publishing options must only include string values" do
66
66
  options = Message.publishing_options(:redundant => true, :mandatory => true, :bogus => true)
67
+
67
68
  assert options[:headers].all? {|_, param| param.is_a?(String)}
68
69
  end
69
70
 
71
+ test "the publishing options support adding custom headers" do
72
+ options = Message.publishing_options(
73
+ :redundant => true,
74
+ :headers => {
75
+ :sender_id => "SENDER_ID",
76
+ :sender_action => "SENDER_ACTION"
77
+ }
78
+ )
79
+
80
+ assert_equal "1", options[:headers][:flags]
81
+ assert_equal "SENDER_ID", options[:headers][:sender_id]
82
+ assert_equal "SENDER_ACTION", options[:headers][:sender_action]
83
+ end
70
84
  end
71
85
 
72
86
  class KeyManagementTest < MiniTest::Unit::TestCase
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beetle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.10
4
+ version: 0.3.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Kaes
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2014-12-09 00:00:00.000000000 Z
15
+ date: 2015-03-03 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: uuid4r
@@ -268,7 +268,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
268
268
  version: 1.3.7
269
269
  requirements: []
270
270
  rubyforge_project:
271
- rubygems_version: 2.4.3
271
+ rubygems_version: 2.4.4
272
272
  signing_key:
273
273
  specification_version: 3
274
274
  summary: High Availability AMQP Messaging with Redundant Queues