diff options
author | Thom May <thom@chef.io> | 2017-02-01 15:06:56 +0000 |
---|---|---|
committer | Thom May <thom@chef.io> | 2017-02-01 15:47:44 +0000 |
commit | f8e19c924cef965e62eeb0d8ffee39aecc9f26af (patch) | |
tree | e978a35f93805fff7537c0ba1b5a33d4fa0debb2 /lib/chef/cookbook | |
parent | e8e2c01d99eae90076b65c4c1e5a1388450fba50 (diff) | |
download | chef-f8e19c924cef965e62eeb0d8ffee39aecc9f26af.tar.gz |
switch to using regexp escape
And add test that fails with original code
Signed-off-by: Thom May <thom@chef.io>
Diffstat (limited to 'lib/chef/cookbook')
-rw-r--r-- | lib/chef/cookbook/syntax_check.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/cookbook/syntax_check.rb b/lib/chef/cookbook/syntax_check.rb index 29da50d8a6..8d0d636bd2 100644 --- a/lib/chef/cookbook/syntax_check.rb +++ b/lib/chef/cookbook/syntax_check.rb @@ -110,7 +110,7 @@ class Chef end def remove_uninteresting_ruby_files(file_list) - file_list.reject { |f| f =~ %r{#{Chef::Util::PathHelper.escape_glob_dir(cookbook_path)}/(files|templates)/} } + file_list.reject { |f| f =~ %r{#{Regexp.quote(cookbook_path)}/(files|templates)/} } end def ruby_files |