Method: Padrino::Rendering::ClassMethods#cache_template_path
- Defined in:
- lib/padrino/rendering.rb
#cache_template_path(options) ⇒ Object
132 133 134 135 136 137 138 139 140 141 142 143 |
# File 'lib/padrino/rendering.rb', line 132 def cache_template_path() began_at = Time.now @_cached_templates ||= {} logging = defined?(settings) && settings.logging? && defined?(logger) if !reload_templates? && (path = @_cached_templates[]) logger.debug :cached, began_at, path[0] if logging else path = @_cached_templates[] = yield(name) logger.debug :template, began_at, path[0] if path && logging end path end |