confidante 0.26.0.pre.2 → 0.28.0.pre.5

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: 1e846c5b0fe17267012e83dca816d1bf2c7a8f28621e3dae9fc8a909aab4e6cd
4
- data.tar.gz: f3c3fbdac614b8448b85b387218c5fbe7b6e76c4d12b18626b2636f4745d5f11
3
+ metadata.gz: 2700829e849cba4d576180027e6a080aff3069aa78ef22ea609158ac6688dcb7
4
+ data.tar.gz: dede3a77f5a0899ce267d9728b36239e112903f172248651b5ccb8f74b089be0
5
5
  SHA512:
6
- metadata.gz: 0d700f7c32fc4439921f949cd27dbe38970ed13012988d0df34b01919df8d354dbf1dcf6a7d6364e7c34b13aeb30bb16433a796273727d1f9289fd3513b97134
7
- data.tar.gz: b0dfcc244ffd973ba85936b04f9826348fb7a84e84783c2120ce8d0babe84a47df724a9cac4cc031be75981b54ce79f6a2b42a542e5cb5c291ca02ff1c474253
6
+ metadata.gz: 44e03771edf8c4662f5b8a5b14e4ea33c8b01187906eee0ceb88ff4beeefb1a1e6c96cea169bd1bc2b41f16aa87cddf00fd9932246ff1da6859bb96d5635b2b3
7
+ data.tar.gz: 95129eafa304e53ae636dee419cd63a67f0c8e4656e570ace750d2c67d27a3f3eb8c408a14ac4457266e40faf10750ac83ebc3b50762ec40ed50845c938a6757
data/CODE_OF_CONDUCT.md CHANGED
@@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
55
55
  ## Enforcement
56
56
 
57
57
  Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at tobyclemson@gmail.com. All
58
+ reported by contacting the project team at maintainers@infrablocks.io. All
59
59
  complaints will be reviewed and investigated and will result in a response that
60
60
  is deemed necessary and appropriate to the circumstances. The project team is
61
61
  obligated to maintain confidentiality with regard to the reporter of an incident.
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  # Specify dependencies in lino.gemspec
data/Gemfile.lock CHANGED
@@ -1,15 +1,15 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- confidante (0.26.0.pre.2)
4
+ confidante (0.28.0.pre.5)
5
5
  activesupport (>= 4)
6
- hiera (~> 3.3, >= 3.3.1)
7
- shikashi (~> 0.6)
6
+ hiera (>= 3.3, < 4)
7
+ shikashi (>= 0.6, < 1)
8
8
 
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- activesupport (6.1.0)
12
+ activesupport (6.1.3.2)
13
13
  concurrent-ruby (~> 1.0, >= 1.0.2)
14
14
  i18n (>= 1.6, < 2)
15
15
  minitest (>= 5.1)
@@ -17,59 +17,75 @@ GEM
17
17
  zeitwerk (~> 2.3)
18
18
  addressable (2.7.0)
19
19
  public_suffix (>= 2.0.2, < 5.0)
20
+ ast (2.4.2)
20
21
  colored2 (3.1.2)
21
- concurrent-ruby (1.1.7)
22
+ concurrent-ruby (1.1.8)
22
23
  diff-lcs (1.4.4)
24
+ docile (1.4.0)
23
25
  evalhook (0.6.0)
24
26
  partialruby (~> 0.3)
25
27
  sexp_processor (~> 4.0)
26
- excon (0.78.1)
27
- faraday (1.3.0)
28
+ excon (0.82.0)
29
+ faraday (1.4.2)
30
+ faraday-em_http (~> 1.0)
31
+ faraday-em_synchrony (~> 1.0)
32
+ faraday-excon (~> 1.1)
28
33
  faraday-net_http (~> 1.0)
34
+ faraday-net_http_persistent (~> 1.1)
29
35
  multipart-post (>= 1.2, < 3)
30
- ruby2_keywords
31
- faraday-net_http (1.0.0)
32
- gem-release (2.2.0)
36
+ ruby2_keywords (>= 0.0.4)
37
+ faraday-em_http (1.0.0)
38
+ faraday-em_synchrony (1.0.0)
39
+ faraday-excon (1.1.0)
40
+ faraday-net_http (1.0.1)
41
+ faraday-net_http_persistent (1.1.0)
42
+ gem-release (2.2.1)
33
43
  getsource (0.2.2)
34
44
  hamster (3.0.0)
35
45
  concurrent-ruby (~> 1.0)
