Skip to content

Commit 56c2f65

Browse files
authored
Merge pull request #188 from bastelfreak/rel500
Release 5.0.0
2 parents b2215f6 + 2a8d24b commit 56c2f65

File tree

3 files changed

+58
-13
lines changed

3 files changed

+58
-13
lines changed

CHANGELOG.md

Lines changed: 45 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
# Changelog
22

3+
## [5.0.0](https://github.com/voxpupuli/rspec-puppet-facts/tree/5.0.0) (2024-07-04)
4+
5+
[Full Changelog](https://github.com/voxpupuli/rspec-puppet-facts/compare/4.0.0...5.0.0)
6+
7+
**Breaking changes:**
8+
9+
- Switch to FacterDB 3 / drop legacy facts [\#187](https://github.com/voxpupuli/rspec-puppet-facts/pull/187) ([bastelfreak](https://github.com/bastelfreak))
10+
11+
**Implemented enhancements:**
12+
13+
- Deprecate symbolized facts [\#193](https://github.com/voxpupuli/rspec-puppet-facts/pull/193) ([bastelfreak](https://github.com/bastelfreak))
14+
15+
**Fixed bugs:**
16+
17+
- handle stringified facterversion properly [\#191](https://github.com/voxpupuli/rspec-puppet-facts/pull/191) ([bastelfreak](https://github.com/bastelfreak))
18+
19+
**Merged pull requests:**
20+
21+
- 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))
22+
323
## [4.0.0](https://github.com/voxpupuli/rspec-puppet-facts/tree/4.0.0) (2024-06-10)
424

525
[Full Changelog](https://github.com/voxpupuli/rspec-puppet-facts/compare/3.0.0...4.0.0)
@@ -27,28 +47,41 @@
2747

2848
**symbolized facts deprecation**
2949

30-
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:
50+
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:
3151

3252
```ruby
33-
case facts[:os]['name']
34-
when 'Archlinux'
35-
context 'on Archlinux' do
36-
it { is_expected.to contain_package('borg') }
53+
on_supported_os.each do |os, os_facts|
54+
case os_facts[:os]['name']
55+
when 'Archlinux'
56+
context 'on Archlinux' do
57+
it { is_expected.to contain_package('borg') }
58+
end
59+
when 'Ubuntu'
3760
end
38-
when 'Ubuntu'
61+
end
3962
```
4063

41-
For history reasons the first level of facts were symbols. You will have to update it to strings with the 4.0.0 release:
64+
For history reasons the first level of facts were symbols. You will have to update it to strings with the 6.0.0 release:
4265

4366
```ruby
44-
case facts['os']['name']
45-
when 'Archlinux'
46-
context 'on Archlinux' do
47-
it { is_expected.to contain_package('borg') }
67+
on_supported_os.each do |os, os_facts|
68+
case os_facts['os']['name']
69+
when 'Archlinux'
70+
context 'on Archlinux' do
71+
it { is_expected.to contain_package('borg') }
72+
end
73+
when 'Ubuntu'
4874
end
49-
when 'Ubuntu'
75+
end
5076
```
5177

78+
As an alternative you can configure the old behaviour:
79+
80+
```ruby
81+
RSpec.configure do |c|
82+
c.facterdb_string_keys = false
83+
end
84+
```
5285

5386
**Breaking changes:**
5487

Rakefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,18 @@ else
6060
gem_version = Gem::Specification.load("#{config.project}.gemspec").version
6161
config.future_release = gem_version
6262
end
63+
64+
# Workaround for https://github.com/github-changelog-generator/github-changelog-generator/issues/715
65+
require 'rbconfig'
66+
if RbConfig::CONFIG['host_os'].include?('linux')
67+
task :changelog do
68+
puts 'Fixing line endings...'
69+
changelog_file = File.join(__dir__, 'CHANGELOG.md')
70+
changelog_txt = File.read(changelog_file)
71+
new_contents = changelog_txt.gsub("\r\n", "\n")
72+
File.open(changelog_file, 'w') { |file| file.puts new_contents }
73+
end
74+
end
6375
end
6476

6577
begin

lib/rspec-puppet-facts/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ module RspecPuppetFacts
22
# This module contains the current version constant
33
module Version
44
# The current version of this gem
5-
STRING = '4.0.0'
5+
STRING = '5.0.0'
66
end
77
end

0 commit comments

Comments
 (0)