Revert "Added backwards compatibility for 1.8.7 String.each returning itself (and 1.9.3 not supporting .each)."

This reverts commit 01dea94671.
This commit is contained in:
Kristian PD
2012-01-20 16:47:34 -05:00
parent 01dea94671
commit bce0033c65
3 changed files with 167 additions and 205 deletions
+1 -6
View File
@@ -75,8 +75,7 @@ module Liquid
collection = context[@collection_name]
collection = collection.to_a if collection.is_a?(Range)
# 1.8.7 compatibility
return render_else(context) unless collection.respond_to?(:each) or collection.is_a?(String)
return render_else(context) unless collection.respond_to?(:each)
from = if @attributes['offset'] == 'continue'
context.registers[:for][@name].to_i
@@ -124,10 +123,6 @@ module Liquid
segments = []
index = 0
yielded = 0
# 1.8.7 compatibility
return [collection] if collection.is_a?(String)
collection.each do |item|
if to && to <= index