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

@@ -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