mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-26 13:45:13 -07:00
Clarified compatibility comments, removed unused var from tag test.
This commit is contained in:
@@ -75,7 +75,7 @@ module Liquid
|
|||||||
collection = context[@collection_name]
|
collection = context[@collection_name]
|
||||||
collection = collection.to_a if collection.is_a?(Range)
|
collection = collection.to_a if collection.is_a?(Range)
|
||||||
|
|
||||||
# 1.8.7 compatibility
|
# Maintains Ruby 1.8.7 String#each behaviour on 1.9
|
||||||
return render_else(context) unless collection.respond_to?(:each) or collection.is_a?(String)
|
return render_else(context) unless collection.respond_to?(:each) or collection.is_a?(String)
|
||||||
|
|
||||||
from = if @attributes['offset'] == 'continue'
|
from = if @attributes['offset'] == 'continue'
|
||||||
@@ -125,7 +125,7 @@ module Liquid
|
|||||||
index = 0
|
index = 0
|
||||||
yielded = 0
|
yielded = 0
|
||||||
|
|
||||||
# 1.8.7 compatibility
|
# Maintains Ruby 1.8.7 String#each behaviour on 1.9
|
||||||
return [collection] if collection.is_a?(String)
|
return [collection] if collection.is_a?(String)
|
||||||
|
|
||||||
collection.each do |item|
|
collection.each do |item|
|
||||||
|
|||||||
@@ -182,7 +182,6 @@ HERE
|
|||||||
'{%for val in string limit:1%}{{val}}{%endfor%}',
|
'{%for val in string limit:1%}{{val}}{%endfor%}',
|
||||||
'string' => "test string")
|
'string' => "test string")
|
||||||
|
|
||||||
fields = %w(name length index index0 rindex rindex0 first last)
|
|
||||||
assert_template_result('val-string-1-1-0-1-0-true-true-test string',
|
assert_template_result('val-string-1-1-0-1-0-true-true-test string',
|
||||||
'{%for val in string%}' +
|
'{%for val in string%}' +
|
||||||
'{{forloop.name}}-' +
|
'{{forloop.name}}-' +
|
||||||
|
|||||||
Reference in New Issue
Block a user