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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c1484b11f450e8df4d3220d2ea3112682afd20848f43f9bc84f3be07629edd2f
4
- data.tar.gz: b676fcde876ba6ecb17404436aa3a8c6730a68ec1d07bab51bbfa0e21473bfb8
3
+ metadata.gz: 2e0764ce5272f8bc0489d08464baed5d2a04739aa26e10a74fffad4ac0715527
4
+ data.tar.gz: 81eb41a5f94c964fbdb72a0b04d004e1277a0557ec30d60a178831792cafac7c
5
5
  SHA512:
6
- metadata.gz: c5b5db54f6e827ccfeb79a5906f731d68865a506d176dbb6b7a2c45a3f1096f2a4699c5ee4fd3885ab98d8d14b93752f137b32f4159895cafdbfe7157972f865
7
- data.tar.gz: 8b7a2db51a0a83d9f01149d4251713d8097477688a4b84eb323c84857aa7a2c1449d365292aa2d73be46f756457547de5ce9ff2fbe703550500b707ec02eeaa6
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)
@@ -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]&.map { |k, v| req.headers[k.to_sym] = v }
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]&.map { |k, v| req.headers[k.to_sym] = v }
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]&.map { |k, v| req.headers[k.to_sym] = v }
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]&.map { |k, v| req.headers[k.to_sym] = v }
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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Diplomat
4
- VERSION = '2.3.0'
4
+ VERSION = '2.3.1'
5
5
  end
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.0
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-18 00:00:00.000000000 Z
12
+ date: 2020-02-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler