class String

Suraj Kurapati – blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/261459

Public Instance Methods

shell_escape() click to toggle source

Transforms this string into an escaped POSIX shell argument.

# File lib/ext/shell_escape.rb, line 4
def shell_escape
  inspect.gsub(/\\(\d{3})/) {$1.to_i(8).chr}
end