Skip to content

Commit 78d554a

Browse files
committed
Add all safe auto corrects
1 parent e13c5a2 commit 78d554a

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

spec/acceptance/itk_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
service_name = 'apache2'
88
variant = :prefork
99
when 'redhat'
10-
unless os[:release] =~ %r{^5}
10+
unless %r{^5}.match?(os[:release])
1111
variant = (os[:release].to_i >= 7) ? :prefork : :itk_only
1212
service_name = 'httpd'
1313
end

spec/acceptance/vhost_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1083,7 +1083,7 @@ class { 'apache': }
10831083
}
10841084
MANIFEST
10851085
it 'applies cleanly' do
1086-
pp += "\nclass { 'apache::mod::actions': }" if os[:family] =~ %r{debian|suse|ubuntu|sles}
1086+
pp += "\nclass { 'apache::mod::actions': }" if %r{debian|suse|ubuntu|sles}.match?(os[:family])
10871087
apply_manifest(pp, catch_failures: true)
10881088
end
10891089

spec/spec_helper_acceptance_local.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def print_parsing_errors
3434
end
3535
c.before :suite do
3636
# Make sure selinux is disabled so the tests work.
37-
LitmusHelper.instance.run_shell('setenforce 0', expect_failures: true) if os[:family] =~ %r{redhat|oracle}
37+
LitmusHelper.instance.run_shell('setenforce 0', expect_failures: true) if %r{redhat|oracle}.match?(os[:family])
3838

3939
LitmusHelper.instance.run_shell('puppet module install stahnma/epel')
4040
pp = <<-PUPPETCODE

spec/unit/provider/a2mod/gentoo_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
end
1111

1212
[:conf_file, :instances, :modules, :initvars, :conf_file, :clear].each do |method|
13-
it "should respond to the class method #{method}" do
13+
it "responds to the class method #{method}" do
1414
expect(provider_class).to respond_to(method)
1515
end
1616
end

spec/util/_resources/test_metadata_json.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,4 @@
8585
"pdk-version": "1.17.0",
8686
"template-url": "https://github.com/puppetlabs/pdk-templates#main",
8787
"template-ref": "heads/main-0-g095317c"
88-
}'.freeze
88+
}'

spec/util/apache_mod_platform_support_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
context 'after parsing the metadata.json' do
106106
expected_compatible_platform_versions.each do |os, vers|
107107
vers.each do |ver|
108-
it "should state #{os} version #{ver} IS a compatible platform" do
108+
it "states #{os} version #{ver} IS a compatible platform" do
109109
ampc.register_running_platform(family: os, version: ver)
110110
expect(ampc.mod_supported_on_platform?(foobar_mod)).to be(true)
111111
end

util/apache_mod_platform_support.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def extract_os_ver_pairs(line)
9494
platforms_versions = {}
9595
os_ver_groups = line.delete(' ').downcase
9696
# E.g. "debian:5,6;centos:5;sles:11sp1,12;scientific:all;ubuntu:14.04,16.04"
97-
if %r{^((?:\w+:(?:(?:\d+(?:\.\d+|sp\d+)?|all),?)+;?)+)$}i =~ os_ver_groups
97+
if %r{^((?:\w+:(?:(?:\d+(?:\.\d+|sp\d+)?|all),?)+;?)+)$}i.match?(os_ver_groups)
9898
os_ver_groups.split(';').each do |os_vers|
9999
os, vers = os_vers.split(':')
100100
vers.gsub!(%r{sp\d+}, '') # Remove SP ver as we cannot determine this level of granularity from values from Litmus
@@ -106,7 +106,7 @@ def extract_os_ver_pairs(line)
106106

107107
def process_line(line)
108108
data = {}
109-
return data unless line =~ %r{@note\sUnsupported\splatforms?:\s?|class\sapache::mod}i
109+
return data unless %r{@note\sUnsupported\splatforms?:\s?|class\sapache::mod}i.match?(line)
110110
if (match = %r{@note\sUnsupported\splatforms?:\s?(?<os_vers>.*)$}i.match(line))
111111
data[:type] = :unsupported_platform_declaration
112112
data[:value] = match[:os_vers]

0 commit comments

Comments
 (0)