Sha256: 719635eca299e52197aefc4a5527e65c8b9354f685ff615868671989fd68ad37

Contents?: true

Size: 798 Bytes

Versions: 17

Compression:

Stored size: 798 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

17 entries across 17 versions & 2 rubygems

Version Path
locomotivecms_wagon-1.5.8 lib/locomotive/wagon/liquid/patches.rb
locomotivecms_wagon-1.5.7 lib/locomotive/wagon/liquid/patches.rb
locomotivecms_wagon-1.5.6 lib/locomotive/wagon/liquid/patches.rb
locomotivecms_wagon-1.5.5 lib/locomotive/wagon/liquid/patches.rb
locomotivecms_wagon-1.5.4 lib/locomotive/wagon/liquid/patches.rb
locomotivecms_wagon-1.5.3 lib/locomotive/wagon/liquid/patches.rb
locomotivecms_wagon-1.5.2 lib/locomotive/wagon/liquid/patches.rb
locomotivecms_wagon-1.5.1 lib/locomotive/wagon/liquid/patches.rb
locomotivecms_wagon-1.5.0 lib/locomotive/wagon/liquid/patches.rb
locomotivecms_wagon-1.5.0.rc1 lib/locomotive/wagon/liquid/patches.rb
locomotivecms_steam-0.1.1 lib/locomotive/steam/liquid/patches.rb
locomotivecms_steam-0.1.0 lib/locomotive/steam/liquid/patches.rb
locomotivecms_wagon-1.4.0 lib/locomotive/wagon/liquid/patches.rb
locomotivecms_wagon-1.3.3 lib/locomotive/wagon/liquid/patches.rb
locomotivecms_wagon-1.3.2 lib/locomotive/wagon/liquid/patches.rb
locomotivecms_wagon-1.3.1 lib/locomotive/wagon/liquid/patches.rb
locomotivecms_wagon-1.3.0 lib/locomotive/wagon/liquid/patches.rb