rspec-puppet-facts 5.3.1 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fc8d63556bf5f6c7790b578e927c9501f685522ed66df043c3452ed1ca4a78e3
4
- data.tar.gz: dd679dc8651d0e945dbcac16d19de2f88b95e19725504ab4b7b3dfa9afa8dae7
3
+ metadata.gz: 4f3eec925e92c1024c4a10e558be21c02d0914f65fe07eea7e655f1097e23d92
4
+ data.tar.gz: aaf9c29db081dcf002654bf2d264b6aaa41306552c4ebb60040a00d6f0cdd20b
5
5
  SHA512:
6
- metadata.gz: 6df650e8a2e79e9ac0f0a6eab5a45398ed9a04788ce1ae5b25f97325cbd5f9bb6d8e05c8e7ab793e172874a7aba56320d0be10928946c1bf23700ca7e7c5ff29
7
- data.tar.gz: 1f00aaa70a64d08b5b432edc62254a35b61d96fed701f6beed2bd88d468dbb383d6b1f582d10e8acd3b7c7667402d8ce703caf99a51a712ad9206367166d71f1
6
+ metadata.gz: 56bff0fbbc8b40ea9b66c49fd9ccd590606cb70ae4a49483e7646ebb188ee2943e94d826bcd4553f8809c05dcc8db720db60b76c979dd2bb5906f0a0a8397f76
7
+ data.tar.gz: 070fca80879de208a1cf4f455926ab8479029b819064ad8f796b37ecc86893beb780dfe0f185e2336f025652bf46efda933fc169ce9f1e65552002fba893b06a
@@ -1,17 +1,17 @@
1
1
  version: 2
2
2
  updates:
3
- # raise PRs for gem updates
4
- - package-ecosystem: bundler
5
- directory: "/"
6
- schedule:
7
- interval: daily
8
- time: "13:00"
9
- open-pull-requests-limit: 10
3
+ # raise PRs for gem updates
4
+ - package-ecosystem: bundler
5
+ directory: "/"
6
+ schedule:
7
+ interval: daily
8
+ time: "13:00"
9
+ open-pull-requests-limit: 10
10
10
 
11
- # Maintain dependencies for GitHub Actions
12
- - package-ecosystem: github-actions
13
- directory: "/"
14
- schedule:
15
- interval: daily
16
- time: "13:00"
17
- open-pull-requests-limit: 10
11
+ # Maintain dependencies for GitHub Actions
12
+ - package-ecosystem: github-actions
13
+ directory: "/"
14
+ schedule:
15
+ interval: daily
16
+ time: "13:00"
17
+ open-pull-requests-limit: 10
@@ -0,0 +1,41 @@
1
+ ---
2
+ # https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes
3
+
4
+ changelog:
5
+ exclude:
6
+ labels:
7
+ - duplicate
8
+ - invalid
9
+ - modulesync
10
+ - question
11
+ - skip-changelog
12
+ - wont-fix
13
+ - wontfix
14
+ - github_actions
15
+
16
+ categories:
17
+ - title: Breaking Changes 🛠
18
+ labels:
19
+ - backwards-incompatible
20
+
21
+ - title: New Features 🎉
22
+ labels:
23
+ - enhancement
24
+
25
+ - title: Bug Fixes 🐛
26
+ labels:
27
+ - bug
28
+ - bugfix
29
+
30
+ - title: Documentation Updates 📚
31
+ labels:
32
+ - documentation
33
+ - docs
34
+
35
+ - title: Dependency Updates ⬆️
36
+ labels:
37
+ - dependencies
38
+
39
+ - title: Other Changes
40
+ labels:
41
+ - "*"
@@ -1,4 +1,5 @@
1
- name: Release
1
+ ---
2
+ name: Gem Release
2
3
 
3
4
  on:
4
5
  push:
@@ -6,27 +7,90 @@ on:
6
7
  - '*'
7
8
 
8
9
  jobs:
9
- release:
10
- runs-on: ubuntu-latest
10
+ build-release:
11
+ # Prevent releases from forked repositories
11
12
  if: github.repository_owner == 'voxpupuli'
13
+ name: Build the gem
14
+ runs-on: ubuntu-24.04
15
+ permissions:
16
+ contents: write # clone repo and create release
12
17
  steps:
13
- - uses: actions/checkout@v4
14
- - name: Install Ruby 3.3
18
+ - uses: actions/checkout@v5
19
+ - name: Install Ruby
15
20
  uses: ruby/setup-ruby@v1
16
21
  with:
17
- ruby-version: '3.3'
18
- env:
19
- BUNDLE_WITHOUT: release
22
+ ruby-version: 'ruby'
20
23
  - name: Build gem