36
- hiera (3.6.0)
37
- i18n (1.8.6)
46
+ hiera (3.7.0)
47
+ i18n (1.8.10)
38
48
  concurrent-ruby (~> 1.0)
39
- lino (1.5.0)
49
+ lino (3.0.0)
40
50
  hamster (~> 3.0)
41
51
  open4 (~> 1.3)
42
- minitest (5.14.2)
52
+ minitest (5.14.4)
43
53
  multipart-post (2.1.1)
44
- octokit (4.20.0)
54
+ octokit (4.21.0)
45
55
  faraday (>= 0.9)
46
56
  sawyer (~> 0.8.0, >= 0.5.3)
47
57
  open4 (1.3.4)
58
+ parallel (1.20.1)
59
+ parser (3.0.1.1)
60
+ ast (~> 2.4.1)
48
61
  partialruby (0.3.0)
49
62
  ruby2ruby (~> 2)
50
63
  ruby_parser (~> 3)
51
64
  public_suffix (4.0.6)
65
+ rainbow (3.0.0)
52
66
  rake (13.0.3)
53
67
  rake_circle_ci (0.9.0)
54
68
  colored2 (~> 3.1)
55
69
  excon (~> 0.72)
56
70
  rake_factory (~> 0.23)
57
71
  sshkey (~> 2.0)
58
- rake_factory (0.27.0)
72
+ rake_factory (0.29.0)
59
73
  activesupport (>= 4)
60
74
  rake (~> 13.0)
61
- rake_github (0.5.0)
75
+ rake_github (0.7.0)
62
76
  colored2 (~> 3.1)
63
77
  octokit (~> 4.16)
64
78
  rake_factory (~> 0.23)
65
79
  sshkey (~> 2.0)
66
- rake_gpg (0.12.0)
80
+ rake_gpg (0.16.0)
67
81
  rake_factory (>= 0.23, < 1)
68
82
  ruby_gpg2 (>= 0.6, < 1)
69
- rake_ssh (0.4.0)
83
+ rake_ssh (0.6.0)
70
84
  colored2 (~> 3.1)
71
85
  rake_factory (~> 0.23)
72
86
  sshkey (~> 2.0)
87
+ regexp_parser (2.1.1)
88
+ rexml (3.2.5)
73
89
  rspec (3.10.0)
74
90
  rspec-core (~> 3.10.0)
75
91
  rspec-expectations (~> 3.10.0)
@@ -79,43 +95,71 @@ GEM
79
95
  rspec-expectations (3.10.1)
80
96
  diff-lcs (>= 1.2.0, < 2.0)
81
97
  rspec-support (~> 3.10.0)
82
- rspec-mocks (3.10.1)
98
+ rspec-mocks (3.10.2)
83
99
  diff-lcs (>= 1.2.0, < 2.0)
84
100
  rspec-support (~> 3.10.0)
85
- rspec-support (3.10.1)
86
- ruby2_keywords (0.0.2)
101
+ rspec-support (3.10.2)
102
+ rubocop (1.15.0)
103
+ parallel (~> 1.10)
104
+ parser (>= 3.0.0.0)
105
+ rainbow (>= 2.2.2, < 4.0)
106
+ regexp_parser (>= 1.8, < 3.0)
107
+ rexml
108
+ rubocop-ast (>= 1.5.0, < 2.0)
109
+ ruby-progressbar (~> 1.7)
110
+ unicode-display_width (>= 1.4.0, < 3.0)
111
+ rubocop-ast (1.7.0)
112
+ parser (>= 3.0.1.1)
113
+ rubocop-rake (0.5.1)
114
+ rubocop
115
+ rubocop-rspec (2.3.0)
116
+ rubocop (~> 1.0)
117
+ rubocop-ast (>= 1.1.0)
118
+ ruby-progressbar (1.11.0)
119
+ ruby2_keywords (0.0.4)
87
120
  ruby2ruby (2.4.4)
88
121
  ruby_parser (~> 3.1)
89
122
  sexp_processor (~> 4.6)
90
- ruby_gpg2 (0.6.0)
123
+ ruby_gpg2 (0.8.0)
91
124
  lino (>= 1.5)
92
- ruby_parser (3.15.0)
93
- sexp_processor (~> 4.9)
125
+ ruby_parser (3.16.0)
126
+ sexp_processor (~> 4.15, >= 4.15.1)
94
127
  sawyer (0.8.2)
95
128
  addressable (>= 2.3.5)
96
129
  faraday (> 0.8, < 2.0)
97
- sexp_processor (4.15.1)
130
+ sexp_processor (4.15.3)
98
131
  shikashi (0.6.0)
