Sha256: cc0cdcc0a4a7abd689b58155dc0aa66e5fc5cfb790bce93db733034372224bcd
Contents?: true
Size: 624 Bytes
Versions: 2
Compression:
Stored size: 624 Bytes
Contents
require 'erb' module Tadpole module SectionProviders class ERBProvider < SectionProvider EXTENSIONS = ['.erb'] def initialize(full_path, owner) super erb = ERB.new(content, nil, '<>') instance_eval(<<-eof, full_path, -4) def render(locals = nil, &block) if locals opts = owner.options owner.options = owner.options.to_hash.update(locals) end out = owner.instance_eval #{erb.src.inspect} owner.options = opts if locals out end eof end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
tadpole-0.1.1 | lib/tadpole/providers/erb.rb |
tadpole-0.1.0 | lib/tadpole/providers/erb.rb |