Sha256: dc0424acc96cd3cb7c41dd6db6cff27b1f6655f5e9f04f95d431d274f6fecd75

Contents?: true

Size: 416 Bytes

Versions: 37

Compression:

Stored size: 416 Bytes

Contents

# frozen_string_literal: true

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

Version data entries

37 entries across 37 versions & 4 rubygems

Version Path
cucumber-9.2.1 lib/cucumber/gherkin/formatter/escaping.rb
cucumber-9.2.0 lib/cucumber/gherkin/formatter/escaping.rb
cucumber-9.1.2 lib/cucumber/gherkin/formatter/escaping.rb
cucumber-9.1.1 lib/cucumber/gherkin/formatter/escaping.rb
honeybadger-5.4.0 vendor/bundle/ruby/3.2.0/gems/cucumber-9.1.0/lib/cucumber/gherkin/formatter/escaping.rb
cucumber-9.1.0 lib/cucumber/gherkin/formatter/escaping.rb
honeybadger-5.3.0 vendor/bundle/ruby/3.2.0/gems/cucumber-9.0.2/lib/cucumber/gherkin/formatter/escaping.rb
cucumber-9.0.2 lib/cucumber/gherkin/formatter/escaping.rb
cucumber-9.0.1 lib/cucumber/gherkin/formatter/escaping.rb
cucumber-9.0.0 lib/cucumber/gherkin/formatter/escaping.rb
rubypitaya-3.12.5 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/gherkin/formatter/escaping.rb
rubypitaya-3.12.4 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/gherkin/formatter/escaping.rb
rubypitaya-3.12.3 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/gherkin/formatter/escaping.rb
rubypitaya-3.12.2 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/gherkin/formatter/escaping.rb
cucumber-8.0.0 lib/cucumber/gherkin/formatter/escaping.rb
cucumber-8.0.0.rc.1 lib/cucumber/gherkin/formatter/escaping.rb
phillipug-foodie-0.1.0 .vendor/ruby/3.0.0/gems/cucumber-7.1.0/lib/cucumber/gherkin/formatter/escaping.rb
cucumber-7.1.0 lib/cucumber/gherkin/formatter/escaping.rb
cucumber-7.0.0 lib/cucumber/gherkin/formatter/escaping.rb
cucumber-6.1.0 lib/cucumber/gherkin/formatter/escaping.rb