Module: Shell
- Defined in:
- lib/shell.rb
Class Method Summary collapse
Class Method Details
.escape(str) ⇒ Object
2 3 4 5 6 |
# File 'lib/shell.rb', line 2 def self.escape(str) String(str).gsub(/(?=[^a-zA-Z0-9_.\/\-\x7F-\xFF\n])/n, '\\'). gsub(/\n/,"'\n'"). sub(/^$/,"''") end |