march_hare 2.9.0-java → 2.10.0-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b56968635df7028f84b2f18fef851cd0351e43e6
4
- data.tar.gz: 3a582e08e4ea7eb61974083b24d8b901d986883e
3
+ metadata.gz: 3004427b86026af591ef7f91d3c9324e30e2b6fe
4
+ data.tar.gz: 930cafa831ca8a4befa17685de75416205e8d247
5
5
  SHA512:
6
- metadata.gz: e39d246d86194431e946266af68edbb78e9f7d3db7b28b722bfec92e4f1b0bebf898cea92c5772020a66820e5f68837e3db886067e86a5992a5236af18116c77
7
- data.tar.gz: 5be0b472967ff510a4dbec511cba883fac48fd49911e58b6d5e6e7e50ce08a41e751411507f047dcec45593f74013b07dddb57d1fc802af19ee803ad4da18b68
6
+ metadata.gz: 6afc5587b33d52f5556e04f2a97b303657118baff048fae38475e2d82774ae9211a26fb0362abc5c4f55fd0137340bc6cc43f024528fd3fda1fcb729235ca85f
7
+ data.tar.gz: f2963af78d2df0571d252eb54b08162d8d1169d42504f8c960b825ed51043314282a5933f5436e0aacdedd9dd008329f5f71b208a1241d51a19fc705825fbfe6
Binary file
@@ -80,7 +80,7 @@ module MarchHare
80
80
 
81
81
  builder.content_type(props[:content_type]).
82
82
  content_encoding(props[:content_encoding]).
83
- headers(props[:headers]).
83
+ headers(self.deep_stringify_keys(props[:headers])).
84
84
  delivery_mode(props[:persistent] ? 2 : 1).
85
85
  priority(props[:priority]).
86
86
  correlation_id(props[:correlation_id]).
@@ -94,5 +94,34 @@ module MarchHare
94
94
  cluster_id(props[:cluster_id]).
95
95
  build
96
96
  end
97
+
98
+ # Deep hash transformation fn is courtesy of Avdi Grimm
99
+ # and Markus Kuhnt, with some modifications to support primitive
100
+ # and array values.
101
+ def self.transform_hash(value, options = {}, &block)
102
+ return nil if value.nil?
103
+ return value if !value.is_a?(Hash) && !value.is_a?(Array)
104
+ return value.map { |v| transform_hash(v, options, &block) } if value.is_a?(Array)
105
+
106
+ value.inject({}) do |result, (key, value)|
107
+ value = if (options[:deep] && value.is_a?(Hash))
108
+ transform_hash(value, options, &block)
109
+ else
110
+ if value.is_a?(Array)
111
+ value.map { |v| transform_hash(v, options, &block) }
112
+ else
113
+ value
114
+ end
115
+ end
116
+ block.call(result, key, value)
117
+ result
118
+ end
119
+ end
120
+
121
+ def self.deep_stringify_keys(hash)
122
+ transform_hash(hash, :deep => true) do |hash, key, value|
123
+ hash[key.to_s] = value
124
+ end
125
+ end
97
126
  end
98
127
  end # MarchHare
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module MarchHare
4
- VERSION = "2.9.0"
4
+ VERSION = "2.10.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: march_hare
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.9.0
4
+ version: 2.10.0
5
5
  platform: java
6
6
  authors:
7
7
  - Theo Hultberg
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-04-04 00:00:00.000000000 Z
12
+ date: 2015-07-22 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: RabbitMQ client for JRuby built around the official RabbitMQ Java client
15
15
  email:
@@ -55,9 +55,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
55
55
  version: '0'
56
56
  requirements: []
57
57
  rubyforge_project: march_hare
58
- rubygems_version: 2.1.9
58
+ rubygems_version: 2.4.5
59
59
  signing_key:
60
60
  specification_version: 4
61
61
  summary: RabbitMQ client for JRuby built around the official RabbitMQ Java client
62
62
  test_files: []
63
- has_rdoc: