Sha256: ac9c52d15a32f184a0fab6116e3a036196e776534325aa2bdff00f985a1a6fdd

Contents?: true

Size: 382 Bytes

Versions: 3

Compression:

Stored size: 382 Bytes

Contents

# frozen_string_literal: true

require 'erb'

module Leftovers
  class ERB < ::ERB::Compiler
    def self.precompile(erb)
      @compiler ||= new('-')
      @compiler.compile(erb).first
    end

    def add_insert_cmd(out, content) # leftovers:keep
      out.push("\n#{content}\n")
    end

    def add_put_cmd(out, _content) # leftovers:keep
      out.push("\n")
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
leftovers-0.5.3 lib/leftovers/erb.rb
leftovers-0.5.2 lib/leftovers/erb.rb
leftovers-0.5.1 lib/leftovers/erb.rb