Skip to content

Commit 155a572

Browse files
committed
Revert "Require Ruby 3.1"
This reverts commit cae7a8b.
1 parent f037c41 commit 155a572

File tree

8 files changed

+52
-27
lines changed

8 files changed

+52
-27
lines changed

.rubocop_todo.yml

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
11
# This configuration was generated by
2-
# `rubocop --auto-gen-config --no-auto-gen-timestamp`
3-
# using RuboCop version 1.75.8.
2+
# `rubocop --auto-gen-config`
3+
# on 2024-06-09 17:48:43 UTC using RuboCop version 1.63.5.
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+
915
# Offense count: 29
1016
# Configuration parameters: Prefixes, AllowedPatterns.
1117
# Prefixes: when, with, without
1218
RSpec/ContextWording:
1319
Exclude:
1420
- 'spec/rspec_puppet_facts_spec.rb'
1521

16-
# Offense count: 6
22+
# Offense count: 7
1723
# Configuration parameters: CountAsOne.
1824
RSpec/ExampleLength:
1925
Max: 13
@@ -23,6 +29,14 @@ RSpec/ExpectInHook:
2329
Exclude:
2430
- 'spec/rspec_puppet_facts_spec.rb'
2531

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+
2640
# Offense count: 4
2741
RSpec/LeakyConstantDeclaration:
2842
Exclude:
@@ -55,6 +69,25 @@ RSpec/StubbedMock:
5569
Exclude:
5670
- 'spec/rspec_puppet_facts_spec.rb'
5771

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+
5891
# Offense count: 1
5992
Style/MixinUsage:
6093
Exclude:
@@ -79,6 +112,12 @@ Style/RedundantArgument:
79112

80113
# Offense count: 1
81114
# 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).
82121
# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength.
83122
# AllowedMethods: present?, blank?, presence, try, try!
84123
Style/SafeNavigation:

Gemfile

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

53
gemspec

Rakefile

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

53
begin
@@ -19,7 +17,6 @@ task :dump_commit do
1917
end
2018

2119
namespace :puppet_versions do
22-
desc 'updates the vendored list of puppet versions & components'
2320
task :update do
2421
require 'net/http'
2522
require 'net/https'
@@ -44,7 +41,6 @@ namespace :puppet_versions do
4441
File.write(PUPPET_VERSIONS_PATH, "#{JSON.pretty_generate(data.to_h)}\n")
4542
end
4643

47-
desc 'runs all tests and verifies vendored component list'
4844
task :test do
4945
Rake::Task['puppet_versions:update'].invoke
5046

lib/rspec-puppet-facts.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# frozen_string_literal: true
2-
31
require 'facter'
42
require 'facterdb'
53
require 'json'

lib/rspec-puppet-facts/version.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# frozen_string_literal: true
2-
31
module RspecPuppetFacts
42
# This module contains the current version constant
53
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 = '>= 3.1.0'
16+
s.required_ruby_version = '>= 2.7.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', '~> 4.1.0'
26+
s.add_development_dependency 'voxpupuli-rubocop', '~> 3.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: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# frozen_string_literal: true
2-
31
require 'spec_helper'
42
require 'json'
53
require 'stringio'
@@ -206,7 +204,7 @@
206204
end
207205

208206
it 'returns a hash' do
209-
expect(subject).to be_a Hash
207+
is_expected.to be_a Hash
210208
end
211209

212210
it 'returns supported OS' do
@@ -278,7 +276,7 @@
278276
end
279277

280278
it 'returns a hash' do
281-
expect(subject).to be_a Hash
279+
is_expected.to be_a Hash
282280
end
283281

284282
it 'returns supported OS' do
@@ -641,7 +639,7 @@
641639
end
642640

643641
it 'returns facts from the specified default Facter version' do
644-
expect(subject).to match(
642+
is_expected.to match(
645643
'centos-9-x86_64' => include(
646644
facterversion: /\A4\.6\./,
647645
),
@@ -664,7 +662,7 @@
664662
end
665663

666664
it 'returns facts from a facter version matching version and below' do
667-
expect(subject).to match(
665+
is_expected.to match(
668666
'centos-9-x86_64' => include(
669667
facterversion: /\A4\.[0-7]\./,
670668
),
@@ -693,7 +691,7 @@
693691
end
694692

695693
it 'returns facts from a facter version matching 4.6' do
696-
expect(subject).to match('centos-9-x86_64' => include(facterversion: '4.6.1'))
694+
is_expected.to match('centos-9-x86_64' => include(facterversion: '4.6.1'))
697695
end
698696
end
699697

@@ -708,7 +706,7 @@
708706
end
709707

710708
it 'returns facts from a facter version matching 4.6.1' do
711-
expect(subject).to match('centos-9-x86_64' => include(facterversion: '4.6.1'))
709+
is_expected.to match('centos-9-x86_64' => include(facterversion: '4.6.1'))
712710
end
713711
end
714712

@@ -749,11 +747,11 @@
749747
end
750748

751749
it 'returns CentOS facts from a facter version matching 4.5' do
752-
expect(subject).to include('centos-9-x86_64' => include(facterversion: '4.5.2'))
750+
is_expected.to include('centos-9-x86_64' => include(facterversion: '4.5.2'))
753751
end
754752

755753
it 'returns Debian facts from a facter version matching 4.6.1' do
756-
expect(subject).to include('debian-12-x86_64' => include(facterversion: '4.6.1'))
754+
is_expected.to include('debian-12-x86_64' => include(facterversion: '4.6.1'))
757755
end
758756
end
759757
end

spec/spec_helper.rb

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

0 commit comments

Comments
 (0)