lib/ice.rb in ice-0.2.1 vs lib/ice.rb in ice-0.2.2
- old
+ new
@@ -5,16 +5,16 @@
def to_ice
nil
end
end
-[FalseClass, TrueClass, Numeric, String].each do |class_name|
- eval "class #{class_name}
+[FalseClass, TrueClass, Numeric, String].each do |cls|
+ cls.class_eval do
def to_ice
self
end
- end"
+ end
end
class Array
def to_ice
map &:to_ice
@@ -41,14 +41,11 @@
vars.each_pair do |key, value|
cxt[key] = value.to_ice
end
- cxt['____templateText'] = template_text
-
- @evaled = cxt.eval "Jst.evaluate(Jst.compile(____templateText), {});"
-
+ jst = cxt['Jst']
+ return @evaled = jst.evaluate(jst.compile(template_text), {})
end
- @evaled
end
end