<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,11 +1,20 @@
+v2.1.0
+
+  Merge in rails-2.2.2 branch, modify to make sure Prawn isn't trampled and
+  2.3.0 is supported.
+  Simplify tagging of templates for later processing (+ ensure it works
+  with compiled templates).
+  Update README_RAILS 
+
 v2.0.5
 
-  Fix issue with Echoe being ultra-sensitive on RubyGems versions (v2.0.4 was RubyGems 1.2 only,
-  and 1.3 just came out)
+  Fix issue with Echoe being ultra-sensitive on RubyGems versions (v2.0.4
+  was RubyGems 1.2 only, and 1.3 just came out)
   
 v2.0.4
 
-  Support for TeX escaping (via l()) calling to_s on the argument.  This should handle nils.
+  Support for TeX escaping (via l()) calling to_s on the argument.
+  This should handle nils.
 
 v2.0.3
 </diff>
      <filename>CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -26,15 +26,22 @@ Create files +pdf.rtex+ extensions (eg, +index.pdf.rtex+) using standard LaTeX m
 
 With the following:
 
+  # In config/initializers/mime_types.rb (or environment.rb in older Rails)
+  Mime::Type.register &quot;application/pdf&quot;, :pdf
+
   # app/controllers/items_controller.rb
   def index
     @items = Item.find(:all)
+    respond_to do |format|
+      format.html # We support the normal HTML view as well
+      format.pdf
+    end
   end
   
   # app/views/items/index.pdf.rtex
   \section*{Items}
   \begin{itemize}
-  &lt;%= render :partial =&gt; @items %&gt;
+    &lt;%= render :partial =&gt; @items %&gt;
   \end{itemize}
   
   # app/views/items/_item.pdf.rtex
@@ -43,7 +50,7 @@ With the following:
   # app/layouts/application.pdf.rtex
   \documentclass[12pt]{article}
   \begin{document}
-  &lt;%= yield %&gt;
+    &lt;%= yield %&gt;
   \end{document}
 
 If you hit +http://the.server.url/items.pdf+, you end up with a nice PDF listing of items.</diff>
      <filename>README_RAILS.rdoc</filename>
    </modified>
    <modified>
      <diff>@@ -7,30 +7,21 @@ module RTeX
       def self.setup
         RTeX::Document.options[:tempdir] = File.expand_path(File.join(RAILS_ROOT, 'tmp'))
         if ActionView::Base.respond_to?(:register_template_handler)
-          ActionView::Base.register_template_handler(:rtex, Template)
+          ActionView::Base.register_template_handler(:rtex, TemplateHandler)
         else
-          # Rails 2.1
-          ActionView::Template.register_template_handler(:rtex, Template)
+          ActionView::Template.register_template_handler(:rtex, TemplateHandler)
         end
         ActionController::Base.send(:include, ControllerMethods)
         ActionView::Base.send(:include, HelperMethods)
       end
       
-      class Template &lt; ::ActionView::TemplateHandlers::ERB
-        def initialize(*args)
-          super
-          # Support Rails render API before:
-          #   commit d2ccb852d4e1f6f1b01e43f32213053ae3bef408
-          #   Date:   Fri Jul 18 16:00:20 2008 -0500
-          if @view
-            @view.template_format = :pdf
-          end
-          # Tag for RTeX
-          # TODO: Move options into TemplateHandler from Controller
-          #       (need to handle send_file)
-          def @view.rendered_with_rtex
-            true
-          end
+      class TemplateHandler &lt; ::ActionView::TemplateHandlers::ERB
+        # Due to significant changes in ActionView over the lifespan of Rails,
+        # tagging compiled templates to set a thread local variable flag seems
+        # to be the least brittle approach.
+        def compile(template)
+          # Insert assignment, but not before the #coding: line, if present
+          super.sub(/^(?!#)/m, &quot;Thread.current[:_rendering_rtex] = true;\n&quot;)
         end
       end
       
@@ -41,7 +32,7 @@ module RTeX
         
         def render_with_rtex(options=nil, *args, &amp;block)
           result = render_without_rtex(options, *args, &amp;block)
-          if result.is_a?(String) &amp;&amp; @template.template_format.to_s == 'pdf'
+          if result.is_a?(String) &amp;&amp; Thread.current[:_rendering_rtex]
             options ||= {}
             ::RTeX::Document.new(result, options.merge(:processed =&gt; true)).to_pdf do |filename|
               serve_file = Tempfile.new('rtex-pdf')
@@ -54,13 +45,13 @@ module RTeX
                 :length =&gt; File.size(serve_file.path)
               serve_file.close
             end
-          else
-            result
           end
+          
         end
       end
       
       module HelperMethods
+        # Similar to h()
         def latex_escape(s)
           RTeX::Document.escape(s)
         end</diff>
      <filename>lib/rtex/framework/rails.rb</filename>
    </modified>
    <modified>
      <diff>@@ -64,8 +64,8 @@ module RTeX
     end
 
     MAJOR = 2
-    MINOR = 0
-    TINY  = 5
+    MINOR = 1
+    TINY  = 0
     
     # The current version as a Version instance
     CURRENT = new(MAJOR, MINOR, TINY)</diff>
      <filename>lib/rtex/version.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>3ec83f6402e3d474e7a723f86a6781f6c996d9ef</id>
    </parent>
  </parents>
  <author>
    <name>Bruce Williams</name>
    <email>bruce@codefluency.com</email>
  </author>
  <url>http://github.com/bruce/rtex/commit/28e42cbe0323f3ed96f3dc95a7c15b72181a9ced</url>
  <id>28e42cbe0323f3ed96f3dc95a7c15b72181a9ced</id>
  <committed-date>2009-02-26T13:29:28-08:00</committed-date>
  <authored-date>2009-02-26T13:29:28-08:00</authored-date>
  <message>Release v2.1.0.
Merge in rails-2.2.2 branch, modify to make sure Prawn isn't trampled and
2.3.0 is supported.
Simplify tagging of templates for later processing (+ ensure it works
with compiled templates).
Update README_RAILS</message>
  <tree>e96b1f5e751944a5f08721950a69fdd3f21c467c</tree>
  <committer>
    <name>Bruce Williams</name>
    <email>bruce@codefluency.com</email>
  </committer>
</commit>
