Sha256: a35f33d00f5598529d517533cef6e68b1bb49d5fadbde7e9ae91f184055ab634

Contents?: true

Size: 190 Bytes

Versions: 22

Compression:

Stored size: 190 Bytes

Contents

class String

  # Escape special characters used in most
  # unix shells to use it, eg. with system().

  def shell_escape
    self.gsub(/([\\\t\| &`<>)('"])/) { |s| '\\' << s }
  end

end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
facets-1.3.0 lib/facets/core/string/shell_escape.rb
facets-1.2.0 lib/facets/core/string/shell_escape.rb
facets-1.2.1 lib/facets/core/string/shell_escape.rb
facets-1.3.3 lib/facets/core/string/shell_escape.rb
facets-1.3.2 lib/facets/core/string/shell_escape.rb
facets-1.3.1 lib/facets/core/string/shell_escape.rb
facets-1.4.1 lib/facets/core/string/shell_escape.rb
facets-1.4.0 lib/facets/core/string/shell_escape.rb
facets-1.4.2 lib/facets/core/string/shell_escape.rb
facets-1.4.3 lib/facets/core/string/shell_escape.rb
facets-1.4.5 lib/facets/core/string/shell_escape.rb
facets-1.4.4 lib/facets/core/string/shell_escape.rb
facets-1.7.30 lib/facets/core/string/shell_escape.rb
facets-1.7.38 lib/facets/core/string/shell_escape.rb
facets-1.7.0 lib/facets/core/string/shell_escape.rb
facets-1.7.46 lib/facets/core/string/shell_escape.rb
facets-1.8.0 lib/facets/core/string/shell_escape.rb
facets-1.8.20 lib/facets/core/string/shell_escape.rb
facets-1.8.49 lib/facets/core/string/shell_escape.rb
facets-1.8.51 lib/facets/core/string/shell_escape.rb