Skip to content

Commit bb04227

Browse files
authored
Merge pull request #209 from bastelfreak/ruby31
Require Ruby 3.1
2 parents 6131ccc + cae7a8b commit bb04227

File tree

8 files changed

+27
-52
lines changed

8 files changed

+27
-52
lines changed

.rubocop_todo.yml

Lines changed: 3 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,19 @@
11
# 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.75.8.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
77
# versions of RuboCop, may require this file to be generated again.
88

9-
# Offense count: 1
10-
# This cop supports unsafe autocorrection (--autocorrect-all).
11-
Performance/MapCompact:
12-
Exclude:
13-
- 'lib/rspec-puppet-facts.rb'
14-
159
# Offense count: 29
1610
# Configuration parameters: Prefixes, AllowedPatterns.
1711
# Prefixes: when, with, without
1812
RSpec/ContextWording:
1913
Exclude:
2014
- 'spec/rspec_puppet_facts_spec.rb'
2115

22-
# Offense count: 7
16+
# Offense count: 6
2317
# Configuration parameters: CountAsOne.
2418
RSpec/ExampleLength:
2519
Max: 13
@@ -29,14 +23,6 @@ RSpec/ExpectInHook:
2923
Exclude:
3024
- 'spec/rspec_puppet_facts_spec.rb'
3125

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-
4026
# Offense count: 4
4127
RSpec/LeakyConstantDeclaration:
4228
Exclude:
@@ -69,25 +55,6 @@ RSpec/StubbedMock:
6955
Exclude:
7056
- 'spec/rspec_puppet_facts_spec.rb'
7157

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-
9158
# Offense count: 1
9259
Style/MixinUsage:
9360
Exclude:
@@ -112,12 +79,6 @@ Style/RedundantArgument:
11279

11380
# Offense count: 1
11481
# 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).
12182
# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength.
12283
# AllowedMethods: present?, blank?, presence, try, try!
12384
Style/SafeNavigation:

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
source ENV['GEM_SOURCE'] || 'https://rubygems.org'
24

35
gemspec

Rakefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
PUPPET_VERSIONS_PATH = File.join(__dir__, 'ext', 'puppet_agent_facter_versions.json')
24

35
begin
@@ -17,6 +19,7 @@ task :dump_commit do
1719
end
1820

1921
namespace :puppet_versions do
22+
desc 'updates the vendored list of puppet versions & components'
2023
task :update do
2124
require 'net/http'
2225
require 'net/https'
@@ -41,6 +44,7 @@ namespace :puppet_versions do
4144
File.write(PUPPET_VERSIONS_PATH, "#{JSON.pretty_generate(data.to_h)}\n")
4245
end
4346

47+
desc 'runs all tests and verifies vendored component list'
4448
task :test do
4549
Rake::Task['puppet_versions:update'].invoke
4650

lib/rspec-puppet-facts.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'puppet'
24
require 'facter'
35
require 'facterdb'

lib/rspec-puppet-facts/version.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module RspecPuppetFacts
24
# This module contains the current version constant
35
module Version

rspec-puppet-facts.gemspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
1313
s.description = 'Contains facts from many Facter version on many Operating Systems'
1414
s.licenses = 'Apache-2.0'
1515

16-
s.required_ruby_version = '>= 2.7.0'
16+
s.required_ruby_version = '>= 3.1.0'
1717

1818
s.files = `git ls-files`.split("\n")
1919
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
@@ -23,7 +23,7 @@ Gem::Specification.new do |s|
2323
s.add_development_dependency 'rspec', '~> 3.12'
2424
s.add_development_dependency 'yard', '~> 0.9.34'
2525

26-
s.add_development_dependency 'voxpupuli-rubocop', '~> 3.1.0'
26+
s.add_development_dependency 'voxpupuli-rubocop', '~> 4.1.0'
2727

2828
s.add_dependency 'deep_merge', '~> 1.2'
2929
s.add_dependency 'facter', '< 5'

spec/rspec_puppet_facts_spec.rb

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'spec_helper'
24
require 'json'
35
require 'stringio'
@@ -204,7 +206,7 @@
204206
end
205207

206208
it 'returns a hash' do
207-
is_expected.to be_a Hash
209+
expect(subject).to be_a Hash
208210
end
209211

210212
it 'returns supported OS' do
@@ -276,7 +278,7 @@
276278
end
277279

278280
it 'returns a hash' do
279-
is_expected.to be_a Hash
281+
expect(subject).to be_a Hash
280282
end
281283

282284
it 'returns supported OS' do
@@ -639,7 +641,7 @@
639641
end
640642

641643
it 'returns facts from the specified default Facter version' do
642-
is_expected.to match(
644+
expect(subject).to match(
643645
'centos-9-x86_64' => include(
644646
facterversion: /\A4\.6\./,
645647
),
@@ -662,7 +664,7 @@
662664
end
663665

664666
it 'returns facts from a facter version matching version and below' do
665-
is_expected.to match(
667+
expect(subject).to match(
666668
'centos-9-x86_64' => include(
667669
facterversion: /\A4\.[0-7]\./,
668670
),
@@ -691,7 +693,7 @@
691693
end
692694

693695
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'))
695697
end
696698
end
697699

@@ -706,7 +708,7 @@
706708
end
707709

708710
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'))
710712
end
711713
end
712714

@@ -747,11 +749,11 @@
747749
end
748750

749751
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'))
751753
end
752754

753755
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'))
755757
end
756758
end
757759
end

spec/spec_helper.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'rspec'
24
require 'rspec-puppet-facts'
35
include RspecPuppetFacts

0 commit comments

Comments
 (0)