Module: Shellwords

Defined in:
lib/mina/windows_patches.rb

Class Method Summary collapse

Class Method Details

.shellescape(str) ⇒ Object Also known as: escape


6
7
8
# File 'lib/mina/windows_patches.rb', line 6

def shellescape(str)
  '"' + str.gsub(/\\(?=\\*\")/, "\\\\\\").gsub(/\"/, "\\\"").gsub(/\\$/, "\\\\\\").gsub("%", "%%") + '"'
end