Method: Bundler::Thor::Util.escape_globs

Defined in:
lib/bundler/vendor/thor/lib/thor/util.rb

.escape_globs(path) ⇒ Object

Returns a string that has had any glob characters escaped. The glob characters are ‘* ? { } [ ]`.

Examples

Bundler::Thor::Util.escape_globs('[apps]')   # => '\[apps\]'

Parameters

String

Returns

String

[View source]

264
265
266
# File 'lib/bundler/vendor/thor/lib/thor/util.rb', line 264

def escape_globs(path)
  path.to_s.gsub(/[*?{}\[\]]/, '\\\\\\&')
end