21
- run: gem build --strict --verbose *.gemspec
24
+ shell: bash
25
+ run: gem build --verbose *.gemspec
26
+ - name: Upload gem to GitHub cache
27
+ uses: actions/upload-artifact@v4
28
+ with:
29
+ name: gem-artifact
30
+ path: '*.gem'
31
+ retention-days: 1
32
+ compression-level: 0
33
+ - name: Create Release Page
34
+ shell: bash
35
+ env:
36
+ GH_TOKEN: ${{ github.token }}
37
+ run: gh release create ${{ github.ref_name }} --generate-notes
38
+ - name: Attach gem to GitHub Release
39
+ shell: bash
40
+ env:
41
+ GH_TOKEN: ${{ github.token }}
42
+ run: gh release upload ${{ github.ref_name }} *.gem
43
+
44
+ release-to-github:
45
+ needs: build-release
46
+ name: Release to GitHub
47
+ runs-on: ubuntu-24.04
48
+ permissions:
49
+ packages: write # publish to rubygems.pkg.github.com
50
+ steps:
51
+ - name: Download gem from GitHub cache
52
+ uses: actions/download-artifact@v5
53
+ with:
54
+ name: gem-artifact
55
+ - name: Publish gem to GitHub packages
56
+ run: GEM_HOST_API_KEY=${{ secrets.GITHUB_TOKEN }} gem push --key github --host https://rubygems.pkg.github.com/${{ github.repository_owner }} *.gem
57
+
58
+ release-to-rubygems:
59
+ needs: build-release
60
+ name: Release gem to rubygems.org
61
+ runs-on: ubuntu-24.04
62
+ environment: release # recommended by rubygems.org
63
+ permissions:
64
+ id-token: write # rubygems.org authentication
65
+ steps:
66
+ - name: Download gem from GitHub cache
67
+ uses: actions/download-artifact@v5
68
+ with:
69
+ name: gem-artifact
70
+ - uses: rubygems/configure-rubygems-credentials@v1.0.0
22
71
  - name: Publish gem to rubygems.org
72
+ shell: bash
23
73
  run: gem push *.gem
24
- env:
25
- GEM_HOST_API_KEY: '${{ secrets.RUBYGEMS_AUTH_TOKEN }}'
26
- - name: Setup GitHub packages access
74
+
75
+ release-verification:
76
+ name: Check that all releases are done
77
+ runs-on: ubuntu-24.04
78
+ permissions:
79
+ contents: read # minimal permissions that we have to grant
80
+ needs:
81
+ - release-to-github
82
+ - release-to-rubygems
83
+ steps:
84
+ - name: Download gem from GitHub cache
85
+ uses: actions/download-artifact@v5
86
+ with:
87
+ name: gem-artifact
88
+ - name: Install Ruby
89
+ uses: ruby/setup-ruby@v1
90
+ with:
91
+ ruby-version: 'ruby'
92
+ - name: Wait for release to propagate
93
+ shell: bash
27
94
  run: |
28
- mkdir -p ~/.gem
29
- echo ":github: Bearer ${{ secrets.GITHUB_TOKEN }}" >> ~/.gem/credentials
30
- chmod 0600 ~/.gem/credentials
31
- - name: Publish gem to GitHub packages
32
- run: gem push --key github --host https://rubygems.pkg.github.com/voxpupuli *.gem
95
+ gem install rubygems-await
96
+ gem await *.gem
@@ -1,3 +1,4 @@
1
+ ---
1
2
  name: Test
2
3
 
3
4
  on:
@@ -9,13 +10,16 @@ on:
9
10
  env:
10
11
  BUNDLE_WITHOUT: release
11
12
 
13
+ permissions:
14
+ contents: read # minimal permissions that we have to grant
15
+
12
16
  jobs:
13
- rubocop:
14
- env:
15
- BUNDLE_WITHOUT: release
16
- runs-on: ubuntu-latest
17
+ rubocop_and_matrix:
18
+ runs-on: ubuntu-24.04
19
+ outputs:
20
+ ruby: ${{ steps.ruby.outputs.versions }}
17
21
  steps:
18
- - uses: actions/checkout@v4
22
+ - uses: actions/checkout@v5
19
23
  - name: Install Ruby ${{ matrix.ruby }}
20
24
  uses: ruby/setup-ruby@v1
21
25
  with:
@@ -23,23 +27,19 @@ jobs:
23
27
  bundler-cache: true
24
28
  - name: Run Rubocop
25
29
  run: bundle exec rake rubocop
