Class: Dir

Inherits:
Object show all
Defined in:
lib/api_hammer/glob_escape.rb

Class Method Summary collapse

Class Method Details

.glob_escape(path) ⇒ Object

prefix any glob-special characters in path with backslashes



3
4
5
# File 'lib/api_hammer/glob_escape.rb', line 3

def glob_escape(path)
  path.gsub(/[*?\[\]{}\\]/) { |match| "\\#{match}" }
end