99
132
  evalhook (>= 0.6.0)
100
133
  getsource (>= 0.1.0)
134
+ simplecov (0.21.2)
135
+ docile (~> 1.1)
136
+ simplecov-html (~> 0.11)
137
+ simplecov_json_formatter (~> 0.1)
138
+ simplecov-html (0.12.3)
139
+ simplecov_json_formatter (0.1.3)
101
140
  sshkey (2.0.0)
102
141
  tzinfo (2.0.4)
103
142
  concurrent-ruby (~> 1.0)
143
+ unicode-display_width (2.0.0)
104
144
  zeitwerk (2.4.2)
105
145
 
106
146
  PLATFORMS
107
147
  ruby
108
148
 
109
149
  DEPENDENCIES
110
- bundler (~> 2.0)
150
+ bundler
111
151
  confidante!
112
- gem-release (~> 2.0)
113
- rake (~> 13.0)
114
- rake_circle_ci (~> 0.9)
115
- rake_github (~> 0.5)
116
- rake_gpg (~> 0.12)
117
- rake_ssh (~> 0.4)
118
- rspec (~> 3.9)
152
+ gem-release
153
+ rake
154
+ rake_circle_ci
155
+ rake_github
156
+ rake_gpg
157
+ rake_ssh
158
+ rspec
159
+ rubocop
160
+ rubocop-rake
161
+ rubocop-rspec
162
+ simplecov
119
163
 
120
164
  BUNDLED WITH
121
- 2.2.4
165
+ 2.2.18
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'yaml'
2
4
  require 'rake_circle_ci'
3
5
  require 'rake_github'
@@ -5,13 +7,16 @@ require 'rake_ssh'
5
7
  require 'rake_gpg'
6
8
  require 'securerandom'
7
9
  require 'rspec/core/rake_task'
10
+ require 'rubocop/rake_task'
8
11
 
9
- task :default => :spec
10
-
11
- RSpec::Core::RakeTask.new(:spec)
12
+ task default: %i[
13
+ library:fix
14
+ test:unit
15
+ ]
12
16
 
13
17
  namespace :encryption do
14
18
  namespace :passphrase do
19
+ desc 'Generate encryption passphrase for CI GPG key'
15
20
  task :generate do
16
21
  File.open('config/secrets/ci/encryption.passphrase', 'w') do |f|
17
22
  f.write(SecureRandom.base64(36))
@@ -23,83 +28,102 @@ end
23
28
  namespace :keys do
24
29
  namespace :deploy do
25
30
  RakeSSH.define_key_tasks(
26
- path: 'config/secrets/ci/',
27
- comment: 'maintainers@infrablocks.io')
31
+ path: 'config/secrets/ci/',
32
+ comment: 'maintainers@infrablocks.io'
33
+ )
28
34
  end
29
35
 
30
36
  namespace :gpg do
31
37
  RakeGPG.define_generate_key_task(
32
- output_directory: 'config/secrets/ci',
33
- name_prefix: 'gpg',
34
- owner_name: 'InfraBlocks Maintainers',
35
- owner_email: 'maintainers@infrablocks.io',
36
- owner_comment: 'confidante CI Key')
38
+ output_directory: 'config/secrets/ci',
39
+ name_prefix: 'gpg',
40
+ owner_name: 'InfraBlocks Maintainers',
41
+ owner_email: 'maintainers@infrablocks.io',
42
+ owner_comment: 'confidante CI Key'
43
+ )
37
44
  end
38
45
  end
39
46
 
47
+ RuboCop::RakeTask.new
48
+
49
+ namespace :library do
50
+ desc 'Run all checks of the library'
51
+ task check: [:rubocop]
52
+
53
+ desc 'Attempt to automatically fix issues with the library'
54
+ task fix: [:'rubocop:auto_correct']
55
+ end
56
+
57
+ namespace :test do
58
+ RSpec::Core::RakeTask.new(:unit)
59
+ end
60
+
40
61
  RakeCircleCI.define_project_tasks(
41
- namespace: :circle_ci,
42
- project_slug: 'github/infrablocks/confidante'
62
+ namespace: :circle_ci,
63
+ project_slug: 'github/infrablocks/confidante'
43
64
  ) do |t|
44
65
  circle_ci_config =
45
- YAML.load_file('config/secrets/circle_ci/config.yaml')
66
+ YAML.load_file('config/secrets/circle_ci/config.yaml')
46
67
 
