Sha256: 0100ce28feb0e73145bb22fb5aeccdb270270721dcbf1c74b04055b332f2855a
Contents?: true
Size: 646 Bytes
Versions: 12
Compression:
Stored size: 646 Bytes
Contents
require 'awestruct/handlers/base_handler' module Awestruct module Handlers class InterpolationHandler < BaseHandler def initialize(site, delegate) super( site, delegate ) end def rendered_content(context, with_layouts=true) content = delegate.raw_content return nil if content.nil? return content unless site.interpolate content = content.gsub( /\\/, '\\\\\\\\' ) content = content.gsub( /\\\\#/, '\\#' ) content = content.gsub( '@', '\@' ) content = "%@#{content}@" c = context.instance_eval( content ) c end end end end
Version data entries
12 entries across 12 versions & 1 rubygems