summaryrefslogtreecommitdiff
path: root/lib/chef/cookbook/chefignore.rb
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-03-11 13:42:34 -0700
committerTim Smith <tsmith@chef.io>2018-03-14 09:51:49 -0700
commit3a7af28896be3702b933bd13dcfff96b98314ebd (patch)
tree23a9b9d00245fe21b81742feefdf31c8549d8b70 /lib/chef/cookbook/chefignore.rb
parent02775faa30db6a9ae98597cb6cd0e0c4defa7dc4 (diff)
downloadchef-3a7af28896be3702b933bd13dcfff96b98314ebd.tar.gz
Use match? where we don't need the match datadrop_23
This is a Ruby 2.4-ism that's faster than =~ because it doesn't actually store the match. This is just autocorrected from Rubocop's Performance/RegexpMatch Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib/chef/cookbook/chefignore.rb')
-rw-r--r--lib/chef/cookbook/chefignore.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/cookbook/chefignore.rb b/lib/chef/cookbook/chefignore.rb
index d905e027d6..42de22607b 100644
--- a/lib/chef/cookbook/chefignore.rb
+++ b/lib/chef/cookbook/chefignore.rb
@@ -62,7 +62,7 @@ class Chef
end
def find_ignore_file(path)
- if File.basename(path) =~ /chefignore/
+ if File.basename(path).match?(/chefignore/)
path
else
File.join(path, "chefignore")