47
- t.api_token = circle_ci_config["circle_ci_api_token"]
68
+ t.api_token = circle_ci_config['circle_ci_api_token']
48
69
  t.environment_variables = {
49
- ENCRYPTION_PASSPHRASE:
50
- File.read('config/secrets/ci/encryption.passphrase')
51
- .chomp
70
+ ENCRYPTION_PASSPHRASE:
71
+ File.read('config/secrets/ci/encryption.passphrase')
72
+ .chomp
52
73
  }
53
74
  t.checkout_keys = []
54
75
  t.ssh_keys = [
55
- {
56
- hostname: "github.com",
57
- private_key: File.read('config/secrets/ci/ssh.private')
58
- }
76
+ {
77
+ hostname: 'github.com',
78
+ private_key: File.read('config/secrets/ci/ssh.private')
79
+ }
59
80
  ]
60
81
  end
61
82
 
62
83
  RakeGithub.define_repository_tasks(
63
- namespace: :github,
64
- repository: 'infrablocks/confidante',
84
+ namespace: :github,
85
+ repository: 'infrablocks/confidante'
65
86
  ) do |t|
66
87
  github_config =
67
- YAML.load_file('config/secrets/github/config.yaml')
88
+ YAML.load_file('config/secrets/github/config.yaml')
68
89
 
69
- t.access_token = github_config["github_personal_access_token"]
90
+ t.access_token = github_config['github_personal_access_token']
70
91
  t.deploy_keys = [
71
- {
72
- title: 'CircleCI',
73
- public_key: File.read('config/secrets/ci/ssh.public')
74
- }
92
+ {
93
+ title: 'CircleCI',
94
+ public_key: File.read('config/secrets/ci/ssh.public')
95
+ }
75
96
  ]
76
97
  end
77
98
 
78
99
  namespace :pipeline do
