module Syro::Tilt::Cache

Add template and path caching to Syro::Tilt.

Public Class Methods

template_cache() click to toggle source

@return [MemoryStore]

# File lib/syro/tilt/cache.rb, line 28
def self.template_cache
  @template_cache
end
template_path_cache() click to toggle source

@return [MemoryStore]

# File lib/syro/tilt/cache.rb, line 33
def self.template_path_cache
  @template_path_cache
end

Public Instance Methods

template(path) click to toggle source

Cache calls to Syro::Tilt#template.

Calls superclass method
# File lib/syro/tilt/cache.rb, line 38
def template(path)
  Cache.template_cache.fetch(path) do
    super(path)
  end
end
template_path(path, from, accept) click to toggle source

Cache calls to Syro::Tilt#template_path.

Calls superclass method
# File lib/syro/tilt/cache.rb, line 45
def template_path(path, from, accept)
  Cache.template_path_cache.fetch(path, from, accept) do
    super(path, from, accept)
  end
end