Apply remaining rubocop fixes

This commit is contained in:
David Schmitt
2020-12-16 17:36:26 +00:00
parent d3c3598349
commit f9d03a10ac
4 changed files with 89 additions and 81 deletions

View File

@@ -89,6 +89,8 @@ Performance/CaseWhenSplat:
Performance/Casecmp:
Enabled: true
Performance/CollectionLiteralInLoop:
Exclude:
- spec/**/*
Enabled: true
Performance/CompareWithBlock:
Enabled: true
@@ -294,6 +296,8 @@ Metrics/AbcSize:
Enabled: false
Metrics/BlockLength:
Enabled: false
Metrics/BlockNesting:
Enabled: false
Metrics/ClassLength:
Enabled: false
Metrics/CyclomaticComplexity:
@@ -308,6 +312,8 @@ Metrics/PerceivedComplexity:
Enabled: false
Migration/DepartmentName:
Enabled: false
Naming/AccessorMethodName:
Enabled: false
Naming/BlockParameterName:
Enabled: false
Naming/HeredocDelimiterCase:

View File

View File

@@ -37,7 +37,7 @@ Facter.add(:java_version) do
confine operatingsystem: 'Darwin'
has_weight 100
setcode do
unless %r{Unable to find any JVMs matching version} =~ Facter::Util::Resolution.exec('/usr/libexec/java_home --failfast 2>&1')
unless Facter::Util::Resolution.exec('/usr/libexec/java_home --failfast 2>&1').include?('Unable to find any JVMs matching version')
version = nil
Facter::Util::Resolution.exec('java -Xmx12m -version 2>&1').lines.each { |line| version = Regexp.last_match(1) if %r{^.+ version \"(.+)\"} =~ line }
version

View File

@@ -189,13 +189,14 @@ install_sap_jdk_jre = <<EOL
}
EOL
context 'installing java jre', unless: UNSUPPORTED_PLATFORMS.include?(os[:family]) do
describe 'installing' do
context 'installing java jre' do
it 'installs jre' do
idempotent_apply(java_class_jre)
end
end
context 'installing java jdk', unless: UNSUPPORTED_PLATFORMS.include?(os[:family]) do
context 'installing java jdk' do
it 'installs jdk' do
idempotent_apply(java_class)
end
@@ -280,3 +281,4 @@ context 'java::adopt', if: sap_enabled && ['Sles'].include?(os[:family]), unless
idempotent_apply(install_sap_jdk_jre)
end
end
end