30
+ - id: ruby
31
+ uses: voxpupuli/ruby-version@v1
26
32
 
27
33
  test:
28
- runs-on: ubuntu-latest
34
+ needs: rubocop_and_matrix
35
+ name: "Ruby ${{ matrix.ruby }}"
36
+ runs-on: ubuntu-24.04
29
37
  strategy:
30
38
  fail-fast: false
31
39
  matrix:
32
- include:
33
- - ruby: '2.7'
34
- - ruby: '3.0'
35
- - ruby: '3.1'
36
- - ruby: '3.2'
37
- - ruby: '3.3'
38
- coverage: 'yes'
39
- env:
40
- COVERAGE: ${{ matrix.coverage }}
40
+ ruby: ${{ fromJSON(needs.rubocop_and_matrix.outputs.ruby) }}
41
41
  steps:
42
- - uses: actions/checkout@v4
42
+ - uses: actions/checkout@v5
43
43
  - name: Install Ruby ${{ matrix.ruby }}
44
44
  uses: ruby/setup-ruby@v1
45
45
  with:
@@ -47,16 +47,14 @@ jobs:
47
47
  bundler-cache: true
48
48
  - name: Run unit tests
49
49
  run: bundle exec rake spec
50
- - name: Test against Puppet component versions
51
- run: bundle exec rake puppet_versions:test
52
50
  - name: Test gem build
53
51
  run: gem build --strict --verbose *.gemspec
54
52
 
55
53
  tests:
56
54
  needs:
57
- - rubocop
55
+ - rubocop_and_matrix
58
56
  - test
59
- runs-on: ubuntu-latest
57
+ runs-on: ubuntu-24.04
60
58
  name: Test suite
61
59
  steps:
62
60
  - run: echo Test suite completed
data/.rubocop.yml CHANGED
@@ -14,3 +14,6 @@ Style/IfUnlessModifier:
14
14
  Naming/FileName:
15
15
  Exclude:
16
16
  - 'lib/rspec-puppet-facts.rb'
17
+
18
+ AllCops:
19
+ TargetRubyVersion: 3.2
data/.rubocop_todo.yml CHANGED
@@ -1,17 +1,11 @@
1
1
  # This configuration was generated by
2
- # `rubocop --auto-gen-config`
3
- # on 2024-06-09 17:48:43 UTC using RuboCop version 1.63.5.
2
+ # `rubocop --auto-gen-config --no-auto-gen-timestamp`
3
+ # using RuboCop version 1.79.2.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 1
10
- # This cop supports unsafe autocorrection (--autocorrect-all).
11
- Performance/MapCompact:
12
- Exclude:
13
- - 'lib/rspec-puppet-facts.rb'
14
-
15
9
  # Offense count: 29
16
10
  # Configuration parameters: Prefixes, AllowedPatterns.
17
11
  # Prefixes: when, with, without
@@ -19,7 +13,7 @@ RSpec/ContextWording:
19
13
  Exclude:
20
14
  - 'spec/rspec_puppet_facts_spec.rb'
21
15
 
22
- # Offense count: 7
16
+ # Offense count: 6
23
17
  # Configuration parameters: CountAsOne.
24
18
  RSpec/ExampleLength:
25
19
  Max: 13
@@ -29,14 +23,6 @@ RSpec/ExpectInHook:
29
23
  Exclude:
30
24
  - 'spec/rspec_puppet_facts_spec.rb'
31
25
 
32
- # Offense count: 8
33
- # This cop supports safe autocorrection (--autocorrect).
34
- # Configuration parameters: EnforcedStyle.
35
- # SupportedStyles: single_line_only, single_statement_only, disallow, require_implicit
36
- RSpec/ImplicitSubject:
37
- Exclude:
38
- - 'spec/rspec_puppet_facts_spec.rb'
39
-
40
26
  # Offense count: 4
41
27
  RSpec/LeakyConstantDeclaration:
42
28
  Exclude:
@@ -48,11 +34,7 @@ RSpec/LeakyConstantDeclaration:
48
34
  RSpec/MessageSpies:
49
35
  EnforcedStyle: receive
50
36
 
51
- # Offense count: 4
52
- RSpec/MultipleExpectations:
53
- Max: 2
54
-
55
- # Offense count: 40
37
+ # Offense count: 48
56
38
  # Configuration parameters: EnforcedStyle, IgnoreSharedExamples.
57
39
  # SupportedStyles: always, named_only
58
40
  RSpec/NamedSubject:
@@ -69,39 +51,18 @@ RSpec/StubbedMock:
69
51
  Exclude:
