summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-03-31 12:39:51 -0700
committerTim Smith <tsmith84@gmail.com>2020-03-31 12:39:51 -0700
commitd8a326ef36843183dd9c54f2cda5dc1eb695de62 (patch)
treef522b2b144c71f9d7999284e1ac729c4765c3f6e
parent0afbeaf6e6394d7128793dd1b39ce59a9a30eb0c (diff)
downloadchef-d8a326ef36843183dd9c54f2cda5dc1eb695de62.tar.gz
Simplify the matching code per code review
I read the github review history wrong on this and totally missed this suggestion. Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--lib/chef/resource/build_essential.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/chef/resource/build_essential.rb b/lib/chef/resource/build_essential.rb
index 68268f8142..5a41f3895b 100644
--- a/lib/chef/resource/build_essential.rb
+++ b/lib/chef/resource/build_essential.rb
@@ -177,10 +177,8 @@ class Chef
available_updates.error!
# https://rubular.com/r/UPEE5P7mZLvXNs
- label_match = available_updates.stdout.match(/^\s*\* (?:Label: )?(Command Line Tools.*)/)
-
# this will return the match or nil
- label_match[1] unless label_match.nil?
+ available_updates.stdout[/^\s*\* (?:Label: )?(Command Line Tools.*)/, 1]
end
end
end