From 81f8c2588fafc28f5696035ddb44b10620807ffd Mon Sep 17 00:00:00 2001 From: Mihmet Akpinar Date: Wed, 5 Jun 2024 09:02:04 +0200 Subject: [PATCH] fix rubocop linting --- lib/facter/vault_version.rb | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/facter/vault_version.rb b/lib/facter/vault_version.rb index f65de5b..b2af286 100644 --- a/lib/facter/vault_version.rb +++ b/lib/facter/vault_version.rb @@ -6,11 +6,10 @@ # Facter.add(:vault_version) do setcode do - if Facter::Util::Resolution.which('vault') - vault_server_version_output = Facter::Util::Resolution.exec('vault version') - match = vault_server_version_output.match(%r{Vault v(\d+\.\d+\.\d+)}) - match ? match.captures.first : nil - end + if Facter::Util::Resolution.which('vault') + vault_server_version_output = Facter::Util::Resolution.exec('vault version') + match = vault_server_version_output.match(%r{Vault v(\d+\.\d+\.\d+)}) + match&.captures.first + end end - end - \ No newline at end of file +end