diplomat 2.3.0 → 2.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -0
- data/lib/diplomat/rest_client.rb +4 -4
- data/lib/diplomat/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e0764ce5272f8bc0489d08464baed5d2a04739aa26e10a74fffad4ac0715527
|
4
|
+
data.tar.gz: 81eb41a5f94c964fbdb72a0b04d004e1277a0557ec30d60a178831792cafac7c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 62e99375359cf2c4c2a0323d4b2821c3546ed2bdd72957325847108afaafcdf6b503699bbf7ec9cb380644d34e5de963310a49e5d7028e2a71a850eac85d13a2
|
7
|
+
data.tar.gz: 29f693149be1d59799bd5ba7a59e0de702bb624b94799310e2ec15458daf9be548b084b8969cd7b0e846efc6f1eaed08c56614eaf7515743e7dee90253d43f9d
|
data/README.md
CHANGED
@@ -45,6 +45,12 @@ Check out [Travis](https://travis-ci.org/WeAreFarmGeek/diplomat) to see which ve
|
|
45
45
|
|
46
46
|
We've dropped ruby 1.9 support. You can still depend on Diplomat by directly using the `ruby-1.9-compatible` branch on github, although be advised it's not actively maintained anymore.
|
47
47
|
|
48
|
+
### ERB templating
|
49
|
+
|
50
|
+
It is possible to inject diplomat data into `.erb` files (such as in chef), but you could also have a look at
|
51
|
+
[consul-templaterb](https://github.com/criteo/consul-templaterb/) that is highly optimized for ERB templating
|
52
|
+
with very hi parallelism and good optimized performance for large clusters.
|
53
|
+
|
48
54
|
## Usage
|
49
55
|
|
50
56
|
[The most up to date place to read about the API is here.](http://rubydoc.info/github/WeAreFarmGeek/diplomat)
|
data/lib/diplomat/rest_client.rb
CHANGED
@@ -240,7 +240,7 @@ module Diplomat
|
|
240
240
|
connection.get do |req|
|
241
241
|
req.options[:params_encoder] = options[:params_encoder] if options[:params_encoder]
|
242
242
|
req.url rest_options[:url_prefix] ? rest_options[:url_prefix] + concat_url(url) : concat_url(url)
|
243
|
-
rest_options[:headers]
|
243
|
+
rest_options[:headers].map { |k, v| req.headers[k.to_sym] = v } unless rest_options[:headers].nil?
|
244
244
|
req.options.timeout = options[:timeout] if options[:timeout]
|
245
245
|
end
|
246
246
|
rescue Faraday::ClientError, Faraday::ServerError => e
|
@@ -258,7 +258,7 @@ module Diplomat
|
|
258
258
|
url += custom_params unless custom_params.nil?
|
259
259
|
connection.put do |req|
|
260
260
|
req.url rest_options[:url_prefix] ? rest_options[:url_prefix] + concat_url(url) : concat_url(url)
|
261
|
-
rest_options[:headers]
|
261
|
+
rest_options[:headers].map { |k, v| req.headers[k.to_sym] = v } unless rest_options[:headers].nil?
|
262
262
|
unless data.nil?
|
263
263
|
(req.headers || {})['Content-Type'] = mime
|
264
264
|
req.body = if mime == 'application/json' && !data.is_a?(String)
|
@@ -276,7 +276,7 @@ module Diplomat
|
|
276
276
|
url += custom_params unless custom_params.nil?
|
277
277
|
connection.post do |req|
|
278
278
|
req.url rest_options[:url_prefix] ? rest_options[:url_prefix] + concat_url(url) : concat_url(url)
|
279
|
-
rest_options[:headers]
|
279
|
+
rest_options[:headers].map { |k, v| req.headers[k.to_sym] = v } unless rest_options[:headers].nil?
|
280
280
|
req.body = JSON.dump(data) unless data.nil?
|
281
281
|
end
|
282
282
|
end
|
@@ -287,7 +287,7 @@ module Diplomat
|
|
287
287
|
url += custom_params unless custom_params.nil?
|
288
288
|
connection.delete do |req|
|
289
289
|
req.url rest_options[:url_prefix] ? rest_options[:url_prefix] + concat_url(url) : concat_url(url)
|
290
|
-
rest_options[:headers]
|
290
|
+
rest_options[:headers].map { |k, v| req.headers[k.to_sym] = v } unless rest_options[:headers].nil?
|
291
291
|
end
|
292
292
|
end
|
293
293
|
|
data/lib/diplomat/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: diplomat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Hamelink
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-02-
|
12
|
+
date: 2020-02-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|