79
- task :prepare => [
80
- :'circle_ci:project:follow',
81
- :'circle_ci:env_vars:ensure',
82
- :'circle_ci:checkout_keys:ensure',
83
- :'circle_ci:ssh_keys:ensure',
84
- :'github:deploy_keys:ensure'
100
+ desc 'Prepare CircleCI Pipeline'
101
+ task prepare: %i[
102
+ circle_ci:project:follow
103
+ circle_ci:env_vars:ensure
104
+ circle_ci:checkout_keys:ensure
105
+ circle_ci:ssh_keys:ensure
106
+ github:deploy_keys:ensure
85
107
  ]
86
108
  end
87
109
 
88
110
  namespace :version do
89
- desc "Bump version for specified type (pre, major, minor, patch)"
111
+ desc 'Bump version for specified type (pre, major, minor, patch)'
90
112
  task :bump, [:type] do |_, args|
91
113
  bump_version_for(args.type)
92
114
  end
93
115
  end
94
116
 
95
- desc "Release gem"
117
+ desc 'Release gem'
96
118
  task :release do
97
- sh "gem release --tag --push"
119
+ sh 'gem release --tag --push'
98
120
  end
99
121
 
100
122
  def bump_version_for(version_type)
101
- sh "gem bump --version #{version_type} " +
102
- "&& bundle install " +
103
- "&& export LAST_MESSAGE=\"$(git log -1 --pretty=%B)\" " +
104
- "&& git commit -a --amend -m \"${LAST_MESSAGE} [ci skip]\""
123
+ sh 'gem bump ' \
124
+ '--skip-ci ' \
125
+ "--version #{version_type} " \
126
+ '&& bundle install ' \
127
+ '&& export LAST_MESSAGE="$(git log -1 --pretty=%B)" ' \
128
+ '&& git commit -a --amend -m "${LAST_MESSAGE}"'
105
129
  end
data/bin/console CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  require 'bundler/setup'
4
5
  require 'confidante'
data/confidante.gemspec CHANGED
@@ -1,25 +1,36 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path('lib', __dir__)
3
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
5
  require 'confidante/version'
5
6
  require 'date'
6
7
 
8
+ files = %w[
9
+ bin
10
+ lib
11
+ CODE_OF_CONDUCT.md
12
+ confidante.gemspec
13
+ Gemfile
14
+ LICENSE.txt
15
+ Rakefile
16
+ README.md
17
+ ]
18
+
7
19
  Gem::Specification.new do |spec|
8
20
  spec.name = 'confidante'
9
21
  spec.version = Confidante::VERSION
10
- spec.authors = ['Toby Clemson']
11
- spec.email = ['tobyclemson@gmail.com']
22
+ spec.authors = ['InfraBlocks Maintainers']
23
+ spec.email = ['maintainers@infrablocks.io']
12
24
 
13
- spec.date = Date.today.to_s
14
25
  spec.summary = 'A configuration engine over hiera.'
15
26
  spec.description =
16
- 'A configuration engine combining environment variables, programmatic ' +
17
- 'overrides and the power of hiera.'
27
+ 'A configuration engine combining environment variables, programmatic ' \
28
+ 'overrides and the power of hiera.'
18
29
  spec.homepage = 'https://github.com/infrablocks/confidante'
19
30
  spec.license = 'MIT'
20
31
 
21
32
  spec.files = `git ls-files -z`.split("\x0").select do |f|
22
- f.match(%r{^(bin|lib|CODE_OF_CONDUCT\.md|confidante\.gemspec|Gemfile|LICENSE\.txt|Rakefile|README\.md)})
33
+ f.match(/^(#{files.map { |g| Regexp.escape(g) }.join('|')})/)
23
34
  end
24
35
  spec.bindir = 'exe'
25
36
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
@@ -27,16 +38,20 @@ Gem::Specification.new do |spec|
27
38
 
28
39
  spec.required_ruby_version = '>= 2.6.0'
29
40
 
30
- spec.add_dependency 'hiera', '~> 3.3', '>= 3.3.1'
31
41
  spec.add_dependency 'activesupport', '>= 4'
32
- spec.add_dependency 'shikashi', '~> 0.6'
33
-
34
- spec.add_development_dependency 'bundler', '~> 2.0'
35
- spec.add_development_dependency 'rake', '~> 13.0'
36
- spec.add_development_dependency 'rake_circle_ci', '~> 0.9'
37
- spec.add_development_dependency 'rake_github', '~> 0.5'
38
- spec.add_development_dependency 'rake_ssh', '~> 0.4'
39
- spec.add_development_dependency 'rake_gpg', '~> 0.12'
40
- spec.add_development_dependency 'rspec', '~> 3.9'
41
- spec.add_development_dependency 'gem-release', '~> 2.0'
42
+ spec.add_dependency 'hiera', '>= 3.3', '< 4'
43
+ spec.add_dependency 'shikashi', '>= 0.6', '< 1'
44
+
45
+ spec.add_development_dependency 'bundler'
46
+ spec.add_development_dependency 'gem-release'
47
+ spec.add_development_dependency 'rake'
48
+ spec.add_development_dependency 'rake_circle_ci'
49
+ spec.add_development_dependency 'rake_github'
50
+ spec.add_development_dependency 'rake_gpg'
51
+ spec.add_development_dependency 'rake_ssh'
52
+ spec.add_development_dependency 'rspec'
53
+ spec.add_development_dependency 'rubocop'
54
+ spec.add_development_dependency 'rubocop-rake'
55
+ spec.add_development_dependency 'rubocop-rspec'
56
+ spec.add_development_dependency 'simplecov'
42
57
  end
data/lib/confidante.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'confidante/version'
2
4
  require_relative 'confidante/converters'
3
5
  require_relative 'confidante/configuration'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'hiera'
2
4
  require 'active_support'
3
5
  require 'active_support/core_ext/hash/keys'
@@ -7,50 +9,62 @@ require_relative 'converters'
7
9
  module Confidante
8
10
  class Configuration
9
11
  def initialize(opts = {})
10
- options = {
11
- overrides: {},
12
- scope: {},
13
- }.merge(opts.to_options)
14
-
15
- unless options[:hiera]
16
- options[:hiera] = Hiera.new(config: 'config/hiera.yaml')
17
- end
18
-
19
- unless options[:converters]
20
- options[:converters] =
21
- [Confidante::Converters::EvaluatingConverter.new]
22
- end
12
+ options = opts.to_options
23
13
 
24
- @overrides = options[:overrides]
25
- @scope = options[:scope]
26
- @hiera = options[:hiera]
27
- @converters = options[:converters]
14
+ @overrides = default_overrides(options[:overrides])
15
+ @scope = default_scope(options[:scope])
16
+ @hiera = default_hiera(options[:hiera])
17
+ @converters = default_converters(options[:converters])
28
18
  end
29
19
 
30
20
  def for_overrides(overrides)
31
21
  Configuration.new(
32
- overrides: overrides,
33
- scope: @scope,
34
- hiera: @hiera,
35
- converters: @converters)
22
+ overrides: overrides,
23
+ scope: @scope,
24
+ hiera: @hiera,
25
+ converters: @converters
26
+ )
36
27
  end
37
28
 
38
29
  def for_scope(scope)
39
30
  Configuration.new(
40
- overrides: @overrides,
41
- scope: scope,
42
- hiera: @hiera,
43
- converters: @converters)
31
+ overrides: @overrides,
32
+ scope: scope,
33
+ hiera: @hiera,
34
+ converters: @converters
35
+ )
44
36
  end
45
37
 
46
- def method_missing(method, *args, &block)
38
+ def method_missing(method, *_args)
47
39
  scope =
48
- {'cwd' => Dir.pwd}
49
- .merge(@scope.stringify_keys)
50
- .merge({'overrides' => @overrides.to_h.stringify_keys})
40
+ { 'cwd' => Dir.pwd }
41
+ .merge(@scope.stringify_keys)
42
+ .merge({ 'overrides' => @overrides.to_h.stringify_keys })
51
43
  @converters.inject(@hiera.lookup(method.to_s, nil, scope)) do |v, c|
52
44
  c.convert(v)
53
45
  end
54
46
  end
47
+
48
+ def respond_to_missing?(_method_name, _include_private = false)
49
+ true
50
+ end
51
+
52
+ private
53
+
54
+ def default_overrides(overrides)
55
+ overrides || {}
56
+ end
57
+
58
+ def default_scope(scope)
59
+ scope || {}
60
+ end
61
+
62
+ def default_hiera(hiera)
63
+ hiera || Hiera.new(config: 'config/hiera.yaml')
64
+ end
65
+
66
+ def default_converters(converters)
67
+ converters || [Confidante::Converters::EvaluatingConverter.new]
68
+ end
55
69
  end
56
- end
70
+ end
@@ -1,6 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'converters/evaluating_converter'
2
4
 
3
5
  module Confidante
4
6
  module Converters
5
7
  end
6
- end
8
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'shikashi'
2
4
 
3
5
  module Confidante
@@ -35,7 +37,7 @@ module Confidante
35
37
  if thing =~ /^[\[,{]/
36
38
  begin
37
39
  @sandbox.run(@privileges, thing)
38
- rescue Exception
40
+ rescue StandardError
39
41
  thing
40
42
  end
41
43
  else
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Confidante
2
- VERSION = '0.26.0.pre.2'
4
+ VERSION = '0.28.0.pre.5'
3
5
  end
@@ -1,20 +1,26 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'hiera'
2
4
 
3
5
  class Hiera
4
6
  module Backend
7
+ # rubocop:disable Naming/ClassAndModuleCamelCase
5
8
  class Env_backend
6
9
  def initialize
7
10
  Hiera.debug('Hiera environment backend starting')
8
11
  end
9
12
 
10
- def lookup(key, scope, order_override, resolution_type, context)
13
+ def lookup(key, scope, _order_override, resolution_type, _context)
11
14
  Hiera.debug(
12
- "Looking up #{key} in environment backend with #{resolution_type}")
15
+ "Looking up #{key} in environment backend with #{resolution_type}"
16
+ )
13
17
 
14
18
  Backend.parse_answer(
15
- ENV[key.to_s.upcase] || throw(:no_such_key),
16
- scope)
19
+ ENV[key.to_s.upcase] || throw(:no_such_key),
20
+ scope
21
+ )
17
22
  end
18
23
  end
24
+ # rubocop:enable Naming/ClassAndModuleCamelCase
19
25
  end
20
- end
26
+ end
@@ -1,15 +1,19 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'hiera'
2
4
 
3
5
  class Hiera
4
6
  module Backend
7
+ # rubocop:disable Naming/ClassAndModuleCamelCase
5
8
  class Overrides_backend
6
9
  def initialize
7
10
  Hiera.debug('Hiera overrides backend starting')
8
11
  end
9
12
 
10
- def lookup(key, scope, order_override, resolution_type, context)
13
+ def lookup(key, scope, _order_override, resolution_type, _context)
11
14
  Hiera.debug(
12
- "Looking up #{key} in overrides backend with #{resolution_type}")
15
+ "Looking up #{key} in overrides backend with #{resolution_type}"
16
+ )
13
17
 
