Sha256: 86bda6c1237a231416df50c90a821f2b8dbe530ce2069aed71fb36bc4a720d30

Contents?: true

Size: 961 Bytes

Versions: 21

Compression:

Stored size: 961 Bytes

Contents

# coding: utf-8

module UzuUzu
  #
  #
  #
  module Tilt
    #
    #
    #
    def self.render_engine(instance, view_string, engine='erb', options={}, locals={}, &block)
      template = ::Tilt[engine.to_s].new { |t| view_string.force_encoding('UTF-8') }
      contents = template.render(instance, locals, &block)
      unless options.blank?
        layout = options.delete(:layout)
        layout_string = options.delete(:layout_string)
        layout_engine = options.delete(:layout_engine) || engine
        unless layout.blank?
          if ::File.file?(layout)
            layout_string = ::File.respond_to?(:binread) ? ::File.binread(layout) : ::File.read(layout)
          end
        end
        unless layout_string.blank?
          locals[:@contents] = contents
          contents = self.render_engine(instance, layout_string, layout_engine, options, locals)
        end
      end
      contents
    end # self.render_engine
  end # Tilt
end # UzuUzu

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
uzuuzu-core-0.1.15 lib/uzuuzu-core/tilt.rb
uzuuzu-core-0.1.14 lib/uzuuzu-core/tilt.rb
uzuuzu-core-0.1.13 lib/uzuuzu-core/tilt.rb
uzuuzu-core-0.1.11 lib/uzuuzu-core/tilt.rb
uzuuzu-core-0.1.10 lib/uzuuzu-core/tilt.rb
uzuuzu-core-0.1.8 lib/uzuuzu-core/tilt.rb
uzuuzu-core-0.1.7 lib/uzuuzu-core/tilt.rb
uzuuzu-core-0.1.6 lib/uzuuzu-core/tilt.rb
uzuuzu-core-0.1.5 lib/uzuuzu-core/tilt.rb
uzuuzu-core-0.1.4 lib/uzuuzu-core/tilt.rb
uzuuzu-core-0.1.3 lib/uzuuzu-core/tilt.rb
uzuuzu-core-0.1.2.001 lib/uzuuzu-core/tilt.rb
uzuuzu-core-0.1.2 lib/uzuuzu-core/tilt.rb
uzuuzu-core-0.1.1 lib/uzuuzu-core/tilt.rb
uzuuzu-core-0.1.0 lib/uzuuzu-core/tilt.rb
uzuuzu-core-0.0.15 lib/uzuuzu/tilt.rb
uzuuzu-core-0.0.14 lib/uzuuzu/tilt.rb
uzuuzu-core-0.0.13 lib/uzuuzu/tilt.rb
uzuuzu-core-0.0.12 lib/uzuuzu/tilt.rb
uzuuzu-core-0.0.10 lib/uzuuzu/tilt.rb