summaryrefslogtreecommitdiff
path: root/lib/chef/resource.rb
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2021-12-26 18:50:43 -0800
committerTim Smith <tsmith84@gmail.com>2021-12-26 18:50:43 -0800
commitf84a238a1d8d0060d5064eee0b74ed942088d4fd (patch)
treed26039e8502c84a0c2e2c947227bab5f02139c81 /lib/chef/resource.rb
parent50a0001bae754c66feb69c84b64cb305a03a34d2 (diff)
downloadchef-Performance_RegexpMatch.tar.gz
Resolve Performance/RegexpMatch warningsPerformance_RegexpMatch
Do regex checks without creating objects for the results. Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib/chef/resource.rb')
-rw-r--r--lib/chef/resource.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/resource.rb b/lib/chef/resource.rb
index 746efb5fd4..dadcb5c51a 100644
--- a/lib/chef/resource.rb
+++ b/lib/chef/resource.rb
@@ -1096,7 +1096,7 @@ class Chef
rescue NameError => e
# This can happen when attempting to load a provider in a platform-specific
# environment where we have not required the necessary files yet
- raise unless e.message =~ /uninitialized constant/
+ raise unless /uninitialized constant/.match?(e.message)
end
# Define a method to load up this resource's properties with the current