Module: Tennpipes::Rendering

Defined in:
lib/tennpipes/rendering.rb,
lib/tennpipes/rendering/erb_template.rb,
lib/tennpipes/rendering/haml_template.rb,
lib/tennpipes/rendering/slim_template.rb,
lib/tennpipes/rendering/erubis_template.rb

Overview

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

Defined Under Namespace

Modules: ClassMethods, InstanceMethods, SafeBufferEnhancer, SafeTemplate Classes: ERBTemplate, ErubisTemplate, HamlTemplate, SafeERB, SafeEruby, SlimTemplate, TemplateNotFound

Constant Summary collapse

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:

Examples:

Tennpipes::Rendering::IGNORE_FILE_PATTERN << /~$/
[
  /~$/ # This is for Gedit
]
DEFAULT_RENDERING_OPTIONS =

Default options used in the resolve_template-method.

{ :strict_format => false, :raise_exceptions => true }

Class Method Summary collapse

Class Method Details

.engine_configurationsHash<Symbol,Hash>

Default engine configurations for Tennpipes::Rendering.

Returns:

  • (Hash<Symbol,Hash>)

    The configurations, keyed by engine.



48
49
50
# File 'lib/tennpipes/rendering.rb', line 48

def engine_configurations
  @engine_configurations ||= {}
end

.included(base) ⇒ Object



63
64
65
66
# File 'lib/tennpipes/rendering.rb', line 63

def included(base)
  base.send(:include, InstanceMethods)
  base.extend(ClassMethods)
end

.registered(app) ⇒ Object



52
53
54
55
56
57
58
59
60
61
# File 'lib/tennpipes/rendering.rb', line 52

def registered(app)
  if defined?(Tennpipes::Application) && app == Tennpipes::Application
    # this fail can be removed later when jRuby is not bugged and MRI19 is dropped
    fail 'Please, do not use `register` on Tennpipes::Application object, use `.dup` or subclassing'
  end
  included(app)
  engine_configurations.each do |engine, configs|
    app.set engine, configs
  end
end