Method: ChefConfig::PathHelper.escape_glob_dir

Defined in:
lib/chef-config/path_helper.rb

.escape_glob_dir(*parts) ⇒ Object

This function does not switch to backslashes for windows This is because only forwardslashes should be used with dir (even for windows)



197
198
199
200
# File 'lib/chef-config/path_helper.rb', line 197

def self.escape_glob_dir(*parts)
  path = Pathname.new(join(*parts)).cleanpath.to_s
  path.gsub(/[\\\{\}\[\]\*\?]/) { |x| "\\" + x }
end