rspec-puppet-facts 2.0.5 → 4.0.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: f8b388a56b77311997681ce48848b6e799c7943d8c2e3d296345e9f6587bc2ca
4
- data.tar.gz: 33f5a3534d51478872c88b1e8ca74843820ff433f19e62932c9c7e58228f2234
3
+ metadata.gz: 26b5f9acb794f67889cc8d24cb1bc35b73e0c20d1e855f88ac8d65cf1ca8cbbf
4
+ data.tar.gz: 920bd51e0f0def41e2f7ea8a38aa26b7247d8e311b3cda87b08eaa592fdecda1
5
5
  SHA512:
6
- metadata.gz: 3e0487293f8f9a2b4c9b8e45db12770f9002eddefe705e0697d68f8e74982910a4deb8f1c939d56953b0cb203980910ad6011527a131ca03828c3351336f6a83
7
- data.tar.gz: 82229c84b00526195fa998d14047a84cbf7ba2782930928b8ba11fe7f646b793b76b5e3932ee33503d40cf2f1d59c97eb3a8269fe8f88e60baaaa2d926d0efcd
6
+ metadata.gz: 7290dffe6d55a28fa8fc721c03c394b2715a6fa282a8af544ab5ab7fa6428976592b8cd0e853f88bce10f70bfcd403fb49b77b0ba74ddb37823bdd5b19bdcc03
7
+ data.tar.gz: 5d23c2f0ae77ecc1a562e0e3aa079ff0c097f48c495d4c39cc17e486f4bbb3d6974a6a3f458d5b05df294c461e209df718ea342b270b9cae6a4d298a9db9e6f4
@@ -1,8 +1,17 @@
1
1
  version: 2
2
2
  updates:
3
+ # raise PRs for gem updates
3
4
  - package-ecosystem: bundler
4
5
  directory: "/"
5
6
  schedule:
6
7
  interval: daily
7
- time: "04:00"
8
+ time: "13:00"
9
+ open-pull-requests-limit: 10
10
+
11
+ # Maintain dependencies for GitHub Actions
12
+ - package-ecosystem: github-actions
13
+ directory: "/"
14
+ schedule:
15
+ interval: daily
16
+ time: "13:00"
8
17
  open-pull-requests-limit: 10
@@ -10,15 +10,15 @@ jobs:
10
10
  runs-on: ubuntu-latest
11
11
  if: github.repository_owner == 'voxpupuli'
12
12
  steps:
13
- - uses: actions/checkout@v2
14
- - name: Install Ruby 3.0
13
+ - uses: actions/checkout@v4
14
+ - name: Install Ruby 3.3
15
15
  uses: ruby/setup-ruby@v1
16
16
  with:
17
- ruby-version: '3.0'
17
+ ruby-version: '3.3'
18
18
  env:
19
19
  BUNDLE_WITHOUT: release
20
20
  - name: Build gem
21
- run: gem build *.gemspec
21
+ run: gem build --strict --verbose *.gemspec
22
22
  - name: Publish gem to rubygems.org
23
23
  run: gem push *.gem
24
24
  env:
@@ -1,30 +1,45 @@
1
1
  name: Test
2
2
 
3
3
  on:
4
- - pull_request
5
- - push
4
+ pull_request: {}
5
+ push:
6
+ branches:
7
+ - master
6
8
 
7
9
  env:
8
10
  BUNDLE_WITHOUT: release
9
11
 
10
12
  jobs:
13
+ rubocop:
14
+ env:
15
+ BUNDLE_WITHOUT: release
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ - name: Install Ruby ${{ matrix.ruby }}
20
+ uses: ruby/setup-ruby@v1
21
+ with:
22
+ ruby-version: "3.3"
23
+ bundler-cache: true
24
+ - name: Run Rubocop
25
+ run: bundle exec rake rubocop
26
+
11
27
  test:
12
28
  runs-on: ubuntu-latest
13
29
  strategy:
14
30
  fail-fast: false
15
31
  matrix:
