lib/rails-latex/erb_latex.rb in rails-latex-2.3.2 vs lib/rails-latex/erb_latex.rb in rails-latex-2.3.3

- old
+ new

@@ -4,15 +4,16 @@ require 'action_view' module ActionView # :nodoc: all module Template::Handlers class ERBLatex < ERB - def self.call(template) - new.compile(template) + def self.call(template, source = nil) + source ||= template.source + new.compile(template, source) end - def compile(template) - erb = "<% __in_erb_template=true %>#{template.source}" + def compile(template, source) + erb = "<% __in_erb_template=true %>#{source}" out=self.class.erb_implementation.new(erb, :trim=>(self.class.erb_trim_mode == "-")).src out + ";LatexToPdf.generate_pdf(@output_buffer.to_s, @latex_config||{})" end end end