Sha256: 4caf4c0fb38068b4d299c54470cdcb9a15eed5d59983c87334aaa46de0551aac

Contents?: true

Size: 327 Bytes

Versions: 2

Compression:

Stored size: 327 Bytes

Contents

require "cuba/rum"
require "haml"
require "tilt"

module Cuba
  class Ron < Rum
    def _cache
      Thread.current[:_cache] ||= Tilt::Cache.new
    end

    def haml(template, locals = {})
      _cache.fetch(template, locals) {
        Tilt::HamlTemplate.new("#{template}.haml")
      }.render(self, locals)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cuba-0.0.3 lib/cuba/ron.rb
cuba-0.0.2 lib/cuba/ron.rb