Sha256: 03d7fcbad61bf516b23563322aed36a120a1b6e463ed7f6a19ea758eec39f81b

Contents?: true

Size: 434 Bytes

Versions: 1

Compression:

Stored size: 434 Bytes

Contents

require 'tilt'

module Niles
  module Templates
    def self.render(name, scope = nil, variables = {}, &block)
      load("views/%s" % name).render(scope, variables, &block)
    end

    def self.load(name)
      if false # Freddie.env.production?
        @templates ||= {}
        @templates[name] ||= Tilt.new(name, default_encoding: 'utf-8')
      else
        Tilt.new(name, default_encoding: 'utf-8')
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
niles-0.0.1 lib/niles/templates.rb