From 530ed4d65a8634de47d317962ba02a545471699a Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Fri, 6 Sep 2024 11:35:41 +0200 Subject: [PATCH] rubocop: autofix --- lib/facter/custom_facts/core/execution/base.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/facter/custom_facts/core/execution/base.rb b/lib/facter/custom_facts/core/execution/base.rb index 6d4a5d8cf9..a498208c68 100644 --- a/lib/facter/custom_facts/core/execution/base.rb +++ b/lib/facter/custom_facts/core/execution/base.rb @@ -25,8 +25,8 @@ def with_env(values) # set the new (temporary) value for the environment variable ENV[var] = value end - # execute the caller's block, capture the return value - rv = yield + # execute the caller's block, returning its value + yield # use an ensure block to make absolutely sure we restore the variables ensure # restore the old values @@ -38,8 +38,6 @@ def with_env(values) ENV.delete(var) end end - # return the captured return value - rv end def execute(command, options = {})