Sha256: 68a83ddae6c2cba1ad5c2697d56fca1b342c328cd6426931ae94d868183056c3

Contents?: true

Size: 323 Bytes

Versions: 2

Compression:

Stored size: 323 Bytes

Contents

class String
  def shell_escape
    # The gsub is for ANSI-C style quoting.
    # 
    # The $'' is for bash, see http://www.faqs.org/docs/bashman/bashref_12.html,
    # but appears to be working for other shells: sh, zsh, ksh, dash
    "$'#{gsub(/\\|'/) { |c| "\\#{c}" }}'"
  end unless method_defined?(:shell_escape)
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
greatseth-mediainfo-0.5.1 lib/mediainfo/string.rb
mediainfo-0.5.1 lib/mediainfo/string.rb