Sha256: d29838ef9fa9e07bda1dc0fb9e200055fa706cef9dd178632589248b6cf37346

Contents?: true

Size: 879 Bytes

Versions: 14

Compression:

Stored size: 879 Bytes

Contents

require "tilt"
require "tilt/erubi"

require "serbea/helpers"
require "serbea/pipeline"
require "serbea/template_engine"

module Tilt
  class SerbeaTemplate < ErubiTemplate
    def prepare
      @options.merge!(
        outvar: "@_erbout",
        bufval: "Serbea::OutputBuffer.new", 
        literal_prefix: "{%",
        literal_postfix: "%}",
        engine_class: Serbea::TemplateEngine
      )
      super
    end

    def encoding
      @src.encoding
    end
  end
end

Tilt.register Tilt::SerbeaTemplate, "serb"

if defined?(Rails::Railtie)
  class Railtie < ::Rails::Railtie
    initializer :serbea do |app|
      ActiveSupport.on_load(:action_view) do
        require "serbea/rails_support"

        ActionController::Base.include Serbea::Rails::FrontmatterControllerActions
      end
    end
  end
end

if defined?(Bridgetown)
  require "serbea/bridgetown_support"
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
serbea-0.12 lib/serbea.rb
serbea-0.11.5 lib/serbea.rb
serbea-0.11.4 lib/serbea.rb
serbea-0.11.3 lib/serbea.rb
serbea-0.11.2 lib/serbea.rb
serbea-0.11.1 lib/serbea.rb
serbea-0.11 lib/serbea.rb
serbea-0.10.5 lib/serbea.rb
serbea-0.10.4 lib/serbea.rb
serbea-0.10.3 lib/serbea.rb
serbea-0.10.2 lib/serbea.rb
serbea-0.10.1 lib/serbea.rb
serbea-0.10.0 lib/serbea.rb
serbea-0.9.0 lib/serbea.rb