Merge branch 'master' of [email protected]:tobi/liquid

Conflicts:
	lib/liquid.rb
	lib/liquid/context.rb
	lib/liquid/variable.rb
	test/standard_tag_test.rb
This commit is contained in:
Tobias Lütke
2009-06-15 09:00:30 -04:00
66 changed files with 3812 additions and 404 deletions
+7 -11
View File
@@ -56,7 +56,7 @@ module Liquid
if strainer.respond_to?(method)
strainer.__send__(method, *args)
else
args.first
raise FilterNotFound, "Filter '#{method}' not found"
end
end
@@ -156,16 +156,12 @@ module Liquid
# fetches an object starting at the local scope and then moving up
# the hierachy
def find_variable(key)
@scopes.each do |scope|
if scope.has_key?(key)
variable = scope[key]
variable = scope[key] = variable.call(self) if variable.is_a?(Proc)
variable = variable.to_liquid
variable.context = self if variable.respond_to?(:context=)
return variable
end
end
nil
scope = @scopes[0..-2].find { |s| s.has_key?(key) } || @scopes.last
variable = scope[key]
variable = scope[key] = variable.call(self) if variable.is_a?(Proc)
variable = variable.to_liquid
variable.context = self if variable.respond_to?(:context=)
return variable
end
# resolves namespaced queries gracefully.