Skip to content

Commit

Permalink
Enforce .rtex extension requirement [#6 state:open]
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruce Williams committed Sep 20, 2008
1 parent 07278e3 commit 2d2890a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/rtex/framework/rails.rb
Expand Up @@ -25,6 +25,9 @@ def initialize(*args)
if defined?(@view)
@view.template_format = :pdf
end
def @view.rendered_with_rtex
true
end
end
end

Expand All @@ -35,7 +38,7 @@ def self.included(base)

def render_with_rtex(options=nil, *args, &block)
result = render_without_rtex(options, *args, &block)
if result.is_a?(String) && @template.template_format == :pdf
if result.is_a?(String) && @template.respond_to?(:rendered_with_rtex)
options ||= {}
::RTeX::Document.new(result, options.merge(:processed => true)).to_pdf do |filename|
serve_file = Tempfile.new('rtex-pdf')
Expand Down

0 comments on commit 2d2890a

Please sign in to comment.