Method: Path.glob_escape

Defined in:
lib/path/dir.rb

.glob_escape(path) ⇒ Object

Escape the path to be suitable for globbing (so it contains no globbing special characters)



7
8
9
# File 'lib/path/dir.rb', line 7

def glob_escape(path)
  path.gsub(/\[|\]|\*|\?|\{|\}/, '\\\\' + '\0')
end