Sha256: 2670250d88472570e7b36aa4a53839267fa68bc52979f1d19acd622d8f01393c
Contents?: true
Size: 797 Bytes
Versions: 15
Compression:
Stored size: 797 Bytes
Contents
module Liquid class Drop def mounting_point @context.registers[:mounting_point] end def site @context.registers[:site] end end class Template # creates a new <tt>Template</tt> object from liquid source code def parse_with_utf8(source, context = {}) if RUBY_VERSION =~ /1\.9/ source = source.force_encoding('UTF-8') if source.present? end self.parse_without_utf8(source, context) end alias_method_chain :parse, :utf8 end module StandardFilters private def to_number(obj) case obj when Numeric obj when String (obj.strip =~ /^\d+\.\d+$/) ? obj.to_f : obj.to_i when DateTime, Date, Time obj.to_time.to_i else 0 end end end end
Version data entries
15 entries across 15 versions & 2 rubygems