diff options
author | Tim Smith <tsmith84@gmail.com> | 2020-03-31 12:39:51 -0700 |
---|---|---|
committer | Tim Smith <tsmith84@gmail.com> | 2020-04-02 12:27:50 -0700 |
commit | fda3d15113e1ccee446cb37375ae6533c1d08024 (patch) | |
tree | 4c0ce965b29dff659f0fd7b67c9fd927e1eca063 /lib/chef/resource | |
parent | 127941112248fc05e2437cfe4143533b99650699 (diff) | |
download | chef-fda3d15113e1ccee446cb37375ae6533c1d08024.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>
Diffstat (limited to 'lib/chef/resource')
-rw-r--r-- | lib/chef/resource/build_essential.rb | 4 |
1 files changed, 1 insertions, 3 deletions
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 |