14
18
  overrides = scope && scope['overrides']
15
19
  Hiera.debug("Found overrides: #{overrides}")
@@ -22,5 +26,6 @@ class Hiera
22
26
  Backend.parse_answer(override || throw(:no_such_key), scope)
23
27
  end
24
28
  end
29
+ # rubocop:enable Naming/ClassAndModuleCamelCase
25
30
  end
26
- end
31
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'shikashi'
2
4
 
3
5
  module ShikashiExtensions
metadata CHANGED
@@ -1,40 +1,37 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: confidante
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.26.0.pre.2
4
+ version: 0.28.0.pre.5
5
5
  platform: ruby
6
6
  authors:
7
- - Toby Clemson
7
+ - InfraBlocks Maintainers
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-01-02 00:00:00.000000000 Z
11
+ date: 2021-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: hiera
14
+ name: activesupport
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '3.3'
20
17
  - - ">="
21
18
  - !ruby/object:Gem::Version
22
- version: 3.3.1
19
+ version: '4'
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
- - - "~>"
28
- - !ruby/object:Gem::Version
29
- version: '3.3'
30
24
  - - ">="
31
25
  - !ruby/object:Gem::Version
32
- version: 3.3.1
26
+ version: '4'
33
27
  - !ruby/object:Gem::Dependency
