Sha256: e7e156ca8612766453dc8c4e827a52df21f199a4afde7a19d32a379f3a7e0a57

Contents?: true

Size: 471 Bytes

Versions: 2

Compression:

Stored size: 471 Bytes

Contents

require 'tilt'

module HappyHelpers
  module Templates
    def self.render(name, scope = nil, variables = {}, &block)
      load(name).render(scope, variables, &block)
    end

    def self.load(name)
      name = File.expand_path(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

2 entries across 2 versions & 1 rubygems

Version Path
happy-helpers-0.1.0.pre11 lib/happy-helpers/templates.rb
happy-helpers-0.1.0.pre10 lib/happy-helpers/templates.rb