remove _ on private methods

This commit is contained in:
Tom Burns
2013-05-13 13:45:43 -04:00
parent 1e309ba74b
commit ba5a9f2e47
+4 -4
View File
@@ -24,7 +24,7 @@ module Liquid
end end
def render(context) def render(context)
partial = _load_cached_partial(context) partial = load_cached_partial(context)
variable = context[@variable_name || @template_name[1..-2]] variable = context[@variable_name || @template_name[1..-2]]
context.stack do context.stack do
@@ -45,21 +45,21 @@ module Liquid
end end
private private
def _load_cached_partial(context) def load_cached_partial(context)
cached_partials = context.registers[:cached_partials] || {} cached_partials = context.registers[:cached_partials] || {}
template_name = context[@template_name] template_name = context[@template_name]
if cached = cached_partials[template_name] if cached = cached_partials[template_name]
return cached return cached
end end
source = _read_template_from_file_system(context) source = read_template_from_file_system(context)
partial = Liquid::Template.parse(source) partial = Liquid::Template.parse(source)
cached_partials[template_name] = partial cached_partials[template_name] = partial
context.registers[:cached_partials] = cached_partials context.registers[:cached_partials] = cached_partials
partial partial
end end
def _read_template_from_file_system(context) def read_template_from_file_system(context)
file_system = context.registers[:file_system] || Liquid::Template.file_system file_system = context.registers[:file_system] || Liquid::Template.file_system
# make read_template_file call backwards-compatible. # make read_template_file call backwards-compatible.