Sha256: ae2f81f333ef485cf168393213d772df02f8b575bfc251c0eb64836a071c7447

Contents?: true

Size: 447 Bytes

Versions: 9

Compression:

Stored size: 447 Bytes

Contents

require 'tilt'

module HappyHelpers
  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

9 entries across 9 versions & 1 rubygems

Version Path
happy-helpers-0.1.0.pre9 lib/happy-helpers/templates.rb
happy-helpers-0.1.0.pre8 lib/happy-helpers/templates.rb
happy-helpers-0.1.0.pre7 lib/happy-helpers/templates.rb
happy-helpers-0.1.0.pre6 lib/happy-helpers/templates.rb
happy-helpers-0.1.0.pre.6 lib/happy-helpers/templates.rb
happy-helpers-0.1.0.pre.5 lib/happy-helpers/templates.rb
happy-helpers-0.1.0.pre.4 lib/happy-helpers/templates.rb
happy-helpers-0.1.0.pre.3 lib/happy-helpers/templates.rb
happy-helpers-0.1.0.pre.2 lib/happy-helpers/templates.rb