Class: String

Inherits:
Object show all
Defined in:
lib/ext/shell_escape.rb

Overview

Instance Method Summary collapse

Instance Method Details

#shell_escapeObject

Transforms this string into an escaped POSIX shell argument.



4
5
6
# File 'lib/ext/shell_escape.rb', line 4

def shell_escape
  inspect.gsub(/\\(\d{3})/) {$1.to_i(8).chr}
end