16
32
  include:
17
- - ruby: '2.4'
18
- - ruby: '2.5'
19
- - ruby: '2.6'
20
33
  - ruby: '2.7'
21
34
  - ruby: '3.0'
22
35
  - ruby: '3.1'
36
+ - ruby: '3.2'
37
+ - ruby: '3.3'
23
38
  coverage: 'yes'
24
39
  env:
25
40
  COVERAGE: ${{ matrix.coverage }}
26
41
  steps:
27
- - uses: actions/checkout@v2
42
+ - uses: actions/checkout@v4
28
43
  - name: Install Ruby ${{ matrix.ruby }}
29
44
  uses: ruby/setup-ruby@v1
30
45
  with:
@@ -35,4 +50,13 @@ jobs:
35
50
  - name: Test against Puppet component versions
36
51
  run: bundle exec rake puppet_versions:test
37
52
  - name: Test gem build
38
- run: bundle exec rake build
53
+ run: gem build --strict --verbose *.gemspec
54
+
55
+ tests:
56
+ needs:
57
+ - rubocop
58
+ - test
59
+ runs-on: ubuntu-latest
60
+ name: Test suite
61
+ steps:
62
+ - run: echo Test suite completed
data/.rubocop.yml ADDED
@@ -0,0 +1,16 @@
1
+ ---
2
+ inherit_from: .rubocop_todo.yml
3
+
4
+ inherit_gem:
5
+ voxpupuli-rubocop: rubocop.yml
6
+
7
+ Layout/LineLength:
8
+ Enabled: false
9
+
10
+ Style/IfUnlessModifier:
11
+ Enabled: false
12
+
13
+ # To match the gem name
14
+ Naming/FileName:
15
+ Exclude:
16
+ - 'lib/rspec-puppet-facts.rb'
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,133 @@
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.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
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
+ # Offense count: 29
16
+ # Configuration parameters: Prefixes, AllowedPatterns.
17
+ # Prefixes: when, with, without
18
+ RSpec/ContextWording:
19
+ Exclude:
20
+ - 'spec/rspec_puppet_facts_spec.rb'
21
+
22
+ # Offense count: 7
23
+ # Configuration parameters: CountAsOne.
24
+ RSpec/ExampleLength:
25
+ Max: 13
26
+
27
+ # Offense count: 1
28
+ RSpec/ExpectInHook:
29
+ Exclude:
30
+ - 'spec/rspec_puppet_facts_spec.rb'
31
+
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
+ # Offense count: 4
41
+ RSpec/LeakyConstantDeclaration:
42
+ Exclude:
43
+ - 'spec/rspec_puppet_facts_spec.rb'
44
+
45
+ # Offense count: 7
46
+ # Configuration parameters: .
47
+ # SupportedStyles: have_received, receive
48
+ RSpec/MessageSpies:
49
+ EnforcedStyle: receive
50
+
51
+ # Offense count: 4
52
+ RSpec/MultipleExpectations:
53
+ Max: 2
54
+
55
+ # Offense count: 40
56
+ # Configuration parameters: EnforcedStyle, IgnoreSharedExamples.
57
+ # SupportedStyles: always, named_only
58
+ RSpec/NamedSubject:
59
+ Exclude:
60
+ - 'spec/rspec_puppet_facts_spec.rb'
61
+
62
+ # Offense count: 13
63
+ # Configuration parameters: AllowedGroups.
64
+ RSpec/NestedGroups:
65
+ Max: 6
66
+
67
+ # Offense count: 1
68
+ RSpec/StubbedMock:
69
+ Exclude:
70
+ - 'spec/rspec_puppet_facts_spec.rb'
71
+
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
+ # Offense count: 1
92
+ Style/MixinUsage:
93
+ Exclude:
94
+ - 'spec/spec_helper.rb'
95
+
96
+ # Offense count: 3
97
+ # This cop supports unsafe autocorrection (--autocorrect-all).
98
+ # Configuration parameters: EnforcedStyle.
99
+ # SupportedStyles: literals, strict
100
+ Style/MutableConstant:
101
+ Exclude:
102
+ - 'lib/rspec-puppet-facts.rb'
103
+ - 'lib/rspec-puppet-facts/version.rb'
104
+ - 'spec/rspec_puppet_facts_spec.rb'
105
+
106
+ # Offense count: 1
107
+ # This cop supports unsafe autocorrection (--autocorrect-all).
108
+ # Configuration parameters: Methods.
109
+ Style/RedundantArgument:
110
+ Exclude:
111
+ - 'lib/rspec-puppet-facts.rb'
112
+
113
+ # Offense count: 1
114
+ # 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
+ # Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength.
122
+ # AllowedMethods: present?, blank?, presence, try, try!
123
+ Style/SafeNavigation:
124
+ Exclude:
125
+ - 'lib/rspec-puppet-facts.rb'
126
+
127
+ # Offense count: 2
128
+ # This cop supports unsafe autocorrection (--autocorrect-all).
129
+ # Configuration parameters: RequireEnglish, EnforcedStyle.
130
+ # SupportedStyles: use_perl_names, use_english_names, use_builtin_english_names
131
+ Style/SpecialGlobalVars:
132
+ Exclude:
133
+ - 'lib/rspec-puppet-facts.rb'
data/CHANGELOG.md CHANGED
@@ -1,5 +1,84 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.0.0](https://github.com/voxpupuli/rspec-puppet-facts/tree/4.0.0) (2024-06-10)
4
+
5
+ [Full Changelog](https://github.com/voxpupuli/rspec-puppet-facts/compare/3.0.0...4.0.0)
6
+
7
+ **Breaking changes:**
8
+
9
+ - Rely on modern facts [\#178](https://github.com/voxpupuli/rspec-puppet-facts/pull/178) ([ekohl](https://github.com/ekohl))
10
+ - Require FacterDB 2.x [\#176](https://github.com/voxpupuli/rspec-puppet-facts/pull/176) ([bastelfreak](https://github.com/bastelfreak))
11
+
12
+ **Implemented enhancements:**
13
+
14
+ - work with symbolized strings [\#175](https://github.com/voxpupuli/rspec-puppet-facts/pull/175) ([bastelfreak](https://github.com/bastelfreak))
15
+
16
+ **Merged pull requests:**
17
+
18
+ - rubocop: Fix Layout cops [\#182](https://github.com/voxpupuli/rspec-puppet-facts/pull/182) ([bastelfreak](https://github.com/bastelfreak))
19
+ - Use max\_by to determine the maximum value [\#181](https://github.com/voxpupuli/rspec-puppet-facts/pull/181) ([ekohl](https://github.com/ekohl))
20
+ - rubocop: Fix Style cops [\#180](https://github.com/voxpupuli/rspec-puppet-facts/pull/180) ([bastelfreak](https://github.com/bastelfreak))
21
+ - Use more native rspec matchers in tests [\#179](https://github.com/voxpupuli/rspec-puppet-facts/pull/179) ([ekohl](https://github.com/ekohl))
22
+ - Update voxpupuli-rubocop requirement from ~\> 2.6.0 to ~\> 2.7.0 [\#171](https://github.com/voxpupuli/rspec-puppet-facts/pull/171) ([dependabot[bot]](https://github.com/apps/dependabot))
23
+
24
+ ## [3.0.0](https://github.com/voxpupuli/rspec-puppet-facts/tree/3.0.0) (2024-03-23)
25
+
26
+ [Full Changelog](https://github.com/voxpupuli/rspec-puppet-facts/compare/2.0.5...3.0.0)
27
+
28
+ **symbolized facts deprecation**
29
+
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:
31
+
32
+ ```ruby
33
+ case facts[:os]['name']
34
+ when 'Archlinux'
35
+ context 'on Archlinux' do
36
+ it { is_expected.to contain_package('borg') }
37
+ end
38
+ when 'Ubuntu'
39
+ ```
40
+
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:
42
+
43
+ ```ruby
44
+ case facts['os']['name']
45
+ when 'Archlinux'
46
+ context 'on Archlinux' do
47
+ it { is_expected.to contain_package('borg') }
48
+ end
49
+ when 'Ubuntu'
50
+ ```
51
+
52
+
53
+ **Breaking changes:**
54
+
55
+ - Use facterdb\_string\_keys configuration option for custom facts [\#157](https://github.com/voxpupuli/rspec-puppet-facts/pull/157) ([jordanbreen28](https://github.com/jordanbreen28))
56
+ - Do not query for the exact facter version [\#151](https://github.com/voxpupuli/rspec-puppet-facts/pull/151) ([ekohl](https://github.com/ekohl))
57
+ - Drop Ruby 2.4/2.5/2.6 support [\#149](https://github.com/voxpupuli/rspec-puppet-facts/pull/149) ([bastelfreak](https://github.com/bastelfreak))
58
+
59
+ **Implemented enhancements:**
60
+
61
+ - Add Ruby 3.3 support [\#169](https://github.com/voxpupuli/rspec-puppet-facts/pull/169) ([bastelfreak](https://github.com/bastelfreak))
62
+ - gemspec: Add version constraints & CI: Build gem in strict mode [\#165](https://github.com/voxpupuli/rspec-puppet-facts/pull/165) ([bastelfreak](https://github.com/bastelfreak))
63
+ - update puppet agent components [\#164](https://github.com/voxpupuli/rspec-puppet-facts/pull/164) ([bastelfreak](https://github.com/bastelfreak))
64
+ - Add merge facts option to add\_custom\_fact [\#160](https://github.com/voxpupuli/rspec-puppet-facts/pull/160) ([jordanbreen28](https://github.com/jordanbreen28))
65
+ - Collect facts iteratively [\#152](https://github.com/voxpupuli/rspec-puppet-facts/pull/152) ([ekohl](https://github.com/ekohl))
66
+ - Use Hash.to\_h to construct a new hash [\#150](https://github.com/voxpupuli/rspec-puppet-facts/pull/150) ([ekohl](https://github.com/ekohl))
67
+ - Add Ruby 3.2 support [\#148](https://github.com/voxpupuli/rspec-puppet-facts/pull/148) ([bastelfreak](https://github.com/bastelfreak))
68
+
69
+ **Merged pull requests:**
70
+
71
+ - Update voxpupuli-rubocop requirement from ~\> 2.4.0 to ~\> 2.6.0 [\#168](https://github.com/voxpupuli/rspec-puppet-facts/pull/168) ([dependabot[bot]](https://github.com/apps/dependabot))
72
+ - github\_changelog\_generator: Apply best practices [\#163](https://github.com/voxpupuli/rspec-puppet-facts/pull/163) ([bastelfreak](https://github.com/bastelfreak))
73
+ - Gemfile: Add faraday as github\_changelog\_generator dep [\#162](https://github.com/voxpupuli/rspec-puppet-facts/pull/162) ([bastelfreak](https://github.com/bastelfreak))
74
+ - voxpupuli-rubocop: Pin to patch version [\#161](https://github.com/voxpupuli/rspec-puppet-facts/pull/161) ([bastelfreak](https://github.com/bastelfreak))
75
+ - Update voxpupuli-rubocop requirement from ~\> 1.3 to ~\> 2.0 [\#156](https://github.com/voxpupuli/rspec-puppet-facts/pull/156) ([dependabot[bot]](https://github.com/apps/dependabot))
76
+ - CI: add dummy job to depend on [\#155](https://github.com/voxpupuli/rspec-puppet-facts/pull/155) ([bastelfreak](https://github.com/bastelfreak))
77
+ - migrate to voxpupuli-rubocop [\#154](https://github.com/voxpupuli/rspec-puppet-facts/pull/154) ([bastelfreak](https://github.com/bastelfreak))
78
+ - Update rubocop requirement from ~\> 1.48.1 to ~\> 1.54.1 [\#153](https://github.com/voxpupuli/rspec-puppet-facts/pull/153) ([dependabot[bot]](https://github.com/apps/dependabot))
79
+ - Introduce RuboCop and fix various cops [\#146](https://github.com/voxpupuli/rspec-puppet-facts/pull/146) ([ekohl](https://github.com/ekohl))
80
+ - Update puppet agent components [\#145](https://github.com/voxpupuli/rspec-puppet-facts/pull/145) ([bastelfreak](https://github.com/bastelfreak))
81
+
3
82
  ## [2.0.5](https://github.com/voxpupuli/rspec-puppet-facts/tree/2.0.5) (2022-04-22)
4
83
 
5
84
  [Full Changelog](https://github.com/voxpupuli/rspec-puppet-facts/compare/2.0.4...2.0.5)
data/Gemfile CHANGED
@@ -2,17 +2,14 @@ source ENV['GEM_SOURCE'] || 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
- if facterversion = ENV['FACTER_GEM_VERSION']
6
- gem 'facter', facterversion, :require => false
7
- else
8
- gem 'facter', :require => false
9
- end
5
+ gem 'facter', ENV.fetch('FACTER_GEM_VERSION', nil), require: false
10
6
 
11
7
  group :release do
12
- gem 'github_changelog_generator', require: false
8
+ gem 'faraday-retry', '~> 2.1', require: false
9
+ gem 'github_changelog_generator', '~> 1.16.4', require: false
13
10
  end
14
11
 
15
- group :coverage, optional: ENV['COVERAGE']!='yes' do
16
- gem 'simplecov-console', :require => false
17
- gem 'codecov', :require => false
12
+ group :coverage, optional: ENV['COVERAGE'] != 'yes' do
13
+ gem 'codecov', require: false
14
+ gem 'simplecov-console', require: false
18
15
  end
data/README.md CHANGED
@@ -10,7 +10,7 @@ rspec-puppet-facts
10
10
  [![Donated by Camptocamp](https://img.shields.io/badge/donated%20by-camptocamp-fb7047.svg)](#transfer-notice)
11
11
 
12
12
  Based on an original idea from [apenney](https://github.com/apenney/puppet_facts/),
13
- this gem provides a method of running your [rspec-puppet](https://github.com/rodjek/rspec-puppet)
13
+ this gem provides a method of running your [rspec-puppet](https://github.com/puppetlabs/rspec-puppet)
14
14
  tests against the facts for all your supported operating systems (provided by
15
15
  [facterdb](https://github.com/voxpupuli/facterdb)).
16
16
  This simplifies unit testing because you don't need to specify the facts yourself.
@@ -98,7 +98,7 @@ end
98
98
 
99
99
  ## Specifying a default Facter version
100
100
 
101
- By default, `os_supported_os` will return the facts for the version of Facter
101
+ By default, `on_supported_os` will return the facts for the version of Facter
102
102
  that it has loaded (usually this is Facter 2.5.1). This behaviour can be
103
103
  overridden by setting the `default_facter_version` RSpec setting in your
104
104
  `spec/spec_helper.rb` file.
@@ -443,6 +443,28 @@ To do this, pass a lambda as the value for the custom fact. The lambda is passed
443
443
  add_custom_fact :root_home, lambda { |os,facts| "/tmp/#{facts['hostname']}" }
444
444
  ```
445
445
 
446
+ #### Merge into existing facts
447
+
448
+ You can also supply an optional input `:merge_facts` to the `add_custom_fact` method.
449
+
450
+ This allows you to merge facts values into a fact, if the fact is already present in the facts hash as oppose to overwriting the fact value.
451
+
452
+ ```ruby
453
+ add_custom_fact :identity, { 'user' => 'test_user' }, merge_facts: true
454
+ ```
455
+
456
+ Will result in a hash of the identity fact like the below:
457
+
458
+ ```ruby
459
+ {
460
+ "gid"=>0,
461
+ "group"=>"root",
462
+ "privileged"=>true,
463
+ "uid"=>0,
464
+ "user"=>"test_user"
465
+ }
466
+ ```
467
+
446
468
  ### Supplying Custom External Facts through FacterDB
447
469
  Rspec-puppet-facts uses a gem called facterdb that contains many fact sets of various combinations that are pre generated. Rspec-puppet-facts queries
448
470
  facterdb to pull out a specific fact set to use when testing.
@@ -510,7 +532,7 @@ ENV['FACTERDB_SEARCH_PATHS'] = custom_facts
510
532
  ```
511
533
  ## Running your tests
512
534
 
513
- For most cases, there is no change to how you run your tests. Running `rake spec` will run all the tests against the facts for all the supported operating systems. If you are developing a module using the [Puppet Development Kit](https://puppet.com/docs/pdk/1.x/pdk_install.html), `pdk test unit` will run all your tests against the supported operating systems listed in `metadata.json`.
535
+ For most cases, there is no change to how you run your tests. Running `rake spec` will run all the tests against the facts for all the supported operating systems. If you are developing a module using the [Puppet Development Kit](https://puppet.com/docs/pdk/3.x/pdk_install.html), `pdk test unit` will run all your tests against the supported operating systems listed in `metadata.json`.
514
536
 
515
537
  If you want to run the tests against the facts for specific operating systems, you can provide a filter in the `SPEC_FACTS_OS` environment variable and only the supported operating systems whose name starts with the specified filter will be used.
516
538
 
data/Rakefile CHANGED
@@ -1,13 +1,12 @@
1
- require 'bundler/gem_tasks'
2
-
3
1
  PUPPET_VERSIONS_PATH = File.join(__dir__, 'ext', 'puppet_agent_components.json')
4
2
 
5
3
  begin
6
- require 'rspec/core/rake_task'
7
- require 'yard'
8
- RSpec::Core::RakeTask.new(:spec)
9
- YARD::Rake::YardocTask.new
4
+ require 'rspec/core/rake_task'
5
+ require 'yard'
6
+ RSpec::Core::RakeTask.new(:spec)
7
+ YARD::Rake::YardocTask.new
10
8
  rescue LoadError
9
+ # yard is optional
11
10
  end
12
11
 
13
12
  desc 'Produce Commit history since last tag'
@@ -41,23 +40,30 @@ namespace :puppet_versions do
41
40
 
42
41
  output = `git status --porcelain #{PUPPET_VERSIONS_PATH}`
43
42
  unless output.strip.empty?
44
- $stderr.puts "#{PUPPET_VERSIONS_PATH} is out of date."
45
- $stderr.puts 'Run the puppet_versions:update task to update it and commit the changes.'
43
+ warn "#{PUPPET_VERSIONS_PATH} is out of date."
44
+ warn 'Run the puppet_versions:update task to update it and commit the changes.'
46
45
  raise
47
46
  end
48
47
  end
49
48
  end
50
49
 
51
50
  begin
52
- require 'rubygems'
53
51
  require 'github_changelog_generator/task'
54
-
52
+ rescue LoadError
53
+ # github_changelog_generator is an optional group
54
+ else
55
+ require 'rubygems'
55
56
  GitHubChangelogGenerator::RakeTask.new :changelog do |config|
56
- config.exclude_labels = %w{duplicate question invalid wontfix wont-fix skip-changelog}
57
+ config.exclude_labels = %w[duplicate question invalid wontfix wont-fix skip-changelog github_actions]
57
58
  config.user = 'voxpupuli'
58
59
  config.project = 'rspec-puppet-facts'
59
60
  gem_version = Gem::Specification.load("#{config.project}.gemspec").version
60
61
  config.future_release = gem_version
61
62
  end
63
+ end
64
+
65
+ begin
66
+ require 'voxpupuli/rubocop/rake'
62
67
  rescue LoadError
68
+ # the voxpupuli-rubocop gem is optional
63
69
  end