lib/musterb.rb in musterb-0.1.2 vs lib/musterb.rb in musterb-0.2.0
- old
+ new
@@ -17,10 +17,10 @@
autoload :TemplateHandler, "musterb/template_handler"
def self.to_erb(template, options = {})
klass = options[:musterbifier_klass] || Musterbifier
musterbifier = klass.new(template)
- initial_context = options[:initial_context] || 'Musterb::BindingExtractor.new binding'
+ initial_context = options[:initial_context] || 'Musterb::BindingExtractor.new(binding, Musterb::NullExtractor.new)'
"<% Musterb::Evaluator.new(#{initial_context}).tap do |musterb| %>#{musterbifier.to_erb}<% end %>"
end
def self.render(template, values)
Erubis::Eruby.new(to_erb template).result(values)