34
- name: activesupport
28
+ name: hiera
35
29
  requirement: !ruby/object:Gem::Requirement
36
30
  requirements:
37
31
  - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '3.3'
34
+ - - "<"
38
35
  - !ruby/object:Gem::Version
39
36
  version: '4'
40
37
  type: :runtime
@@ -42,138 +39,203 @@ dependencies:
42
39
  version_requirements: !ruby/object:Gem::Requirement
43
40
  requirements:
44
41
  - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: '3.3'
44
+ - - "<"
45
45
  - !ruby/object:Gem::Version
46
46
  version: '4'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: shikashi
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - "~>"
51
+ - - ">="
52
52
  - !ruby/object:Gem::Version
53
53
  version: '0.6'
54
+ - - "<"
55
+ - !ruby/object:Gem::Version
56
+ version: '1'
54
57
  type: :runtime
55
58
  prerelease: false
56
59
  version_requirements: !ruby/object:Gem::Requirement
57
60
  requirements:
58
- - - "~>"
61
+ - - ">="
59
62
  - !ruby/object:Gem::Version
60
63
  version: '0.6'
64
+ - - "<"
65
+ - !ruby/object:Gem::Version
66
+ version: '1'
61
67
  - !ruby/object:Gem::Dependency
62
68
  name: bundler
63
69
  requirement: !ruby/object:Gem::Requirement
64
70
  requirements:
65
- - - "~>"
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: '0'
74
+ type: :development
75
+ prerelease: false
76
+ version_requirements: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: '0'
81
+ - !ruby/object:Gem::Dependency
82
+ name: gem-release
83
+ requirement: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - ">="
66
86
  - !ruby/object:Gem::Version
67
- version: '2.0'
87
+ version: '0'
68
88
  type: :development
69
89
  prerelease: false
70
90
  version_requirements: !ruby/object:Gem::Requirement
71
91
  requirements:
72
- - - "~>"
92
+ - - ">="
73
93
  - !ruby/object:Gem::Version
74
- version: '2.0'
94
+ version: '0'
75
95
  - !ruby/object:Gem::Dependency
76
96
  name: rake
77
97
  requirement: !ruby/object:Gem::Requirement
78
98
  requirements:
79
- - - "~>"
99
+ - - ">="
80
100
  - !ruby/object:Gem::Version
81
- version: '13.0'
101
+ version: '0'
82
102
  type: :development
83
103
  prerelease: false
84
104
  version_requirements: !ruby/object:Gem::Requirement
85
105
  requirements:
86
- - - "~>"
106
+ - - ">="
87
107
  - !ruby/object:Gem::Version
88
- version: '13.0'
108
+ version: '0'
89
109
  - !ruby/object:Gem::Dependency
90
110
  name: rake_circle_ci
91
111
  requirement: !ruby/object:Gem::Requirement
92
112
  requirements:
93
- - - "~>"
113
+ - - ">="
94
114
  - !ruby/object:Gem::Version
95
- version: '0.9'
115
+ version: '0'
96
116
  type: :development
97
117
  prerelease: false
98
118
  version_requirements: !ruby/object:Gem::Requirement
99
119
  requirements:
100
- - - "~>"
120
+ - - ">="
101
121
  - !ruby/object:Gem::Version
102
- version: '0.9'
122
+ version: '0'
103
123
  - !ruby/object:Gem::Dependency
104
124
  name: rake_github
105
125
  requirement: !ruby/object:Gem::Requirement
106
126
  requirements:
107
- - - "~>"
127
+ - - ">="
108
128
  - !ruby/object:Gem::Version
109
- version: '0.5'
129
+ version: '0'
110
130
  type: :development
111
131
  prerelease: false
112
132
  version_requirements: !ruby/object:Gem::Requirement
113
133
  requirements:
