hiera-eyaml 3.2.2 → 3.3.0

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: 5bfbd5d31fef9569be60fa1914e921a042203d41c83925cb908173d74963df05
4
- data.tar.gz: f93f91ef3fa2c34cef964e7e5b5a3b64dde0e1cc2ddb4ad06a0ea94b251bbf4e
3
+ metadata.gz: 1ba41ba9c345e4f06ad535c7b80c6ea77c6ac146e8c983ce19b447b75fbbec32
4
+ data.tar.gz: 93ebbe3b9a22e5a3fda21e304faf1f837fc6f592288eb6a3745d862d592a8b74
5
5
  SHA512:
6
- metadata.gz: e060aeb86e2f48506413629c9664441c4d1b0fa9862be7c7136e414df7e015a477a399b0453893b2b68d92751b6a2893cf5bbb898fdd6aea0d18b91611678761
7
- data.tar.gz: de656da85d672bdc7b950c21663140cba2eb5c980abdeed0e7f44961f881ac5193c5e394c5e202b5a32dc78086b0e40bda73ada9b6615add4a7640c717934ee9
6
+ metadata.gz: 16b457ef156c42950e5610e503ffe45a8553b383f845d983ebf71fe3104312b742dfd325d61a59ad6e09895c485313611699f1063139567432886a693f964cb0
7
+ data.tar.gz: 66c315ed82b9516a246712d0659874188d6a58837068013f2bc40a31907624bf29c5044c883a519a216ebf8cdc5ce2347c94f960d93f50cca28b0fed79456be9
@@ -1,24 +1,30 @@
1
1
  name: Release
2
2
 
3
3
  on:
4
- create:
5
- ref_type: tag
4
+ push:
5
+ tags:
6
+ - '*'
6
7
 
7
8
  jobs:
8
9
  release:
9
10
  runs-on: ubuntu-latest
10
- if: github.repository == 'voxpupuli/hiera-eyaml'
11
- env:
12
- BUNDLE_WITHOUT: release
11
+ if: github.repository_owner == 'voxpupuli'
13
12
  steps:
14
13
  - uses: actions/checkout@v2
15
- - name: Install Ruby 2.7
14
+ - name: Install Ruby 3.1
16
15
  uses: ruby/setup-ruby@v1
17
16
  with:
18
- ruby-version: '2.7'
17
+ ruby-version: '3.1'
19
18
  - name: Build gem
20
19
  run: gem build *.gemspec
21
- - name: Publish gem
20
+ - name: Publish gem to rubygems.org
22
21
  run: gem push *.gem
23
22
  env:
24
23
  GEM_HOST_API_KEY: '${{ secrets.RUBYGEMS_AUTH_TOKEN }}'
24
+ - name: Setup GitHub packages access
25
+ run: |
26
+ mkdir -p ~/.gem
27
+ echo ":github: Bearer ${{ secrets.GITHUB_TOKEN }}" >> ~/.gem/credentials
28
+ chmod 0600 ~/.gem/credentials
29
+ - name: Publish gem to GitHub packages
30
+ run: gem push --key github --host https://rubygems.pkg.github.com/voxpupuli *.gem
@@ -4,6 +4,9 @@ on:
4
4
  - pull_request
5
5
  - push
6
6
 
7
+ env:
8
+ BUNDLE_WITHOUT: release
9
+
7
10
  jobs:
8
11
  test:
9
12
  runs-on: ubuntu-latest
@@ -14,11 +17,35 @@ jobs:
14
17
  - "2.5"
15
18
  - "2.6"
16
19
  - "2.7"
20
+ - "3.0"
21
+ - "3.1"
22
+ puppet:
23
+ - "~> 7.0"
24
+ - "~> 6.0"
25
+ - "https://github.com/puppetlabs/puppet.git#main"
26
+ exclude:
27
+ - ruby: "2.6"
28
+ puppet: "~> 7.0"
29
+ - ruby: "2.5"
30
+ puppet: "~> 7.0"
31
+
32
+ - ruby: "3.1"
33
+ puppet: "~> 6.0"
34
+ - ruby: "3.0"
35
+ puppet: "~> 6.0"
36
+
37
+ - ruby: "2.6"
38
+ puppet: "https://github.com/puppetlabs/puppet.git#main"
39
+ - ruby: "2.5"
40
+ puppet: "https://github.com/puppetlabs/puppet.git#main"
17
41
  env:
