module Padrino::Rendering

Padrino enhances the Sinatra ‘render’ method to have support for automatic template engine detection, enhanced layout functionality, locale enabled rendering, among other features.

Constants

DEFAULT_RENDERING_OPTIONS

Default options used in the resolve_template-method.

IGNORE_FILE_PATTERN

This is an array of file patterns to ignore. If your editor add a suffix during editing to your files please add it like:

@example

Padrino::Rendering::IGNORE_FILE_PATTERN << /~$/

Public Class Methods

engine_configurations() click to toggle source

Default engine configurations for Padrino::Rendering.

@return {Hash<Symbol,Hash>}

The configurations, keyed by engine.
# File lib/padrino/rendering.rb, line 48
def engine_configurations
  @engine_configurations ||= {}
end
included(base) click to toggle source
# File lib/padrino/rendering.rb, line 63
def included(base)
  base.send(:include, InstanceMethods)
  base.extend(ClassMethods)
end
registered(app) click to toggle source
# File lib/padrino/rendering.rb, line 52
def registered(app)
  if defined?(Padrino::Application) && app == Padrino::Application
    # this fail can be removed later when jRuby is not bugged and MRI19 is dropped
    fail 'Please, do not use `register` on Padrino::Application object, use `.dup` or subclassing'
  end
  included(app)
  engine_configurations.each do |engine, configs|
    app.set engine, configs
  end
end