Class: Dir
Class Method Summary collapse
-
.glob_escape(path) ⇒ Object
prefix any glob-special characters in path with backslashes.
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 |