consult 0.10.0 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +2 -1
- data/.ruby-version +1 -1
- data/CHANGELOG.md +6 -0
- data/consult.gemspec +1 -1
- data/lib/consult/cli.rb +1 -1
- data/lib/consult/template.rb +1 -1
- data/lib/consult/template_functions.rb +3 -3
- data/lib/consult/version.rb +1 -1
- data/lib/consult.rb +12 -2
- metadata +5 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ceefd393d6806ded58ba8e26053b884ccb16be5621cfed34143b1117c621da40
|
4
|
+
data.tar.gz: a5b86a629c6c01295dc89504cc7bf37b60cba8b821df29991fe1ad2ea41d9af6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 784828276c69a2f83f34a2169738f6053f4c035a3fe3b8a4b3925fed3dcb90f2a364d1e02032a1020f6e35cbbedee3eab4c833b444868d9fb9b9df2670a5df79
|
7
|
+
data.tar.gz: 1dc1fcb576c04a9a56ebd02d8af93f3e5ecf2bdf63037918cd915e7475b8bef00d901d504428dd8d8d1aba9b99c66dd020830465288d69df58ccfaa1a780f910
|
data/.circleci/config.yml
CHANGED
@@ -7,7 +7,7 @@ jobs:
|
|
7
7
|
type: string
|
8
8
|
|
9
9
|
docker:
|
10
|
-
- image:
|
10
|
+
- image: cimg/ruby:<< parameters.ruby_version >>
|
11
11
|
- image: consul:1.3.0
|
12
12
|
- image: vault:0.11.3
|
13
13
|
environment:
|
@@ -76,3 +76,4 @@ workflows:
|
|
76
76
|
ruby_version:
|
77
77
|
- '2.5'
|
78
78
|
- '2.7'
|
79
|
+
- '3.1'
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
3.1.0
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
#### Unreleased
|
2
2
|
|
3
|
+
#### 0.11.0
|
4
|
+
|
5
|
+
* Enable support for Ruby 3.1 ([#36](https://github.com/veracross/consult/pull/36))
|
6
|
+
* Bump Diplomat version & better testing for default parameters ([#37](https://github.com/veracross/consult/pull/37) & [#39](https://github.com/veracross/consult/pull/39))
|
7
|
+
* Avoid loading Railtie if SKIP_CONSULT is truthy ([#40](https://github.com/veracross/consult/pull/40))
|
8
|
+
|
3
9
|
#### 0.10.0
|
4
10
|
|
5
11
|
* Switch from Travis to CircleCI, and set up testing for multiple Ruby versions ([#25](https://github.com/veracross/consult/pull/25) & [#34](https://github.com/veracross/consult/pull/34))
|
data/consult.gemspec
CHANGED
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.executables = ['consult']
|
25
25
|
spec.require_paths = ['lib']
|
26
26
|
|
27
|
-
spec.add_dependency 'diplomat', '~> 2.
|
27
|
+
spec.add_dependency 'diplomat', '~> 2.6'
|
28
28
|
spec.add_dependency 'vault', '>= 0.10.0', '< 1.0.0'
|
29
29
|
|
30
30
|
spec.add_development_dependency 'bundler'
|
data/lib/consult/cli.rb
CHANGED
data/lib/consult/template.rb
CHANGED
@@ -75,7 +75,7 @@ module Consult
|
|
75
75
|
|
76
76
|
def consul_contents(location)
|
77
77
|
[@config[location]].compact.flatten.map do |key|
|
78
|
-
Diplomat::Kv.get(key, options:
|
78
|
+
Diplomat::Kv.get(key, options: {}, not_found: :return, found: :return).force_encoding 'utf-8'
|
79
79
|
end.join
|
80
80
|
end
|
81
81
|
|
@@ -16,12 +16,12 @@ module Consult
|
|
16
16
|
############
|
17
17
|
# Consul
|
18
18
|
############
|
19
|
-
def service(key, scope: :all, options:
|
19
|
+
def service(key, scope: :all, options: {}, meta: {})
|
20
20
|
Diplomat::Service.get(key, scope, options, meta)
|
21
21
|
end
|
22
22
|
|
23
23
|
# Execute a prepared query
|
24
|
-
def query(name_or_id, options:
|
24
|
+
def query(name_or_id, options: {})
|
25
25
|
Diplomat::Query.execute(name_or_id, options)
|
26
26
|
end
|
27
27
|
|
@@ -30,7 +30,7 @@ module Consult
|
|
30
30
|
query(*args)&.Nodes&.map { |node| node['Node'] }
|
31
31
|
end
|
32
32
|
|
33
|
-
def key(key, options:
|
33
|
+
def key(key, options: {}, not_found: :reject, found: :return)
|
34
34
|
Diplomat::Kv.get(key, options, not_found, found)
|
35
35
|
end
|
36
36
|
|
data/lib/consult/version.rb
CHANGED
data/lib/consult.rb
CHANGED
@@ -24,7 +24,15 @@ module Consult
|
|
24
24
|
root directory: config_dir
|
25
25
|
yaml = root.join('config', 'consult.yml')
|
26
26
|
|
27
|
-
@all_config = yaml.exist?
|
27
|
+
@all_config = if yaml.exist?
|
28
|
+
if Gem::Version.new(YAML::VERSION) < Gem::Version.new('4.0')
|
29
|
+
YAML.safe_load(ERB.new(yaml.read).result, [], [], true, symbolize_names: true).to_h
|
30
|
+
else
|
31
|
+
YAML.safe_load(ERB.new(yaml.read).result, aliases: true, symbolize_names: true).to_h
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
@all_config ||= {}
|
28
36
|
|
29
37
|
@config = @all_config[:shared].to_h.deep_merge @all_config[env&.to_sym].to_h
|
30
38
|
@templates = @config[:templates]&.map { |name, config| Template.new(name, config.merge(verbose: verbose)) } || []
|
@@ -92,4 +100,6 @@ module Consult
|
|
92
100
|
end
|
93
101
|
end
|
94
102
|
|
95
|
-
|
103
|
+
if defined?(Rails) && !%w[1 true].include?(ENV['SKIP_CONSULT'].to_s.downcase)
|
104
|
+
require 'consult/rails/engine'
|
105
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: consult
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Fraser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: diplomat
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.
|
19
|
+
version: '2.6'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.
|
26
|
+
version: '2.6'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: vault
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -209,8 +209,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
209
209
|
- !ruby/object:Gem::Version
|
210
210
|
version: '0'
|
211
211
|
requirements: []
|
212
|
-
|
213
|
-
rubygems_version: 2.7.6
|
212
|
+
rubygems_version: 3.1.6
|
214
213
|
signing_key:
|
215
214
|
specification_version: 4
|
216
215
|
summary: Manage consul/vault backed template files in Ruby.
|