From bb8c5206b0906cfa5e25c6e5a51ca59ac5944449 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Fri, 28 Jun 2024 17:32:00 +0200 Subject: [PATCH 1/2] Rakefile: changelog task: ensure correct line endings --- Rakefile | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Rakefile b/Rakefile index 7b03791..1e73d6c 100644 --- a/Rakefile +++ b/Rakefile @@ -60,6 +60,18 @@ else gem_version = Gem::Specification.load("#{config.project}.gemspec").version config.future_release = gem_version end + + # Workaround for https://github.com/github-changelog-generator/github-changelog-generator/issues/715 + require 'rbconfig' + if RbConfig::CONFIG['host_os'].include?('linux') + task :changelog do + puts 'Fixing line endings...' + changelog_file = File.join(__dir__, 'CHANGELOG.md') + changelog_txt = File.read(changelog_file) + new_contents = changelog_txt.gsub("\r\n", "\n") + File.open(changelog_file, 'w') { |file| file.puts new_contents } + end + end end begin From 2a8d24b322975c139349c3bda793fcb71f95f1e1 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Fri, 21 Jun 2024 10:05:48 +0200 Subject: [PATCH 2/2] Release 5.0.0 --- CHANGELOG.md | 57 ++++++++++++++++++++++++------- lib/rspec-puppet-facts/version.rb | 2 +- 2 files changed, 46 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f4d95ba..0911abb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,25 @@ # Changelog +## [5.0.0](https://github.com/voxpupuli/rspec-puppet-facts/tree/5.0.0) (2024-07-04) + +[Full Changelog](https://github.com/voxpupuli/rspec-puppet-facts/compare/4.0.0...5.0.0) + +**Breaking changes:** + +- Switch to FacterDB 3 / drop legacy facts [\#187](https://github.com/voxpupuli/rspec-puppet-facts/pull/187) ([bastelfreak](https://github.com/bastelfreak)) + +**Implemented enhancements:** + +- Deprecate symbolized facts [\#193](https://github.com/voxpupuli/rspec-puppet-facts/pull/193) ([bastelfreak](https://github.com/bastelfreak)) + +**Fixed bugs:** + +- handle stringified facterversion properly [\#191](https://github.com/voxpupuli/rspec-puppet-facts/pull/191) ([bastelfreak](https://github.com/bastelfreak)) + +**Merged pull requests:** + +- Update voxpupuli-rubocop requirement from ~\> 2.7.0 to ~\> 2.8.0 [\#192](https://github.com/voxpupuli/rspec-puppet-facts/pull/192) ([dependabot[bot]](https://github.com/apps/dependabot)) + ## [4.0.0](https://github.com/voxpupuli/rspec-puppet-facts/tree/4.0.0) (2024-06-10) [Full Changelog](https://github.com/voxpupuli/rspec-puppet-facts/compare/3.0.0...4.0.0) @@ -27,28 +47,41 @@ **symbolized facts deprecation** -With the release of rspec-puppet-facts 4.0.0 we will remove support for symbolized facts. At the moment people typically use this in their unit files: +With the release of rspec-puppet-facts 6.0.0 we will remove support for symbolized facts. At the moment people typically use this in their unit files: ```ruby -case facts[:os]['name'] -when 'Archlinux' - context 'on Archlinux' do - it { is_expected.to contain_package('borg') } +on_supported_os.each do |os, os_facts| + case os_facts[:os]['name'] + when 'Archlinux' + context 'on Archlinux' do + it { is_expected.to contain_package('borg') } + end + when 'Ubuntu' end -when 'Ubuntu' +end ``` -For history reasons the first level of facts were symbols. You will have to update it to strings with the 4.0.0 release: +For history reasons the first level of facts were symbols. You will have to update it to strings with the 6.0.0 release: ```ruby -case facts['os']['name'] -when 'Archlinux' - context 'on Archlinux' do - it { is_expected.to contain_package('borg') } +on_supported_os.each do |os, os_facts| + case os_facts['os']['name'] + when 'Archlinux' + context 'on Archlinux' do + it { is_expected.to contain_package('borg') } + end + when 'Ubuntu' end -when 'Ubuntu' +end ``` +As an alternative you can configure the old behaviour: + +```ruby +RSpec.configure do |c| + c.facterdb_string_keys = false +end +``` **Breaking changes:** diff --git a/lib/rspec-puppet-facts/version.rb b/lib/rspec-puppet-facts/version.rb index 44edd2d..7e91568 100644 --- a/lib/rspec-puppet-facts/version.rb +++ b/lib/rspec-puppet-facts/version.rb @@ -2,6 +2,6 @@ module RspecPuppetFacts # This module contains the current version constant module Version # The current version of this gem - STRING = '4.0.0' + STRING = '5.0.0' end end