70
52
  - 'spec/rspec_puppet_facts_spec.rb'
71
53
 
72
- # Offense count: 2
73
- # This cop supports safe autocorrection (--autocorrect).
74
- Rake/Desc:
75
- Exclude:
76
- - 'Rakefile'
77
-
78
- # Offense count: 6
79
- # This cop supports unsafe autocorrection (--autocorrect-all).
80
- # Configuration parameters: EnforcedStyle.
81
- # SupportedStyles: always, always_true, never
82
- Style/FrozenStringLiteralComment:
83
- Exclude:
84
- - 'Gemfile'
85
- - 'Rakefile'
86
- - 'lib/rspec-puppet-facts.rb'
87
- - 'lib/rspec-puppet-facts/version.rb'
88
- - 'spec/rspec_puppet_facts_spec.rb'
89
- - 'spec/spec_helper.rb'
90
-
91
54
  # Offense count: 1
92
55
  Style/MixinUsage:
93
56
  Exclude:
94
57
  - 'spec/spec_helper.rb'
95
58
 
96
- # Offense count: 3
59
+ # Offense count: 1
97
60
  # This cop supports unsafe autocorrection (--autocorrect-all).
98
61
  # Configuration parameters: EnforcedStyle.
99
62
  # SupportedStyles: literals, strict
100
63
  Style/MutableConstant:
101
64
  Exclude:
102
65
  - 'lib/rspec-puppet-facts.rb'
103
- - 'lib/rspec-puppet-facts/version.rb'
104
- - 'spec/rspec_puppet_facts_spec.rb'
105
66
 
106
67
  # Offense count: 1
107
68
  # This cop supports unsafe autocorrection (--autocorrect-all).
@@ -112,12 +73,6 @@ Style/RedundantArgument:
112
73
 
113
74
  # Offense count: 1
114
75
  # This cop supports unsafe autocorrection (--autocorrect-all).
115
- Style/RedundantSort:
116
- Exclude:
117
- - 'lib/rspec-puppet-facts.rb'
118
-
119
- # Offense count: 2
120
- # This cop supports unsafe autocorrection (--autocorrect-all).
121
76
  # Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength.
122
77
  # AllowedMethods: present?, blank?, presence, try, try!
123
78
  Style/SafeNavigation:
data/CHANGELOG.md CHANGED
@@ -1,6 +1,43 @@
1
1
  # Changelog
2
2
 
