Method: Voodoo::CommandPostProcessor.shell_encode
- Defined in:
- lib/voodoo/generators/command_postprocessor.rb
.shell_encode(string) ⇒ Object
Encodes a string so that it is safe for use as a shell argument
11 12 13 |
# File 'lib/voodoo/generators/command_postprocessor.rb', line 11 def shell_encode string '"' + string.gsub(/([\\`"$\n])/, "\\\\\\1") + '"' end |