From fda3d15113e1ccee446cb37375ae6533c1d08024 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Tue, 31 Mar 2020 12:39:51 -0700 Subject: 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 --- lib/chef/resource/build_essential.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'lib/chef') diff --git a/lib/chef/resource/build_essential.rb b/lib/chef/resource/build_essential.rb index fdf4a48881..0944805653 100644 --- a/lib/chef/resource/build_essential.rb +++ b/lib/chef/resource/build_essential.rb @@ -190,10 +190,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 -- cgit v1.2.1