3
- ## [5.3.1](https://github.com/voxpupuli/rspec-puppet-facts/tree/5.3.1) (2025-04-28)
3
+ ## [6.0.0](https://github.com/voxpupuli/rspec-puppet-facts/tree/6.0.0) (2025-09-27)
4
+
5
+ [Full Changelog](https://github.com/voxpupuli/rspec-puppet-facts/compare/5.4.0...6.0.0)
6
+
7
+ **Breaking changes:**
8
+
9
+ - Require Ruby 3.2 or newer [\#224](https://github.com/voxpupuli/rspec-puppet-facts/pull/224) ([bastelfreak](https://github.com/bastelfreak))
10
+ - CI: Dont validate puppet\_agent\_facter\_versions.json anymore [\#223](https://github.com/voxpupuli/rspec-puppet-facts/pull/223) ([bastelfreak](https://github.com/bastelfreak))
11
+ - Switch from facter to openfact [\#219](https://github.com/voxpupuli/rspec-puppet-facts/pull/219) ([bastelfreak](https://github.com/bastelfreak))
12
+
13
+ **Implemented enhancements:**
14
+
15
+ - puppet\_agent\_facter\_versions: Add OpenVox/OpenFact versions [\#228](https://github.com/voxpupuli/rspec-puppet-facts/pull/228) ([bastelfreak](https://github.com/bastelfreak))
16
+ - FacterDB: Allow 4.x [\#222](https://github.com/voxpupuli/rspec-puppet-facts/pull/222) ([dependabot[bot]](https://github.com/apps/dependabot))
17
+
18
+ **Fixed bugs:**
19
+
20
+ - Fix dependabot configuration [\#226](https://github.com/voxpupuli/rspec-puppet-facts/pull/226) ([bastelfreak](https://github.com/bastelfreak))
21
+
22
+ **Merged pull requests:**
23
+
24
+ - README: Fix upstream documentation link to metadata [\#225](https://github.com/voxpupuli/rspec-puppet-facts/pull/225) ([giacomd](https://github.com/giacomd))
25
+
26
+ ## [5.4.0](https://github.com/voxpupuli/rspec-puppet-facts/tree/5.4.0) (2025-06-11)
27
+
28
+ [Full Changelog](https://github.com/voxpupuli/rspec-puppet-facts/compare/5.3.1...5.4.0)
29
+
30
+ **Implemented enhancements:**
31
+
32
+ - Support OpenVox [\#217](https://github.com/voxpupuli/rspec-puppet-facts/pull/217) ([bastelfreak](https://github.com/bastelfreak))
33
+ - Make Puppet a soft dependency [\#213](https://github.com/voxpupuli/rspec-puppet-facts/pull/213) ([ekohl](https://github.com/ekohl))
34
+ - Add Ruby 3.4 support / generate CI matrix dynamically [\#211](https://github.com/voxpupuli/rspec-puppet-facts/pull/211) ([bastelfreak](https://github.com/bastelfreak))
35
+
36
+ **Merged pull requests:**
37
+
38
+ - Drop unused coverage reporting [\#210](https://github.com/voxpupuli/rspec-puppet-facts/pull/210) ([bastelfreak](https://github.com/bastelfreak))
39
+
40
+ ## [5.3.1](https://github.com/voxpupuli/rspec-puppet-facts/tree/5.3.1) (2025-04-29)
4
41
 
5
42
  [Full Changelog](https://github.com/voxpupuli/rspec-puppet-facts/compare/5.3.0...5.3.1)
6
43
 
data/Gemfile CHANGED
@@ -1,15 +1,13 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source ENV['GEM_SOURCE'] || 'https://rubygems.org'
2
4
 
3
5
  gemspec
4
6
 
5
- gem 'facter', ENV.fetch('FACTER_GEM_VERSION', nil), require: false
6
-
7
- group :release do
7
+ group :release, optional: true do
8
8
  gem 'faraday-retry', '~> 2.1', require: false
9
9
  gem 'github_changelog_generator', '~> 1.16.4', require: false
10
10
  end
11
11
 
12
- group :coverage, optional: ENV['COVERAGE'] != 'yes' do
13
- gem 'codecov', require: false
14
- gem 'simplecov-console', require: false
15
- end
12
+ gem 'openvox'
13
+ gem 'syslog', '~> 0.3' if RUBY_VERSION >= '3.4'
data/README.md CHANGED
@@ -44,7 +44,7 @@ include RspecPuppetFacts
44
44
 
45
45
  ## Specifying the supported operating systems
46
46
 
47
- To determine which facts to run your tests against, `rspec-puppet-facts` checks your module's `metadata.json` to find out what operating systems your module supports. The `metadata.json` file is located in the root of your module. To learn more about this file, see Puppet's [metadata](https://docs.puppet.com/puppet/latest/modules_metadata.html) documentation.
47
+ To determine which facts to run your tests against, `rspec-puppet-facts` checks your module's `metadata.json` to find out what operating systems your module supports. The `metadata.json` file is located in the root of your module. To learn more about this file, see Puppet's [metadata](https://help.puppet.com/core/current/Content/PuppetCore/modules_metadata.htm) documentation.
48
48
 
49
49
  By default, `rspec-puppet-facts` provides the facts only for `x86_64` architecture. However, you can override this default and the supported operating system list by passing a hash to `on_supported_os` in your tests. This hash must contain either or both of the following keys:
50
50
 
@@ -572,9 +572,15 @@ When no facts are available for the specific facter/operating system combination
572
572
  ## Maintenance
573
573
 
574
574
  This gem uses information about puppet AIO component versions to build/test.
575
- They are stored at `ext/puppet_agent_facter_versions.json`. If they are outdated,
576
- the `puppet_versions:test` rake task will fail and they need to be updated.
577
- This is as easy as running: `bundle exec rake puppet_versions:update`
575
+ They are stored at `ext/puppet_agent_facter_versions.json`.
576
+
577
+ In the past we used `bundle exec rake puppet_versions:update` to update the file and `puppet_versions:test` to validate it.
578
+ This relied on information from the puppet forge.
579
+ With the 6.0.0 release we're switching to openvox.
580
+ The file is currently maintained by hand, because openvox doesn't offer an API yet to map agent releases to openfact releases.
581
+ It got also renamed from `ext/puppet_agent_facter_versions.json` -> `ext/openvox_agent_facter_versions.json`.
582
+
583
+ **`ext/openvox_agent_facter_versions.json`now lists a mapping of openvox releases to openfact releases**
578
584
 
579
585
  ## License
580
586
 
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  PUPPET_VERSIONS_PATH = File.join(__dir__, 'ext', 'puppet_agent_facter_versions.json')
2
4
 
3
5
  begin
@@ -17,39 +19,16 @@ task :dump_commit do
17
19
  end
18
20
 
19
21
  namespace :puppet_versions do
22
+ desc 'updates the vendored list of puppet versions & components'
20
23
  task :update do
21
- require 'net/http'
22
- require 'net/https'
23
- require 'uri'
24
- require 'json'
25
-
26
- uri = URI.parse('https://forgeapi.puppet.com/private/versions/puppet-agent')
27
- http = Net::HTTP.new(uri.host, uri.port)
28
- http.use_ssl = uri.scheme == 'https'
29
-
30
- request = Net::HTTP::Get.new(uri.request_uri)
31
- response = http.request(request)
32
- raise unless response.is_a?(Net::HTTPSuccess)
33
-
34
- data = JSON.parse(response.body).filter_map do |_, versions|
35
- if !versions['puppet'].nil? && !versions['facter'].nil?
36
- [versions['puppet'], versions['facter']]
37
- end
38
- end
39
- data.sort_by! { |puppet, _facter| Gem::Version.new(puppet) }.reverse!
40
-
41
- File.write(PUPPET_VERSIONS_PATH, "#{JSON.pretty_generate(data.to_h)}\n")
24
+ warn 'The rake task is disabled since the 6.0.0 Release. Please see the README.md'
25
+ exit 1
42
26
  end
43
27
 
28
+ desc 'runs all tests and verifies vendored component list'
44
29
  task :test do
45
- Rake::Task['puppet_versions:update'].invoke
46
-
47
- output = `git status --porcelain #{PUPPET_VERSIONS_PATH}`
48
- unless output.strip.empty?
49
- warn "#{PUPPET_VERSIONS_PATH} is out of date."
50
- warn 'Run the puppet_versions:update task to update it and commit the changes.'
51
- raise
52
- end
30
+ warn 'The rake task is disabled since the 6.0.0 Release. Please see the README.md'
31
+ exit 1
53
32
  end
54
33
  end
55
34
 
@@ -1,4 +1,17 @@
1
1
  {
2
+ "8.23.1": "5.1.0",
3
+ "8.23.0": "5.1.0",
4
+ "8.22.1": "5.0.0",
5
+ "8.19.2": "4.11.0",
6
+ "8.19.1": "4.11.0",
7
+ "8.19.0": "4.11.0",
8
+ "8.18.1": "4.11.0",
9
+ "8.17.0": "4.11.0",
10
+ "8.16.0": "4.11.0",
11
+ "8.15.0": "4.11.0",
12
+ "8.14.0": "4.11.0",
13
+ "8.13.0": "4.11.0",
14
+ "8.12.1": "4.11.0",
2
15
  "8.12.0": "4.12.0",
3
16
  "8.11.0": "4.11.0",
4
17
  "8.10.0": "4.10.0",
@@ -1,7 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module RspecPuppetFacts
2
4
  # This module contains the current version constant
3
5
  module Version
4
6
  # The current version of this gem
5
- STRING = '5.3.1'
7
+ STRING = '6.0.0'
6
8
  end
7
9
  end
@@ -1,4 +1,5 @@
1
- require 'puppet'
1
+ # frozen_string_literal: true
2
+
2
3
  require 'facter'
3
4
  require 'facterdb'
4
5
  require 'json'
@@ -252,12 +253,23 @@ module RspecPuppetFacts
252
253
  def self.common_facts
253
254
  return @common_facts if @common_facts
254
255
 
256
+ # from Facter itself
255
257
  @common_facts = {
256
- puppetversion: Puppet.version,
257
258
  rubysitedir: RbConfig::CONFIG['sitelibdir'],
258
259
  rubyversion: RUBY_VERSION,
259
260
  }
260
261
 
262
+ begin
263
+ require 'puppet'
264
+ rescue LoadError
265
+ warning 'Could not load Puppet'
266
+ else
267
+ # from Puppet.initialize_facts
268
+ @common_facts[:puppetversion] = Puppet.version.to_s
269
+ # from Puppet::Node::Facts#add_local_facts
270
+ @common_facts[:implementation] = Puppet.implementation if Puppet.respond_to?(:implementation)
271
+ end
272
+
261
273
  @common_facts[:mco_version] = MCollective::VERSION if mcollective?
262
274
 
263
275
  if augeas?
@@ -416,6 +428,13 @@ module RspecPuppetFacts
416
428
  end
417
429
 
418
430
  RSpec.configure do |c|
419
- c.add_setting :default_facter_version, default: RspecPuppetFacts.facter_version_for_puppet_version(Puppet.version)
431
+ begin
432
+ require 'puppet'
433
+ rescue LoadError
434
+ puppet_version = nil
435
+ else
436
+ puppet_version = Puppet.version
437
+ end
438
+ c.add_setting :default_facter_version, default: RspecPuppetFacts.facter_version_for_puppet_version(puppet_version)
420
439
  c.add_setting :facterdb_string_keys, default: false
421
440
  end
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
13
13
  s.description = 'Contains facts from many Facter version on many Operating Systems'
14
14
  s.licenses = 'Apache-2.0'
15
15
 
16
- s.required_ruby_version = '>= 2.7.0'
16
+ s.required_ruby_version = '>= 3.2.0'
17
17
 
18
18
  s.files = `git ls-files`.split("\n")
19
19
  s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
@@ -23,10 +23,10 @@ Gem::Specification.new do |s|
23
23
  s.add_development_dependency 'rspec', '~> 3.12'
24
24
  s.add_development_dependency 'yard', '~> 0.9.34'
25
25
 
26
- s.add_development_dependency 'voxpupuli-rubocop', '~> 3.1.0'
26
+ s.add_development_dependency 'voxpupuli-rubocop', '~> 4.2.0'
27
27
 
28
28
  s.add_dependency 'deep_merge', '~> 1.2'
29
- s.add_dependency 'facter', '< 5'
30
- s.add_dependency 'facterdb', '~> 3.1'
31
- s.add_dependency 'puppet', '>= 7', '< 9'
29
+
30
+ s.add_dependency 'facterdb', '>= 3.1', '< 5.0'
31
+ s.add_dependency 'openfact', '~> 5.0'
32
32
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
  require 'json'
3
5
  require 'stringio'
@@ -204,7 +206,7 @@ describe RspecPuppetFacts do
204
206
  end
205
207
 
206
208
  it 'returns a hash' do
207
- is_expected.to be_a Hash
209
+ expect(subject).to be_a Hash
208
210
  end
209
211
 
210
212
  it 'returns supported OS' do
@@ -276,7 +278,7 @@ describe RspecPuppetFacts do
276
278
  end
277
279
 
278
280
  it 'returns a hash' do
279
- is_expected.to be_a Hash
281
+ expect(subject).to be_a Hash
280
282
  end
281
283
 
282
284
  it 'returns supported OS' do
@@ -639,7 +641,7 @@ describe RspecPuppetFacts do
639
641
  end
640
642
 
641
643
  it 'returns facts from the specified default Facter version' do
642
- is_expected.to match(
644
+ expect(subject).to match(
643
645
  'centos-9-x86_64' => include(
644
646
  facterversion: /\A4\.6\./,
645
647
  ),
@@ -662,7 +664,7 @@ describe RspecPuppetFacts do
662
664
  end
663
665
 
664
666
  it 'returns facts from a facter version matching version and below' do
665
- is_expected.to match(
667
+ expect(subject).to match(
666
668
  'centos-9-x86_64' => include(
667
669
  facterversion: /\A4\.[0-7]\./,
668
670
  ),
@@ -691,7 +693,7 @@ describe RspecPuppetFacts do
691
693
  end
692
694
 
693
695
  it 'returns facts from a facter version matching 4.6' do
694
- is_expected.to match('centos-9-x86_64' => include(facterversion: '4.6.1'))
696
+ expect(subject).to match('centos-9-x86_64' => include(facterversion: '4.6.1'))
695
697
  end
696
698
  end
697
699
 
@@ -706,7 +708,7 @@ describe RspecPuppetFacts do
706
708
  end
707
709
 
708
710
  it 'returns facts from a facter version matching 4.6.1' do
709
- is_expected.to match('centos-9-x86_64' => include(facterversion: '4.6.1'))
711
+ expect(subject).to match('centos-9-x86_64' => include(facterversion: '4.6.1'))
710
712
  end
711
713
  end
712
714
 
@@ -747,11 +749,11 @@ describe RspecPuppetFacts do
747
749
  end
748
750
 
749
751
  it 'returns CentOS facts from a facter version matching 4.5' do
750
- is_expected.to include('centos-9-x86_64' => include(facterversion: '4.5.2'))
752
+ expect(subject).to include('centos-9-x86_64' => include(facterversion: '4.5.2'))
751
753
  end
752
754
 
753
755
  it 'returns Debian facts from a facter version matching 4.6.1' do
754
- is_expected.to include('debian-12-x86_64' => include(facterversion: '4.6.1'))
756
+ expect(subject).to include('debian-12-x86_64' => include(facterversion: '4.6.1'))
755
757
  end
756
758
  end
757
759
  end
data/spec/spec_helper.rb CHANGED
@@ -1,26 +1,4 @@
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
+ # frozen_string_literal: true
24
2
 
25
3
  require 'rspec'
26
4
  require 'rspec-puppet-facts'
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-puppet-facts
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.3.1
4
+ version: 6.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vox Pupuli
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2025-04-29 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: mime-types
@@ -78,14 +77,14 @@ dependencies:
78
77
  requirements:
79
78
  - - "~>"
80
79
  - !ruby/object:Gem::Version
81
- version: 3.1.0
80
+ version: 4.2.0
82
81
  type: :development
83
82
  prerelease: false
84
83
  version_requirements: !ruby/object:Gem::Requirement
85
84
  requirements:
86
85
  - - "~>"
87
86
  - !ruby/object:Gem::Version
88
- version: 3.1.0
87
+ version: 4.2.0
89
88
  - !ruby/object:Gem::Dependency
90
89
  name: deep_merge
91
90
  requirement: !ruby/object:Gem::Requirement
@@ -101,53 +100,39 @@ dependencies:
101
100
  - !ruby/object:Gem::Version
102
101
  version: '1.2'
103
102
  - !ruby/object:Gem::Dependency
104
- name: facter
103
+ name: facterdb
105
104
  requirement: !ruby/object:Gem::Requirement
106
105
  requirements:
106
+ - - ">="
107
+ - !ruby/object:Gem::Version
108
+ version: '3.1'
107
109
  - - "<"
108
110
  - !ruby/object:Gem::Version
109
- version: '5'
111
+ version: '5.0'
110
112
  type: :runtime
111
113
  prerelease: false
112
114
  version_requirements: !ruby/object:Gem::Requirement
113
115
  requirements:
116
+ - - ">="
117
+ - !ruby/object:Gem::Version
118
+ version: '3.1'
114
119
  - - "<"
115
120
  - !ruby/object:Gem::Version
116
- version: '5'
121
+ version: '5.0'
117
122
  - !ruby/object:Gem::Dependency
118
- name: facterdb
123
+ name: openfact
119
124
  requirement: !ruby/object:Gem::Requirement
120
125
  requirements:
121
126
  - - "~>"
122
127
  - !ruby/object:Gem::Version
123
- version: '3.1'
128
+ version: '5.0'
124
129
  type: :runtime
125
130
  prerelease: false
126
131
  version_requirements: !ruby/object:Gem::Requirement
127
132
  requirements:
128
133
  - - "~>"
129
134
  - !ruby/object:Gem::Version
130
- version: '3.1'
131
- - !ruby/object:Gem::Dependency
132
- name: puppet
133
- requirement: !ruby/object:Gem::Requirement
134
- requirements:
135
- - - ">="
136
- - !ruby/object:Gem::Version
137
- version: '7'
138
- - - "<"
139
- - !ruby/object:Gem::Version
140
- version: '9'
141
- type: :runtime
142
- prerelease: false
143
- version_requirements: !ruby/object:Gem::Requirement
144
- requirements:
145
- - - ">="
146
- - !ruby/object:Gem::Version
147
- version: '7'
148
- - - "<"
149
- - !ruby/object:Gem::Version
150
- version: '9'
135
+ version: '5.0'
151
136
  description: Contains facts from many Facter version on many Operating Systems
152
137
  email:
153
138
  - voxpupuli@groups.io
@@ -156,6 +141,7 @@ extensions: []
156
141
  extra_rdoc_files: []
157
142
  files:
158
143
  - ".github/dependabot.yml"
144
+ - ".github/release.yml"
159
145
  - ".github/workflows/release.yml"
160
146
  - ".github/workflows/test.yml"
161
147
  - ".gitignore"
@@ -180,7 +166,6 @@ homepage: http://github.com/voxpupuli/rspec-puppet-facts
180
166
  licenses:
181
167
  - Apache-2.0
182
168
  metadata: {}
183
- post_install_message:
184
169
  rdoc_options: []
185
170
  require_paths:
186
171
  - lib
@@ -188,15 +173,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
188
173
  requirements:
189
174
  - - ">="
190
175
  - !ruby/object:Gem::Version
191
- version: 2.7.0
176
+ version: 3.2.0
192
177
  required_rubygems_version: !ruby/object:Gem::Requirement
193
178
  requirements:
194
179
  - - ">="
195
180
  - !ruby/object:Gem::Version
196
181
  version: '0'
197
182
  requirements: []
198
- rubygems_version: 3.5.22
199
- signing_key:
183
+ rubygems_version: 3.6.9
200
184
  specification_version: 4
201
185
  summary: Standard facts fixtures for Puppet
202
186
  test_files: []