Sha256: 2c03e4f5ec3a29a9d50520b236be4c9fb7379a83e54b458fe56fd6408675df5c

Contents?: true

Size: 443 Bytes

Versions: 11

Compression:

Stored size: 443 Bytes

Contents

# frozen_string_literal: true

module Cucumber
  module HTMLFormatter
    class TemplateWriter
      attr_reader :template

      def initialize(template)
        @template = template
      end

      def write_between(from, to)
        from_exists = !from.nil? && template.include?(from)

        after_from = from_exists ? template.split(from)[1] : template
        to.nil? ? after_from : after_from.split(to)[0]
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
cucumber-html-formatter-21.9.0 lib/cucumber/html_formatter/template_writer.rb
cucumber-html-formatter-21.8.0 lib/cucumber/html_formatter/template_writer.rb
cucumber-html-formatter-21.7.0 lib/cucumber/html_formatter/template_writer.rb
cucumber-html-formatter-21.6.0 lib/cucumber/html_formatter/template_writer.rb
cucumber-html-formatter-21.5.0 lib/cucumber/html_formatter/template_writer.rb
cucumber-html-formatter-21.4.1 lib/cucumber/html_formatter/template_writer.rb
cucumber-html-formatter-21.4.0 lib/cucumber/html_formatter/template_writer.rb
cucumber-html-formatter-21.3.1 lib/cucumber/html_formatter/template_writer.rb
cucumber-html-formatter-21.3.0 lib/cucumber/html_formatter/template_writer.rb
cucumber-html-formatter-21.2.0 lib/cucumber/html_formatter/template_writer.rb
cucumber-html-formatter-21.1.0 lib/cucumber/html_formatter/template_writer.rb