diplomat 2.0.0 → 2.0.1
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 +4 -4
- data/README.md +1 -1
- data/lib/diplomat/kv.rb +1 -1
- data/lib/diplomat/rest_client.rb +6 -12
- data/lib/diplomat/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4c8c4d80b3709be01d325281097f3db8506cb9c
|
4
|
+
data.tar.gz: cb5c77df09a30b802e4a69c7d55c0f634f13d27c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58067ecae844fea9ce3e2240847542820c65ff17c49b6e1cd4b7c02a8f2872089f1ddb9c075a824d2265f6c10055a1f669dfeab4612e45ca1389390046ba404f
|
7
|
+
data.tar.gz: 011a2fe3e0a428922e13b595f86f143514227c80a3cf12aa0a17f20b99b3e0bafe20af9982fd70383a697686e874852df6de86bee90e8235e8af0c4bc44106dd
|
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Diplomat
|
2
|
-
[](http://badge.fury.io/rb/diplomat) [](https://travis-ci.org/WeAreFarmGeek/diplomat) [](https://codeclimate.com/github/WeAreFarmGeek/diplomat) [](https://gemnasium.com/WeAreFarmGeek/diplomat) [](http://inch-ci.org/github/wearefarmgeek/diplomat)
|
2
|
+
[](http://badge.fury.io/rb/diplomat) [](https://rubygems.org/gems/diplomat/versions/2.0.0) [](https://travis-ci.org/WeAreFarmGeek/diplomat) [](https://codeclimate.com/github/WeAreFarmGeek/diplomat) [](https://gemnasium.com/WeAreFarmGeek/diplomat) [](http://inch-ci.org/github/wearefarmgeek/diplomat)
|
3
3
|
### A HTTP Ruby API for [Consul](http://www.consul.io/)
|
4
4
|
|
5
5
|

|
data/lib/diplomat/kv.rb
CHANGED
@@ -77,7 +77,7 @@ module Diplomat
|
|
77
77
|
@raw = parse_body
|
78
78
|
return @raw.first['ModifyIndex'] if @options && @options[:modify_index]
|
79
79
|
return decode_values if @options && @options[:decode_values]
|
80
|
-
return convert_to_hash(return_value(return_nil_values, transformation
|
80
|
+
return convert_to_hash(return_value(return_nil_values, transformation)) if @options && @options[:convert_to_hash]
|
81
81
|
return return_value(return_nil_values, transformation)
|
82
82
|
when :wait
|
83
83
|
index = raw.headers['x-consul-index']
|
data/lib/diplomat/rest_client.rb
CHANGED
@@ -148,20 +148,14 @@ module Diplomat
|
|
148
148
|
end
|
149
149
|
|
150
150
|
# Get the key/value(s) from the raw output
|
151
|
-
|
152
|
-
def return_value(nil_values = false, transformation = nil, return_hash = false)
|
151
|
+
def return_value(nil_values = false, transformation = nil)
|
153
152
|
@value = decode_values
|
154
153
|
return @value if @value.first.is_a? String
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
@value = @value.map do |el|
|
161
|
-
el['Value'] = transformation.call(el['Value']) if transformation && !el['Value'].nil?
|
162
|
-
{ key: el['Key'], value: el['Value'] } if el['Value'] || nil_values
|
163
|
-
end.compact
|
164
|
-
end
|
154
|
+
|
155
|
+
@value = @value.map do |el|
|
156
|
+
el['Value'] = transformation.call(el['Value']) if transformation && !el['Value'].nil?
|
157
|
+
{ key: el['Key'], value: el['Value'] } if el['Value'] || nil_values
|
158
|
+
end.compact
|
165
159
|
end
|
166
160
|
# rubocop:enable PerceivedComplexity, MethodLength, CyclomaticComplexity, AbcSize
|
167
161
|
|
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.0.
|
4
|
+
version: 2.0.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: 2017-
|
12
|
+
date: 2017-08-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|