Sha256: ac74bd34eaff292792b39379ecd41b5bd2b892850739c751d9a395f620a092c3

Contents?: true

Size: 946 Bytes

Versions: 35

Compression:

Stored size: 946 Bytes

Contents

# ERb renderer
module Middleman
  module Renderers
    module ERb
      # Setup extension
      class << self

        # once registered
        def registered(app)
          # Setup a default ERb engine
          app.set :erb_engine, :erb
          app.set :erb_engine_prefix, ::Tilt

          app.before_configuration do
            template_extensions :erb => :html
          end

          # After config
          app.after_configuration do
            # Find the user's prefered engine
            # Convert symbols to classes
            if erb_engine.is_a? Symbol
              engine = engine.to_s
              engine = engine == "erb" ? "ERB" : engine.camelize
              erb_engine = erb_engine_prefix.const_get("#{engine}Template")
            end

            # Tell Tilt to use the preferred engine
            ::Tilt.prefer(erb_engine)
          end
        end
        alias :included :registered
      end
    end
  end
end

Version data entries

35 entries across 35 versions & 2 rubygems

Version Path
middleman-core-x86-mingw32-3.0.14 lib/middleman-core/renderers/erb.rb
middleman-core-3.0.14 lib/middleman-core/renderers/erb.rb
middleman-core-x86-mingw32-3.0.13 lib/middleman-core/renderers/erb.rb
middleman-core-3.0.13 lib/middleman-core/renderers/erb.rb
middleman-core-x86-mingw32-3.0.12 lib/middleman-core/renderers/erb.rb
middleman-core-3.0.12 lib/middleman-core/renderers/erb.rb
middleman-core-x86-mingw32-3.0.12.pre.1 lib/middleman-core/renderers/erb.rb
middleman-core-3.0.12.pre.1 lib/middleman-core/renderers/erb.rb
middleman-core-x86-mingw32-3.0.11 lib/middleman-core/renderers/erb.rb
middleman-core-3.0.11 lib/middleman-core/renderers/erb.rb
middleman-core-x86-mingw32-3.0.10 lib/middleman-core/renderers/erb.rb
middleman-core-x86-mingw32-3.0.10.pre.1 lib/middleman-core/renderers/erb.rb
middleman-core-3.0.10.pre.1 lib/middleman-core/renderers/erb.rb
middleman-core-x86-mingw32-3.0.9 lib/middleman-core/renderers/erb.rb
middleman-core-3.0.9 lib/middleman-core/renderers/erb.rb
middleman-core-x86-mingw32-3.0.8 lib/middleman-core/renderers/erb.rb
middleman-core-3.0.8 lib/middleman-core/renderers/erb.rb
middleman-core-x86-mingw32-3.0.8.pre.2 lib/middleman-core/renderers/erb.rb
middleman-core-3.0.8.pre.2 lib/middleman-core/renderers/erb.rb
middleman-core-x86-mingw32-3.0.8.pre.1 lib/middleman-core/renderers/erb.rb