Method: ChefConfig::PathHelper.escape_glob

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

.escape_glob(*parts, windows: ChefUtils.windows?) ⇒ Object

Deprecated.

this method is deprecated. Please use escape_glob_dirs

Paths which may contain glob-reserved characters need to be escaped before globbing can be done. stackoverflow.com/questions/14127343



190
191
192
193
# File 'lib/chef-config/path_helper.rb', line 190

def self.escape_glob(*parts, windows: ChefUtils.windows?)
  path = cleanpath(join(*parts, windows: windows), windows: windows)
  path.gsub(/[\\\{\}\[\]\*\?]/) { |x| "\\" + x }
end