114
- - - "~>"
134
+ - - ">="
115
135
  - !ruby/object:Gem::Version
116
- version: '0.5'
136
+ version: '0'
117
137
  - !ruby/object:Gem::Dependency
118
- name: rake_ssh
138
+ name: rake_gpg
119
139
  requirement: !ruby/object:Gem::Requirement
120
140
  requirements:
121
- - - "~>"
141
+ - - ">="
122
142
  - !ruby/object:Gem::Version
123
- version: '0.4'
143
+ version: '0'
124
144
  type: :development
125
145
  prerelease: false
126
146
  version_requirements: !ruby/object:Gem::Requirement
127
147
  requirements:
128
- - - "~>"
148
+ - - ">="
129
149
  - !ruby/object:Gem::Version
130
- version: '0.4'
150
+ version: '0'
131
151
  - !ruby/object:Gem::Dependency
132
- name: rake_gpg
152
+ name: rake_ssh
133
153
  requirement: !ruby/object:Gem::Requirement
134
154
  requirements:
135
- - - "~>"
155
+ - - ">="
136
156
  - !ruby/object:Gem::Version
137
- version: '0.12'
157
+ version: '0'
138
158
  type: :development
139
159
  prerelease: false
140
160
  version_requirements: !ruby/object:Gem::Requirement
141
161
  requirements:
142
- - - "~>"
162
+ - - ">="
143
163
  - !ruby/object:Gem::Version
144
- version: '0.12'
164
+ version: '0'
145
165
  - !ruby/object:Gem::Dependency
146
166
  name: rspec
147
167
  requirement: !ruby/object:Gem::Requirement
148
168
  requirements:
149
- - - "~>"
169
+ - - ">="
150
170
  - !ruby/object:Gem::Version
151
- version: '3.9'
171
+ version: '0'
152
172
  type: :development
153
173
  prerelease: false
154
174
  version_requirements: !ruby/object:Gem::Requirement
155
175
  requirements:
156
- - - "~>"
176
+ - - ">="
157
177
  - !ruby/object:Gem::Version
158
- version: '3.9'
178
+ version: '0'
159
179
  - !ruby/object:Gem::Dependency
160
- name: gem-release
180
+ name: rubocop
181
+ requirement: !ruby/object:Gem::Requirement
182
+ requirements:
183
+ - - ">="
184
+ - !ruby/object:Gem::Version
185
+ version: '0'
186
+ type: :development
187
+ prerelease: false
188
+ version_requirements: !ruby/object:Gem::Requirement
189
+ requirements:
190
+ - - ">="
191
+ - !ruby/object:Gem::Version
192
+ version: '0'
193
+ - !ruby/object:Gem::Dependency
194
+ name: rubocop-rake
195
+ requirement: !ruby/object:Gem::Requirement
196
+ requirements:
197
+ - - ">="
198
+ - !ruby/object:Gem::Version
199
+ version: '0'
200
+ type: :development
201
+ prerelease: false
202
+ version_requirements: !ruby/object:Gem::Requirement
203
+ requirements:
204
+ - - ">="
205
+ - !ruby/object:Gem::Version
206
+ version: '0'
207
+ - !ruby/object:Gem::Dependency
208
+ name: rubocop-rspec
161
209
  requirement: !ruby/object:Gem::Requirement
162
210
  requirements:
163
- - - "~>"
211
+ - - ">="
164
212
  - !ruby/object:Gem::Version
165
- version: '2.0'
213
+ version: '0'
166
214
  type: :development
167
215
  prerelease: false
168
216
  version_requirements: !ruby/object:Gem::Requirement
169
217
  requirements:
170
- - - "~>"
218
+ - - ">="
219
+ - !ruby/object:Gem::Version
220
+ version: '0'
221
+ - !ruby/object:Gem::Dependency
222
+ name: simplecov
223
+ requirement: !ruby/object:Gem::Requirement
224
+ requirements:
225
+ - - ">="
226
+ - !ruby/object:Gem::Version
227
+ version: '0'
228
+ type: :development
229
+ prerelease: false
230
+ version_requirements: !ruby/object:Gem::Requirement
231
+ requirements:
232
+ - - ">="
171
233
  - !ruby/object:Gem::Version
172
- version: '2.0'
234
+ version: '0'
173
235
  description: A configuration engine combining environment variables, programmatic
174
236
  overrides and the power of hiera.
175
237
  email:
176
- - tobyclemson@gmail.com
238
+ - maintainers@infrablocks.io
177
239
  executables: []
178
240
  extensions: []
179
241
  extra_rdoc_files: []