18
- BUNDLE_WITHOUT: release
19
- PUPPET_VERSION: "~> 6.0"
20
- name: Ruby ${{ matrix.ruby }}
42
+ PUPPET_VERSION: ${{ matrix.puppet }}
43
+ COVERAGE: ${{ matrix.coverage }}
44
+ name: "Ruby ${{ matrix.ruby }} - Puppet ${{ matrix.puppet }}"
21
45
  steps:
46
+ - name: Enable coverage reporting on Ruby 3.1
47
+ if: matrix.puppet == '~> 7.0' && matrix.ruby == '3.1'
48
+ run: echo 'COVERAGE=yes' >> $GITHUB_ENV
22
49
  - uses: actions/checkout@v2
23
50
  - name: Install expect
24
51
  run: sudo apt-get install expect
@@ -27,5 +54,9 @@ jobs:
27
54
  with:
28
55
  ruby-version: ${{ matrix.ruby }}
29
56
  bundler-cache: true
57
+ - name: spec tests
58
+ run: bundle exec rake features
59
+ - name: Verify gem builds
60
+ run: gem build *.gemspec
30
61
  - name: Run tests
31
62
  run: bundle exec cucumber -f progress
data/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [v3.3.0](https://github.com/voxpupuli/hiera-eyaml/tree/v3.3.0) (2022-05-20)
6
+
7
+ [Full Changelog](https://github.com/voxpupuli/hiera-eyaml/compare/v3.2.2...v3.3.0)
8
+
9
+ **Implemented enhancements:**
10
+
11
+ - Build gem during CI [\#330](https://github.com/voxpupuli/hiera-eyaml/pull/330) ([bastelfreak](https://github.com/bastelfreak))
12
+ - Add more Ruby/Puppet versions to CI matrix [\#326](https://github.com/voxpupuli/hiera-eyaml/pull/326) ([bastelfreak](https://github.com/bastelfreak))
13
+
14
+ **Fixed bugs:**
15
+
16
+ - Repair ruby 3.1.x compability with backwards compability. Bumped vers… [\#329](https://github.com/voxpupuli/hiera-eyaml/pull/329) ([mmachner](https://github.com/mmachner))
17
+ - Fix an "undefined method" error with rubygems \>= 3.3.0 [\#327](https://github.com/voxpupuli/hiera-eyaml/pull/327) ([davidsansome](https://github.com/davidsansome))
18
+
5
19
  ## [v3.2.2](https://github.com/voxpupuli/hiera-eyaml/tree/v3.2.2) (2021-05-03)
6
20
 
7
21
  [Full Changelog](https://github.com/voxpupuli/hiera-eyaml/compare/v3.2.1...v3.2.2)
data/Gemfile CHANGED
@@ -1,5 +1,19 @@
1
1
  source 'https://rubygems.org/'
2
2
 
3
+ # Find a location or specific version for a gem. place_or_version can be a
4
+ # version, which is most often used. It can also be git, which is specified as
5
+ # `git://somewhere.git#branch`. You can also use a file source location, which
6
+ # is specified as `file://some/location/on/disk`.
7
+ def location_for(place_or_version, fake_version = nil)
8
+ if place_or_version =~ /^(https[:@][^#]*)#(.*)/
9
+ [fake_version, { :git => $1, :branch => $2, :require => false }].compact
10
+ elsif place_or_version =~ /^file:\/\/(.*)/
11
+ ['>= 0', { :path => File.expand_path($1), :require => false }]
12
+ else
13
+ [place_or_version, { :require => false }]
14
+ end
15
+ end
16
+
3
17
  gemspec
4
18
 
5
19
  group :development do
@@ -7,7 +21,7 @@ group :development do
7
21
  gem "cucumber", '~> 1.1'
8
22
  gem "rspec-expectations", '~> 3.1.0'
9
23
  gem "hiera-eyaml-plaintext"
10
- gem "puppet", ENV['PUPPET_VERSION'] || '>= 7'
24
+ gem 'puppet', *location_for(ENV['PUPPET_VERSION']) if ENV['PUPPET_VERSION']
11
25
  gem 'github_changelog_generator'
12
26
  gem "activesupport"
13
27
  end
@@ -15,3 +29,8 @@ end
15
29
  group :test do
16
30
  gem "rake"
17
31
  end
32
+
33
+ group :coverage, optional: ENV['COVERAGE'] != 'yes' do
34
+ gem 'simplecov-console', :require => false
35
+ gem 'codecov', :require => false
36
+ end
data/README.md CHANGED
@@ -1,9 +1,12 @@
1
- Hiera eyaml
2
- ===========
1
+ # Hiera eyaml
3
2
 
4
- [![Build Status](https://travis-ci.org/voxpupuli/hiera-eyaml.png?branch=master)](https://travis-ci.org/voxpupuli/hiera-eyaml)
5
- [![Gem Version](https://img.shields.io/gem/v/hiera-eyaml.svg)](https://rubygems.org/gems/hiera-eyaml)
6
- [![Gem Downloads](https://img.shields.io/gem/dt/hiera-eyaml.svg)](https://rubygems.org/gems/hiera-eyaml)
3
+
4
+ [![License](https://img.shields.io/github/license/voxpupuli/hiera-eyaml.svg)](https://github.com/voxpupuli/hiera-eyaml/blob/master/LICENSE)
5
+ [![Test](https://github.com/voxpupuli/hiera-eyaml/actions/workflows/test.yml/badge.svg)](https://github.com/voxpupuli/hiera-eyaml/actions/workflows/test.yml)
6
+ [![codecov](https://codecov.io/gh/voxpupuli/hiera-eyaml/branch/master/graph/badge.svg)](https://codecov.io/gh/voxpupuli/hiera-eyaml)
7
+ [![Release](https://github.com/voxpupuli/hiera-eyaml/actions/workflows/release.yml/badge.svg)](https://github.com/voxpupuli/hiera-eyaml/actions/workflows/release.yml)
8
+ [![RubyGem Version](https://img.shields.io/gem/v/hiera-eyaml.svg)](https://rubygems.org/gems/hiera-eyaml)
9
+ [![RubyGem Downloads](https://img.shields.io/gem/dt/hiera-eyaml.svg)](https://rubygems.org/gems/hiera-eyaml)
7
10
 
8
11
  hiera-eyaml is a backend for Hiera that provides per-value encryption of sensitive data within yaml files
9
12
  to be used by Puppet.
data/Rakefile CHANGED
@@ -1,5 +1,35 @@
1
+ begin
2
+ require 'simplecov'
3
+ require 'simplecov-console'
4
+ require 'codecov'
5
+ rescue LoadError
6
+ else
7
+ SimpleCov.start do
8
+ track_files 'lib/**/*.rb'
9
+
10
+ add_filter '/spec'
11
+
12
+ enable_coverage :branch
13
+
14
+ # do not track vendored files
15
+ add_filter '/vendor'
16
+ add_filter '/.vendor'
17
+ end
18
+
19
+ SimpleCov.formatters = [
20
+ SimpleCov::Formatter::Console,
21
+ SimpleCov::Formatter::Codecov,
22
+ ]
23
+ end
1
24
  require "bundler/gem_tasks"
2
25
 
26
+ # https://cucumber.io/docs/tools/ruby/
27
+ # https://stackoverflow.com/questions/6473419/using-simplecov-to-display-cucumber-code-coverage
28
+ require 'cucumber/rake/task'
29
+ Cucumber::Rake::Task.new(:features) do |t|
30
+ t.cucumber_opts = "--format progress" # Any valid command line option can go here.
31
+ end
32
+
3
33
  begin
4
34
  require 'github_changelog_generator/task'
5
35
  GitHubChangelogGenerator::RakeTask.new :changelog do |config|
data/hiera-eyaml.gemspec CHANGED
@@ -8,7 +8,8 @@ Gem::Specification.new do |gem|
8
8
  gem.version = Hiera::Backend::Eyaml::VERSION
9
9
  gem.description = "Hiera backend for decrypting encrypted yaml properties"
10
10
  gem.summary = "OpenSSL Encryption backend for Hiera"
11
- gem.author = "Tom Poulton"
11
+ gem.author = "Vox Pupuli"
12
+ gem.email = "voxpupuli@groups.io"
12
13
  gem.license = "MIT"
13
14
 
14
15
  gem.homepage = "https://github.com/voxpupuli/hiera-eyaml/"
@@ -19,4 +20,6 @@ Gem::Specification.new do |gem|
19
20
 
20
21
  gem.add_dependency('optimist')
21
22
  gem.add_dependency('highline')
23
+
24
+ gem.required_ruby_version = '>= 2.5.0', ' < 4'
22
25
  end
@@ -25,20 +25,22 @@ class Hiera
25
25
 
26
26
  def self.find
27
27
 
28
+ gem_version = Gem::Version.new(Gem::VERSION)
28
29
  this_version = Gem::Version.create(Hiera::Backend::Eyaml::VERSION)
29
- index = Gem::VERSION >= "1.8.0" ? Gem::Specification : Gem.source_index
30
+ index = gem_version >= Gem::Version.new("1.8.0") ? Gem::Specification : Gem.source_index
30
31
 
31
32
  [index].flatten.each do |source|
32
- specs = Gem::VERSION >= "1.6.0" ? source.latest_specs(true) : source.latest_specs
33
+ specs = gem_version >= Gem::Version.new("1.6.0") ? source.latest_specs(true) : source.latest_specs
33
34
 
34
35
  specs.each do |spec|
36
+ spec = spec.to_spec if spec.respond_to?(:to_spec)
35
37
  next if @@plugins.include? spec
36
38
 
37
39
  dependency = spec.dependencies.find { |d| d.name == "hiera-eyaml" }
38
40
  next if dependency && !dependency.requirement.satisfied_by?( this_version )
39
41
 
40
42
  file = nil
41
- if Gem::VERSION >= "1.8.0"
43
+ if gem_version >= Gem::Version.new("1.8.0")
42
44
  file = spec.matches_for_glob("**/eyaml_init.rb").first
43
45
  else
44
46
  file = Gem.searcher.matching_files(spec, "**/eyaml_init.rb").first
@@ -2,7 +2,7 @@ class Hiera
2
2
  module Backend
3
3
  module Eyaml
4
4
 
5
- VERSION = "3.2.2"
5
+ VERSION = "3.3.0"
6
6
  DESCRIPTION = "Hiera-eyaml is a backend for Hiera which provides OpenSSL encryption/decryption for Hiera properties"
7
7
 
8
8
  class RecoverableError < StandardError
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hiera-eyaml
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.2
4
+ version: 3.3.0
5
5
  platform: ruby
6
6
  authors:
7
- - Tom Poulton
7
+ - Vox Pupuli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-03 00:00:00.000000000 Z
11
+ date: 2022-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: optimist
@@ -39,7 +39,7 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  description: Hiera backend for decrypting encrypted yaml properties
42
- email:
42
+ email: voxpupuli@groups.io
43
43
  executables:
44
44
  - eyaml
45
45
  extensions: []
@@ -99,14 +99,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - ">="
101
101
  - !ruby/object:Gem::Version
102
- version: '0'
102
+ version: 2.5.0
103
+ - - "<"
104
+ - !ruby/object:Gem::Version
105
+ version: '4'
103
106
  required_rubygems_version: !ruby/object:Gem::Requirement
104
107
  requirements:
105
108
  - - ">="
106
109
  - !ruby/object:Gem::Version
107
110
  version: '0'
108
111
  requirements: []
109
- rubygems_version: 3.1.6
112
+ rubygems_version: 3.3.7
110
113
  signing_key:
111
114
  specification_version: 4
112
115
  summary: OpenSSL Encryption backend for Hiera