Sha256: 58e8e784b059254634f3cdda0dc6c86a41fca4237753b71d77fa134c8b22c011

Contents?: true

Size: 330 Bytes

Versions: 323

Compression:

Stored size: 330 Bytes

Contents

module Gherkin
  module Formatter
    module Escaping
      # Escapes a pipes and backslashes:
      #
      # * | becomes \|
      # * \ becomes \\
      #
      # This is used in the pretty formatter.
      def escape_cell(s)
        s.gsub(/\\(?!\|)/, "\\\\\\\\").gsub(/\n/, "\\n").gsub(/\|/, "\\|")
      end
    end
  end
end

Version data entries

323 entries across 316 versions & 10 rubygems

Version Path
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/gherkin-2.12.2/lib/gherkin/formatter/escaping.rb
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/gherkin-2.12.2/lib/gherkin/formatter/escaping.rb
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/gherkin-2.12.2/lib/gherkin/formatter/escaping.rb
gherkin-2.12.2 lib/gherkin/formatter/escaping.rb
gherkin-2.12.2-x86-mswin32 lib/gherkin/formatter/escaping.rb
gherkin-2.12.2-x86-mingw32 lib/gherkin/formatter/escaping.rb
gherkin-2.12.2-java lib/gherkin/formatter/escaping.rb
candlepin-api-0.4.0 bundle/ruby/1.8/gems/gherkin-2.11.1/lib/gherkin/formatter/escaping.rb
candlepin-api-0.4.0 bundle/ruby/1.9.1/gems/gherkin-2.11.1/lib/gherkin/formatter/escaping.rb
candlepin-api-0.4.0 bundle/ruby/gems/gherkin-2.11.1/lib/gherkin/formatter/escaping.rb
gherkin-2.12.1 lib/gherkin/formatter/escaping.rb
gherkin-2.12.1-x86-mswin32 lib/gherkin/formatter/escaping.rb
gherkin-2.12.1-x86-mingw32 lib/gherkin/formatter/escaping.rb
gherkin-2.12.1-java lib/gherkin/formatter/escaping.rb
librarian-puppet-0.9.9 vendor/gems/ruby/1.9.1/gems/gherkin-2.11.6/lib/gherkin/formatter/escaping.rb
gherkin-2.12.0 lib/gherkin/formatter/escaping.rb
gherkin-2.12.0-x86-mingw32 lib/gherkin/formatter/escaping.rb
gherkin-2.12.0-x86-mswin32 lib/gherkin/formatter/escaping.rb
gherkin-2.12.0-java lib/gherkin/formatter/escaping.rb
gherkin-2.11.8 lib/gherkin/formatter/escaping.rb