Sha256: e3c28a0c9bc23b8359d09456ab7472825b7447df24fef2ccde6b7d7dbe3f828b

Contents?: true

Size: 241 Bytes

Versions: 15

Compression:

Stored size: 241 Bytes

Contents

# Suraj Kurapati -- http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/261459
class String
  # Transforms this string into an escaped POSIX shell argument.
  def shell_escape
    inspect.gsub(/\\(\d{3})/) {$1.to_i(8).chr}
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
automate-it-0.9.2 lib/ext/shell_escape.rb
automate-it-0.9.1 lib/ext/shell_escape.rb
automate-it-0.9.0 lib/ext/shell_escape.rb
automateit-0.71103 lib/ext/shell_escape.rb
automateit-0.71220 lib/ext/shell_escape.rb
automateit-0.71104 lib/ext/shell_escape.rb
automateit-0.71111 lib/ext/shell_escape.rb
automateit-0.71112 lib/ext/shell_escape.rb
automateit-0.71219 lib/ext/shell_escape.rb
automateit-0.71221 lib/ext/shell_escape.rb
automateit-0.71226.1 lib/ext/shell_escape.rb
automateit-0.71226 lib/ext/shell_escape.rb
automateit-0.80116 lib/ext/shell_escape.rb
automateit-0.71230 lib/ext/shell_escape.rb
automateit-0.80624 lib/ext/shell_escape.rb