<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/comatose/comatose_drop.rb</filename>
    </added>
    <added>
      <filename>lib/comatose_admin_controller.rb</filename>
    </added>
    <added>
      <filename>lib/comatose_admin_helper.rb</filename>
    </added>
    <added>
      <filename>lib/comatose_controller.rb</filename>
    </added>
    <added>
      <filename>lib/comatose_helper.rb</filename>
    </added>
    <added>
      <filename>lib/comatose_page.rb</filename>
    </added>
    <added>
      <filename>views/comatose_admin/_form.html.erb</filename>
    </added>
    <added>
      <filename>views/comatose_admin/_page_list_item.html.erb</filename>
    </added>
    <added>
      <filename>views/comatose_admin/delete.html.erb</filename>
    </added>
    <added>
      <filename>views/comatose_admin/edit.html.erb</filename>
    </added>
    <added>
      <filename>views/comatose_admin/index.html.erb</filename>
    </added>
    <added>
      <filename>views/comatose_admin/new.html.erb</filename>
    </added>
    <added>
      <filename>views/comatose_admin/reorder.html.erb</filename>
    </added>
    <added>
      <filename>views/comatose_admin/versions.html.erb</filename>
    </added>
    <added>
      <filename>views/layouts/comatose_admin.html.erb</filename>
    </added>
    <added>
      <filename>views/layouts/comatose_admin_customize.html.erb</filename>
    </added>
    <added>
      <filename>views/layouts/comatose_content.html.erb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,10 @@
+- version: 2.0 (alpha)
+    - Removed controllers, models, and helpers from Comatose module. It was causing odd issues
+    - Initial support for Rails 2.1(ish)
+    - Fixed up slug generation to remove leading and trailing whitespace
+    - Moved to github
+    - Changed all the .rhtml files to .html.erb
+    
 - version: 0.8.1
   changes:
     - All includes and helpers are loaded at the end of the ComatoseController and ComatoseAdminController classes</diff>
      <filename>CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -9,7 +9,7 @@ From here you'll want to run:
 
 When that's finished, run:
 
-  $ rake migrate
+  $ rake db:migrate
 
 That's it for the Comatose setup! Now just add the following line to the bottom of your config/routes.rb file:
 </diff>
      <filename>INSTALL</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,9 @@
 = Comatose
 
-Version:: 0.8
+Version:: 2.0 (uber-alpha)
 Author::  M@ McCray
-Website:: www.mattmccray.com
-Email::   darthapo at gmail dot com
+Website:: comatose.rubyforge.org
+Email::   matt at elucidata dot net
 
 
 *Comatose* is a micro CMS designed for being embedded into existing Rails 
@@ -24,6 +24,23 @@ looking into Radiant.
 
 For more information, see the 'Getting Started' guide: http://comatose.rubyforge.org
 
+=== Requirements
+
+ * Rails 2+ (2.1)
+ * &lt;tt&gt;acts_as_list&lt;/tt&gt; and &lt;tt&gt;acts_as_tree&lt;/tt&gt; plugins are required
+
+
+=== Development Notes
+
+*NOTE*: This is an active branch of Comatose that is built specifically for Rails 2.1.
+        I will *probably* remove any legacy support.
+
+ * Make comatose fully self-contained, which means removing acts_as_(tree|list)
+ * Move to gem plugin
+ * Comatose.configure needs to be an initializer (update docs)
+ * Go through bugs on 1x branch from google code and ensure they are fixed
+ * Give access to all the default rails helpers to Comatose Pages by default?
+
 
 == Installation
 
@@ -49,6 +66,9 @@ routing doesn't match any of your controllers.
 
 == Upgrading
 
+*NOTE*: This is an experimental 2.0 branch, so upgrading is possible at
+        the moment, but these instructions may not work for much longer.
+
 If you are upgrading from an older version of Comatose (version 0.3, 
 0.4, 0.5, or 0.6), then you will need to re-install the comatose 
 plugin and run:</diff>
      <filename>README.rdoc</filename>
    </modified>
    <modified>
      <diff>@@ -11,8 +11,11 @@ Comatose Admin Controller should:
  - not update pages with invalid data
  - delete a page
  - reorder pages
+ - set runtime mode
+
 Comatose Controller should:
  - show pages based on path_info
+
 Class Options should:
  - allow nil as a default
  - allow boolean defaults
@@ -21,6 +24,7 @@ Class Options should:
  - allow symbolic defaults
  - allow array literals as defaults
  - allow hash literals as defaults
+
 Comatose Page should:
  - create page
  - create a new version of an updated page
@@ -30,9 +34,11 @@ Comatose Page should:
  - generate slugs correctly
  - generate page paths correctly
  - update page paths when pages are moved
+ - set an AR error with processor syntax error info
  - render body text accurately
  - render data from parameterized calls too
  - render data from a Drop
+
 Processing Context should:
  - process liquid tags with no filters correctly
  - process erb tags correctly
@@ -44,6 +50,7 @@ Processing Context should:
  - prevent access to protected properties and methods when processing with Liquid
  - allow referenceing of defined ComatoseDrops
  - let ComatoseDrop errors bubble upward
+
 Text Filters should:
  - not alter output when using filter :none
  - convert newlines into &lt;br/&gt;s when using :simple filter</diff>
      <filename>SPECS</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 author: Matt McCray
 summary: A micro CMS for embedding in Rails applications.
-homepage: http://mattmccray.com
-plugin: http://mattmccray.com/svn/rails/plugins/comatose
+homepage: http://comatose.rubyforge.org
+plugin: git://github.com/darthapo/comatose.git
 license: MIT
-version: 0.8.1
-rails_version: 1.2+
+version: 2.0
+rails_version: 2+</diff>
      <filename>about.yml</filename>
    </modified>
    <modified>
      <diff>@@ -1,35 +1,34 @@
-module Comatose
-  class Page &lt; ActiveRecord::Base
-    set_table_name 'comatose_pages'
-    acts_as_versioned :if_changed =&gt; [:title, :slug, :keywords, :body]
-  end
+class ComatosePage &lt; ActiveRecord::Base
+  set_table_name 'comatose_pages'
+  acts_as_versioned :table_name=&gt;'comatose_page_versions', :if_changed =&gt; [:title, :slug, :keywords, :body]
 end
 
+
 class &lt;%= class_name %&gt; &lt; ActiveRecord::Migration
 
   # Schema for Comatose version 0.7+
   def self.up
     create_table :comatose_pages do |t|
-      t.column &quot;parent_id&quot;,   :integer
-      t.column &quot;full_path&quot;,   :text,   :default =&gt; ''
-      t.column &quot;title&quot;,       :string, :limit =&gt; 255
-      t.column &quot;slug&quot;,        :string, :limit =&gt; 255
-      t.column &quot;keywords&quot;,    :string, :limit =&gt; 255
-      t.column &quot;body&quot;,        :text
-      t.column &quot;filter_type&quot;, :string, :limit =&gt; 25, :default =&gt; &quot;Textile&quot;
-      t.column &quot;author&quot;,      :string, :limit =&gt; 255
-      t.column &quot;position&quot;,    :integer, :default =&gt; 0
-      t.column &quot;version&quot;,     :integer
-      t.column &quot;updated_on&quot;,  :datetime
-      t.column &quot;created_on&quot;,  :datetime
+      t.integer   &quot;parent_id&quot;
+      t.text      &quot;full_path&quot;,   :default =&gt; ''
+      t.string    &quot;title&quot;,       :limit =&gt; 255
+      t.string    &quot;slug&quot;,        :limit =&gt; 255
+      t.string    &quot;keywords&quot;,    :limit =&gt; 255
+      t.text      &quot;body&quot;
+      t.string    &quot;filter_type&quot;, :limit =&gt; 25, :default =&gt; &quot;Textile&quot;
+      t.string    &quot;author&quot;,      :limit =&gt; 255
+      t.integer   &quot;position&quot;,    :default =&gt; 0
+      t.integer   &quot;version&quot;
+      t.datetime  &quot;updated_on&quot;
+      t.datetime  &quot;created_on&quot;
     end
-    Comatose::Page.create_versioned_table
+    ComatosePage.create_versioned_table
     puts &quot;Creating the default 'Home Page'...&quot;
-    Comatose::Page.create( :title=&gt;'Home Page', :body=&gt;&quot;h1. Welcome\n\nYour content goes here...&quot;, :author=&gt;'System' )
+    ComatosePage.create( :title=&gt;'Home Page', :body=&gt;&quot;h1. Welcome\n\nYour content goes here...&quot;, :author=&gt;'System' )
   end
 
   def self.down
-    Comatose::Page.drop_versioned_table
+    ComatosePage.drop_versioned_table
     drop_table :comatose_pages
   end
 </diff>
      <filename>generators/comatose_migration/templates/migration.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,6 +6,7 @@ require 'liquid' unless defined?(Liquid)
 require 'comatose'
 require 'text_filters'
 
+require 'support/inline_rendering'
 require 'support/route_mapper'
 
 # if defined? ActionController::Routing::RouteSet::Mapper</diff>
      <filename>init.rb</filename>
    </modified>
    <modified>
      <diff>@@ -19,10 +19,12 @@
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
+# Updated with: http://github.com/codafoo/acts_as_versioned/tree/master/lib
+
 module ActiveRecord #:nodoc:
   module Acts #:nodoc:
     # Specify this act if you want to save a copy of the row in a versioned table.  This assumes there is a 
-    # versioned table ready and that your model has a version field.  This works with optimisic locking if the lock_version
+    # versioned table ready and that your model has a version field.  This works with optimistic locking if the lock_version
     # column is present as well.
     #
     # The class for the versioned model is derived the first time it is seen. Therefore, if you change your database schema you have to restart
@@ -49,9 +51,24 @@ module ActiveRecord #:nodoc:
     #   page.revert_to(page.versions.last) # using versioned instance
     #   page.title         # =&gt; 'hello world'
     #
+    #   page.versions.earliest # efficient query to find the first version
+    #   page.versions.latest   # efficient query to find the most recently created version
+    #
+    #
+    # Simple Queries to page between versions
+    #
+    #   page.versions.before(version) 
+    #   page.versions.after(version)
+    #
+    # Access the previous/next versions from the versioned model itself
+    #
+    #   version = page.versions.latest
+    #   version.previous # go back one version
+    #   version.next     # go forward one version
+    #
     # See ActiveRecord::Acts::Versioned::ClassMethods#acts_as_versioned for configuration options
     module Versioned
-      CALLBACKS = [:set_new_version, :save_version_on_create, :save_version, :clear_changed_attributes]
+      CALLBACKS = [:set_new_version, :save_version_on_create, :save_version?]
       def self.included(base) # :nodoc:
         base.extend ClassMethods
       end
@@ -80,7 +97,7 @@ module ActiveRecord #:nodoc:
         #     end
         #
         # * &lt;tt&gt;if_changed&lt;/tt&gt; - Simple way of specifying attributes that are required to be changed before saving a model.  This takes
-        #   either a symbol or array of symbols.  WARNING - This will attempt to overwrite any attribute setters you may have.  
+        #   either a symbol or array of symbols.  WARNING - This will attempt to overwrite any attribute setters you may have.
         #   Use this instead if you want to write your own attribute setters (and ignore if_changed):
         # 
         #     def name=(new_name)
@@ -133,7 +150,7 @@ module ActiveRecord #:nodoc:
         #       # that create_table does
         #       Post.create_versioned_table
         #     end
-        #   
+        # 
         #     def self.down
         #       Post.drop_versioned_table
         #     end
@@ -157,10 +174,11 @@ module ActiveRecord #:nodoc:
           return if self.included_modules.include?(ActiveRecord::Acts::Versioned::ActMethods)
 
           send :include, ActiveRecord::Acts::Versioned::ActMethods
-          
+
           cattr_accessor :versioned_class_name, :versioned_foreign_key, :versioned_table_name, :versioned_inheritance_column, 
-            :version_column, :max_version_limit, :track_changed_attributes, :version_condition, :version_sequence_name, :non_versioned_columns
-            
+            :version_column, :max_version_limit, :track_changed_attributes, :version_condition, :version_sequence_name, :non_versioned_columns,
+            :version_association_options, :tracked_attributes
+
           # legacy
           alias_method :non_versioned_fields,  :non_versioned_columns
           alias_method :non_versioned_fields=, :non_versioned_columns=
@@ -170,8 +188,6 @@ module ActiveRecord #:nodoc:
             alias_method :non_versioned_fields=, :non_versioned_columns=
           end
 
-          send :attr_accessor, :changed_attributes
-
           self.versioned_class_name         = options[:class_name]  || &quot;Version&quot;
           self.versioned_foreign_key        = options[:foreign_key] || self.to_s.foreign_key
           self.versioned_table_name         = options[:table_name]  || &quot;#{table_name_prefix}#{base_class.name.demodulize.underscore}_versions#{table_name_suffix}&quot;
@@ -181,45 +197,79 @@ module ActiveRecord #:nodoc:
           self.max_version_limit            = options[:limit].to_i
           self.version_condition            = options[:if] || true
           self.non_versioned_columns        = [self.primary_key, inheritance_column, 'version', 'lock_version', versioned_inheritance_column]
+          self.version_association_options  = {
+                                                :class_name  =&gt; &quot;#{self.to_s}::#{versioned_class_name}&quot;,
+                                                :foreign_key =&gt; versioned_foreign_key,
+                                                :order       =&gt; 'version',
+                                                :dependent   =&gt; :delete_all
+                                              }.merge(options[:association_options] || {})
 
           if block_given?
             extension_module_name = &quot;#{versioned_class_name}Extension&quot;
             silence_warnings do
               self.const_set(extension_module_name, Module.new(&amp;extension))
             end
-            
+
             options[:extend] = self.const_get(extension_module_name)
           end
 
           class_eval do
-            has_many :versions, 
-              :class_name  =&gt; &quot;#{self.to_s}::#{versioned_class_name}&quot;,
-              :foreign_key =&gt; &quot;#{versioned_foreign_key}&quot;,
-              :order       =&gt; 'version', :dependent =&gt; :delete_all
+            has_many :versions, version_association_options do
+              # finds earliest version of this record
+              def earliest
+                @earliest ||= find(:first)
+              end
+
+              # find latest version of this record
+              def latest
+                @latest ||= find(:first, :order =&gt; 'version desc')
+              end
+            end
             before_save  :set_new_version
             after_create :save_version_on_create
             after_update :save_version
             after_save   :clear_old_versions
-            after_save   :clear_changed_attributes
-            
+
             unless options[:if_changed].nil?
               self.track_changed_attributes = true
               options[:if_changed] = [options[:if_changed]] unless options[:if_changed].is_a?(Array)
-              options[:if_changed].each do |attr_name|
-                define_method(&quot;#{attr_name}=&quot;) do |value|
-                  write_changed_attribute attr_name, value
-                end
-              end
+              #convert to string because that is what dirty objects use for the return array in changed
+              self.tracked_attributes = options[:if_changed].map {|x| x.to_s}
             end
-            
+
             include options[:extend] if options[:extend].is_a?(Module)
           end
 
           # create the dynamic versioned model
           const_set(versioned_class_name, Class.new(ActiveRecord::Base)).class_eval do
             def self.reloadable? ; false ; end
+            # find first version before the given version
+            def self.before(version)
+              find :first, :order =&gt; 'version desc',
+                :conditions =&gt; [&quot;#{original_class.versioned_foreign_key} = ? and version &lt; ?&quot;, version.send(original_class.versioned_foreign_key), version.version]
+            end
+
+            # find first version after the given version.
+            def self.after(version)
+              find :first, :order =&gt; 'version',
+                :conditions =&gt; [&quot;#{original_class.versioned_foreign_key} = ? and version &gt; ?&quot;, version.send(original_class.versioned_foreign_key), version.version]
+            end
+
+            def previous
+              self.class.before(self)
+            end
+
+            def next
+              self.class.after(self)
+            end
+
+            def versions_count
+              page.version
+            end
           end
-          
+
+          versioned_class.cattr_accessor :original_class
+          versioned_class.original_class = self
           versioned_class.set_table_name versioned_table_name
           versioned_class.belongs_to self.to_s.demodulize.underscore.to_sym, 
             :class_name  =&gt; &quot;::#{self.to_s}&quot;, 
@@ -228,17 +278,22 @@ module ActiveRecord #:nodoc:
           versioned_class.set_sequence_name version_sequence_name if version_sequence_name
         end
       end
-    
+
       module ActMethods
         def self.included(base) # :nodoc:
           base.extend ClassMethods
         end
-        
+
+        # Finds a specific version of this record
+        def find_version(version = nil)
+          self.class.find_version(id, version)
+        end
+
         # Saves a version of the model if applicable
         def save_version
           save_version_on_create if save_version?
         end
-        
+
         # Saves a version of the model in the versioned table.  This is called in the after_save callback by default
         def save_version_on_create
           rev = self.class.versioned_class.new
@@ -259,16 +314,8 @@ module ActiveRecord #:nodoc:
           end
         end
 
-        # Finds a specific version of this model.
-        def find_version(version)
-          return version if version.is_a?(self.class.versioned_class)
-          return nil if version.is_a?(ActiveRecord::Base)
-          find_versions(:conditions =&gt; ['version = ?', version], :limit =&gt; 1).first
-        end
-        
-        # Finds versions of this model.  Takes an options hash like &lt;tt&gt;find&lt;/tt&gt;
-        def find_versions(options = {})
-          versions.find(:all, options)
+        def versions_count
+          version
         end
 
         # Reverts a model to a given version.  Takes either a version number or an instance of the versioned model
@@ -276,14 +323,14 @@ module ActiveRecord #:nodoc:
           if version.is_a?(self.class.versioned_class)
             return false unless version.send(self.class.versioned_foreign_key) == self.id and !version.new_record?
           else
-            return false unless version = find_version(version)
+            return false unless version = versions.find_by_version(version)
           end
           self.clone_versioned_model(version, self)
           self.send(&quot;#{self.class.version_column}=&quot;, version.version)
           true
         end
 
-        # Reverts a model to a given version and saves the model.  
+        # Reverts a model to a given version and saves the model.
         # Takes either a version number or an instance of the versioned model
         def revert_to!(version)
           revert_to(version) ? save_without_revision : false
@@ -309,36 +356,30 @@ module ActiveRecord #:nodoc:
         def versioned_attributes
           self.attributes.keys.select { |k| !self.class.non_versioned_columns.include?(k) }
         end
-        
-        # If called with no parameters, gets whether the current model has changed and needs to be versioned.
-        # If called with a single parameter, gets whether the parameter has changed.
-        def changed?(attr_name = nil)
-          attr_name.nil? ?
-            (!self.class.track_changed_attributes || (changed_attributes &amp;&amp; changed_attributes.length &gt; 0)) :
-            (changed_attributes &amp;&amp; changed_attributes.include?(attr_name.to_s))
+
+        # If called with no parameters, gets whether the current model has changed and needs to be versioned.        
+        def should_version?
+          (!self.class.track_changed_attributes || (tracked_attributes &amp; self.changed).length &gt; 0 )
         end
-        
-        # keep old dirty? method
-        alias_method :dirty?, :changed?
-        
+
         # Clones a model.  Used when saving a new version or reverting a model's version.
         def clone_versioned_model(orig_model, new_model)
           self.versioned_attributes.each do |key|
-            new_model.send(&quot;#{key}=&quot;, orig_model.attributes[key]) if orig_model.has_attribute?(key)
+            new_model.send(&quot;#{key}=&quot;, orig_model.send(key)) if orig_model.has_attribute?(key)
           end
-          
+
           if orig_model.is_a?(self.class.versioned_class)
             new_model[new_model.class.inheritance_column] = orig_model[self.class.versioned_inheritance_column]
           elsif new_model.is_a?(self.class.versioned_class)
             new_model[self.class.versioned_inheritance_column] = orig_model[orig_model.class.inheritance_column]
           end
         end
-        
+
         # Checks whether a new version shall be saved or not.  Calls &lt;tt&gt;version_condition_met?&lt;/tt&gt; and &lt;tt&gt;changed?&lt;/tt&gt;.
         def save_version?
-          version_condition_met? &amp;&amp; changed?
+          version_condition_met? &amp;&amp; should_version?
         end
-        
+
         # Checks condition set in the :if option to check whether a revision should be created or not.  Override this for
         # custom version condition checking.
         def version_condition_met?
@@ -349,7 +390,7 @@ module ActiveRecord #:nodoc:
             version_condition.call(self)
           else
             version_condition
-          end          
+          end
         end
 
         # Executes the block with the versioning callbacks disabled.
@@ -372,43 +413,35 @@ module ActiveRecord #:nodoc:
           self.class.without_locking(&amp;block)
         end
 
-        protected          
+        def empty_callback() end #:nodoc:
+
+        protected
           # sets the new version before saving, unless you're using optimistic locking.  In that case, let it take care of the version.
           def set_new_version
             self.send(&quot;#{self.class.version_column}=&quot;, self.next_version) if new_record? || (!locking_enabled? &amp;&amp; save_version?)
           end
-          
+
           # Gets the next available version for the current record, or 1 for a new record
           def next_version
             return 1 if new_record?
             (versions.calculate(:max, :version) || 0) + 1
           end
           
-          # clears current changed attributes.  Called after save.
-          def clear_changed_attributes
-            self.changed_attributes = []
-          end
-          
-          def write_changed_attribute(attr_name, attr_value)
-            (self.changed_attributes ||= []) &lt;&lt; attr_name.to_s unless self.changed?(attr_name) or self.send(attr_name) == attr_value
-            write_attribute(attr_name.to_s, attr_value)
-          end
-
-        private
-          CALLBACKS.each do |attr_name| 
-            alias_method &quot;orig_#{attr_name}&quot;.to_sym, attr_name
-          end
-          
-          def empty_callback() end #:nodoc:
-
         module ClassMethods
           # Finds a specific version of a specific row of this model
-          def find_version(id, version)
-            find_versions(id, 
-              :conditions =&gt; [&quot;#{versioned_foreign_key} = ? AND version = ?&quot;, id, version], 
-              :limit =&gt; 1).first
+          def find_version(id, version = nil)
+            return find(id) unless version
+
+            conditions = [&quot;#{versioned_foreign_key} = ? AND version = ?&quot;, id, version]
+            options = { :conditions =&gt; conditions, :limit =&gt; 1 }
+
+            if result = find_versions(id, options).first
+              result
+            else
+              raise RecordNotFound, &quot;Couldn't find #{name} with ID=#{id} and VERSION=#{version}&quot;
+            end
           end
-        
+
           # Finds versions of a specific model.  Takes an options hash like &lt;tt&gt;find&lt;/tt&gt;
           def find_versions(id, options = {})
             versioned_class.find :all, {
@@ -420,7 +453,7 @@ module ActiveRecord #:nodoc:
           def versioned_columns
             self.columns.select { |c| !non_versioned_columns.include?(c.name) }
           end
-    
+
           # Returns an instance of the dynamic versioned model
           def versioned_class
             const_get versioned_class_name
@@ -432,36 +465,40 @@ module ActiveRecord #:nodoc:
             if !self.content_columns.find { |c| %w(version lock_version).include? c.name }
               self.connection.add_column table_name, :version, :integer
             end
-            
+
             self.connection.create_table(versioned_table_name, create_table_options) do |t|
               t.column versioned_foreign_key, :integer
               t.column :version, :integer
             end
-            
+
             updated_col = nil
             self.versioned_columns.each do |col| 
               updated_col = col if !updated_col &amp;&amp; %(updated_at updated_on).include?(col.name)
               self.connection.add_column versioned_table_name, col.name, col.type, 
                 :limit =&gt; col.limit, 
-                :default =&gt; col.default
+                :default =&gt; col.default,
+                :scale =&gt; col.scale,
+                :precision =&gt; col.precision
             end
-        
+
             if type_col = self.columns_hash[inheritance_column]
               self.connection.add_column versioned_table_name, versioned_inheritance_column, type_col.type, 
                 :limit =&gt; type_col.limit, 
-                :default =&gt; type_col.default
+                :default =&gt; type_col.default,
+                :scale =&gt; type_col.scale,
+                :precision =&gt; type_col.precision
             end
-    
+
             if updated_col.nil?
               self.connection.add_column versioned_table_name, :updated_at, :timestamp
             end
           end
-          
+
           # Rake migration task to drop the versioned table
           def drop_versioned_table
             self.connection.drop_table versioned_table_name
           end
-          
+
           # Executes the block with the versioning callbacks disabled.
           #
           #   Foo.without_revision do
@@ -470,17 +507,18 @@ module ActiveRecord #:nodoc:
           #
           def without_revision(&amp;block)
             class_eval do 
-              CALLBACKS.each do |attr_name| 
+              CALLBACKS.each do |attr_name|
+                alias_method &quot;orig_#{attr_name}&quot;.to_sym, attr_name
                 alias_method attr_name, :empty_callback
               end
             end
-            result = block.call
+            block.call
+          ensure
             class_eval do 
               CALLBACKS.each do |attr_name|
                 alias_method attr_name, &quot;orig_#{attr_name}&quot;.to_sym
               end
             end
-            result
           end
 
           # Turns off optimistic locking for the duration of the block
@@ -495,7 +533,7 @@ module ActiveRecord #:nodoc:
             result = block.call
             ActiveRecord::Base.lock_optimistically = true if current
             result
-          end          
+          end
         end
       end
     end</diff>
      <filename>lib/acts_as_versioned.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 
 module Comatose
 
-  VERSION = &quot;0.8&quot;
+  VERSION = &quot;2.0 (uber-alpha)&quot;
 
   # DEPRECATED
   # Loads extensions from RAILS_ROOT/lib/comatose/*.rb
@@ -14,26 +14,30 @@ module Comatose
 end
 
 require 'comatose/configuration'
-require 'comatose/drops'
+require 'comatose/comatose_drop'
+require 'comatose/processing_context'
+require 'comatose/page_wrapper'
 
 require 'dispatcher' unless defined?(::Dispatcher)
 ::Dispatcher.to_prepare :comatose do
-    base = File.dirname(__FILE__)
-    # Load these on every request (in dev mode)
-    load &quot;#{base}/comatose/page.rb&quot;
-    load &quot;#{base}/comatose/admin_controller.rb&quot;
-    load &quot;#{base}/comatose/admin_helper.rb&quot;
-    load &quot;#{base}/comatose/controller.rb&quot;
+    # base = File.dirname(__FILE__)
+    # load &quot;#{base}/comatose_page.rb&quot;
+    # load &quot;#{base}/comatose_admin_controller.rb&quot;
+    # load &quot;#{base}/comatose_admin_helper.rb&quot;
+    # load &quot;#{base}/comatose_controller.rb&quot;
+    # load &quot;#{base}/comatose_helper.rb&quot;
+
+    # Are these just 'found' now?
+    # require &quot;comatose_page&quot;
+    # require &quot;comatose_admin_controller&quot;
+    # require &quot;comatose_admin_helper&quot;
+    # require &quot;comatose_controller&quot;
+    # require &quot;comatose_helper&quot;
+
     # These will only be loaded once (in any mode)
-    require 'support/inline_rendering'
-    require 'comatose/processing_context'
-    require 'comatose/page_wrapper'
+    # require 'support/inline_rendering'
+    # require 'comatose_processing_context'
+    # require 'comatose_page_wrapper'
     # Define the base classes
-    class ComatoseAdminController &lt; Comatose::AdminController
-      unloadable
-    end
-    class ComatoseController &lt; Comatose::Controller
-      unloadable
-    end
     Comatose.config.after_setup.call
 end</diff>
      <filename>lib/comatose.rb</filename>
    </modified>
    <modified>
      <diff>@@ -37,7 +37,7 @@ module Comatose
     attr_accessor_with_default :helpers,              []
     attr_accessor_with_default :includes,             []
 
-    # A 'blockable' setters
+    # 'Blockable' setters
     blockable_attr_accessor    :authorization
     blockable_attr_accessor    :admin_authorization
     blockable_attr_accessor    :admin_get_author
@@ -49,15 +49,15 @@ module Comatose
       @authorization       = Proc.new { true }
       @admin_authorization = Proc.new { true }
       @admin_get_author    = Proc.new { request.env['REMOTE_ADDR'] }
-      @admin_get_root_page = Proc.new { Comatose::Page.root }
+      @admin_get_root_page = Proc.new { ComatosePage.root }
       @after_setup         = Proc.new { true }
     end
     
     def validate!
       # Rips through the config and validates it's, er, valid
       raise ConfigurationError.new &quot;admin_get_author must be a Proc or Symbol&quot; unless @admin_get_author.is_a? Proc or @admin_get_author.is_a? Symbol
-      raise ConfigurationError.new  &quot;admin_authorization must be a Proc or Symbol&quot; unless @admin_authorization.is_a? Proc or @admin_authorization.is_a? Symbol
-      raise ConfigurationError.new  &quot;authorization must be a Proc or Symbol&quot; unless @authorization.is_a? Proc or @authorization.is_a? Symbol
+      raise ConfigurationError.new &quot;admin_authorization must be a Proc or Symbol&quot; unless @admin_authorization.is_a? Proc or @admin_authorization.is_a? Symbol
+      raise ConfigurationError.new &quot;authorization must be a Proc or Symbol&quot; unless @authorization.is_a? Proc or @authorization.is_a? Symbol
       true
     end
     </diff>
      <filename>lib/comatose/configuration.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,70 +1,68 @@
 # This is the rendering context object you have access to in text processing...
-module Comatose
-  class ProcessingContext
-    @@supported_methods = %w(page include)
+class Comatose::ProcessingContext
+  @@supported_methods = %w(page include)
 
-    def initialize( page, locals={} )
-      @locals = locals.stringify_keys if locals.respond_to? :stringify_keys
-      @page = Comatose::PageWrapper.new(page, @locals)
-    end
-  
-    def page
-      @page
-    end
-  
-    def include(path, locals={})
-      begin
-        page = Comatose::Page.find_by_path(path)
-        page.to_html( @locals.merge(locals) )
-      rescue
-        &quot;&lt;p&gt;Page at &lt;tt&gt;#{path}&lt;/tt&gt; could not be found.&lt;/p&gt;&quot;
-      end
-    end
-  
-    def find_by_path(path)
-      begin
-        page = Comatose::Page.find_by_path(path)
-        Comatose::PageWrapper.new(page, @locals)
-      rescue
-        &quot;&lt;p&gt;Page at &lt;tt&gt;#{path}&lt;/tt&gt; could not be found.&lt;/p&gt;&quot;
-      end
-    end
-  
-    def [](key)
-      if key.to_s.downcase == 'page'
-        @page
-      elsif @locals.has_key? key
-        @locals[key]
-      elsif Comatose.registered_drops.has_key? key
-        Comatose.registered_drops[key]
-      end
-    end
-  
-    def has_key?(key)
-      @@supported_methods.include?(key) or @locals.has_key?(key) or Comatose.registered_drops.has_key?(key)
+  def initialize( page, locals={} )
+    @locals = locals.stringify_keys if locals.respond_to? :stringify_keys
+    @page = Comatose::PageWrapper.new(page, @locals)
+  end
+
+  def page
+    @page
+  end
+
+  def include(path, locals={})
+    begin
+      page = ComatosePage.find_by_path(path)
+      page.to_html( @locals.merge(locals) )
+    rescue
+      &quot;&lt;p&gt;Page at &lt;tt&gt;#{path}&lt;/tt&gt; could not be found.&lt;/p&gt;&quot;
     end
+  end
 
-    def to_liquid
-      self
+  def find_by_path(path)
+    begin
+      page = ComatosePage.find_by_path(path)
+      Comatose::PageWrapper.new(page, @locals)
+    rescue
+      &quot;&lt;p&gt;Page at &lt;tt&gt;#{path}&lt;/tt&gt; could not be found.&lt;/p&gt;&quot;
     end
-  
-    def get_binding
-      binding
+  end
+
+  def [](key)
+    if key.to_s.downcase == 'page'
+      @page
+    elsif @locals.has_key? key
+      @locals[key]
+    elsif Comatose.registered_drops.has_key? key
+      Comatose.registered_drops[key]
     end
+  end
+
+  def has_key?(key)
+    @@supported_methods.include?(key) or @locals.has_key?(key) or Comatose.registered_drops.has_key?(key)
+  end
 
-    def method_missing(method_id, *args)
-      method_name = method_id.to_s
-      if @locals.has_key? method_name
-        @locals[method_name]
-      elsif Comatose.registered_drops.has_key? method_name
-        Comatose.registered_drops[method_name].context = self
-        Comatose.registered_drops[method_name]
-      else
-        &quot;&lt;!-- ProcessingContext: Couldn't find #{method_id} --&gt;&quot;
-      end
+  def to_liquid
+    self
+  end
+
+  def get_binding
+    binding
+  end
+
+  def method_missing(method_id, *args)
+    method_name = method_id.to_s
+    if @locals.has_key? method_name
+      @locals[method_name]
+    elsif Comatose.registered_drops.has_key? method_name
+      Comatose.registered_drops[method_name].context = self
+      Comatose.registered_drops[method_name]
+    else
+      &quot;&lt;!-- ProcessingContext: Couldn't find #{method_id} --&gt;&quot;
     end
-  
   end
+
 end
 
 </diff>
      <filename>lib/comatose/processing_context.rb</filename>
    </modified>
    <modified>
      <diff>@@ -35,7 +35,7 @@ protected
   end
   
   def render_comatose_page(page_path, params)
-    if page = Comatose::Page.find_by_path(page_path)
+    if page = ComatosePage.find_by_path(page_path)
       # Add the request params to the context...
       params[:locals]['params'] = controller.params
       html = page.to_html( params[:locals] )</diff>
      <filename>lib/support/inline_rendering.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,7 +5,7 @@ class ActionController::Routing::RouteSet::Mapper
   def comatose_root( path, options={} )
     opts = {
       :index      =&gt; '',
-      :layout     =&gt; 'comatose_content',
+      :layout     =&gt; 'comatose_content.html.erb',
       :use_cache  =&gt; 'true',
       :cache_path =&gt; nil,
       :named_route=&gt; nil</diff>
      <filename>lib/support/route_mapper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -37,7 +37,7 @@ namespace :comatose do
       root = ENV['FROM'] || ''
       target = ENV['TO_FILE'] || 'db/comatose-pages.yml'
       # Nested hash of the page tree...
-      from = Comatose::Page.find_by_path(root)
+      from = ComatosePage.find_by_path(root)
       if from
         data = page_to_hash( from ) 
         File.open(target, 'w') {|f| f.write data.to_yaml }
@@ -54,7 +54,7 @@ namespace :comatose do
 
       src = ENV['FROM_FILE'] || 'db/comatose-pages.yml'
       root = ENV['TO'] || ''
-      target = (root == '') ? Comatose::Page.root : Comatose::Page.find_by_path(root)
+      target = (root == '') ? ComatosePage.root : ComatosePage.find_by_path(root)
       data = YAML::load( File.open(src) )
       #hash_to_page(data, target)
       if target</diff>
      <filename>tasks/data.rake</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-# Comatose::Page attributes
+# ComatosePage attributes
 #  - parent_id
 #  - title
 #  - full_path</diff>
      <filename>test/fixtures/comatose_pages.yml</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,10 @@
 require File.dirname(__FILE__) + '/../test_helper'
-require 'comatose/admin_controller'
+require 'comatose_admin_controller'
+require 'comatose_admin_helper'
 require 'text_filters'
 
 # Re-raise errors caught by the controller.
-class ComatoseAdminController &lt; Comatose::AdminController
+class ComatoseAdminController
   def rescue_action(e) raise e end
 end
 </diff>
      <filename>test/functional/comatose_admin_controller_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,9 @@
 require File.dirname(__FILE__) + '/../test_helper'
-require 'comatose/controller'
+require 'comatose_controller'
+require 'comatose_helper'
 
 # Re-raise errors caught by the controller.
-class ComatoseController &lt; Comatose::Controller
+class ComatoseController
   def rescue_action(e) raise e end
 end
 
@@ -24,18 +25,18 @@ class ComatoseControllerTest &lt; Test::Unit::TestCase
   should &quot;show pages based on path_info&quot; do
 
     # Get the faq page...
-    get :show, :page=&gt;'faq', :index=&gt;'', :layout=&gt;'comatose_content', :use_cache=&gt;'false'
+    get :show, :page=&gt;'faq', :index=&gt;'', :layout=&gt;'comatose_content.html.erb', :use_cache=&gt;'false'
     assert_response :success
     assert_tag :tag=&gt;'h1', :child=&gt;/Frequently Asked Questions/
 
     # Get a question page using rails 2.0 array style...
-    get :show, :page=&gt;['faq','question-one'], :index=&gt;'', :layout=&gt;'comatose_content', :use_cache=&gt;'false'
+    get :show, :page=&gt;['faq','question-one'], :index=&gt;'', :layout=&gt;'comatose_content.html.erb', :use_cache=&gt;'false'
     assert_response :success
     assert_tag :tag=&gt;'title', :child=&gt;/Question/
 
     # Get a question page using rails 1.x path style...
     get :show, :page=&gt;ActionController::Routing::PathSegment::Result.new_escaped(['faq','question-one']), 
-        :index=&gt;'', :layout=&gt;'comatose_content', :use_cache=&gt;'false'
+        :index=&gt;'', :layout=&gt;'comatose_content.html.erb', :use_cache=&gt;'false'
     assert_response :success
     assert_tag :tag=&gt;'title', :child=&gt;/Question/
   end</diff>
      <filename>test/functional/comatose_controller_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -13,11 +13,11 @@ class Test::Unit::TestCase
   self.use_instantiated_fixtures  = false
 
   def create_page(options={})
-    Comatose::Page.create({ :title =&gt; 'Comatose Page', :author=&gt;'test', :parent_id=&gt;1 }.merge(options))
+    ComatosePage.create({ :title =&gt; 'Comatose Page', :author=&gt;'test', :parent_id=&gt;1 }.merge(options))
   end
   
   def comatose_page(sym)
-    Comatose::Page.find_by_slug(sym.to_s.dasherize)
+    ComatosePage.find_by_slug(sym.to_s.dasherize)
   end
   
   def assert_difference(object, method = nil, difference = 1)</diff>
      <filename>test/test_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,7 +5,7 @@ class ComatosePageTest &lt; Test::Unit::TestCase
   fixtures :comatose_pages
 
   should &quot;create page&quot; do
-    assert_difference Comatose::Page, :count do
+    assert_difference ComatosePage, :count do
       page = create_page :title=&gt;'New Page Name'
       assert !page.new_record?, &quot;#{page.errors.full_messages.to_sentence}&quot;
     end
@@ -25,7 +25,7 @@ class ComatosePageTest &lt; Test::Unit::TestCase
   end
   
   should &quot;not allow creation of page when missing a title&quot; do
-    assert_no_difference Comatose::Page, :count do
+    assert_no_difference ComatosePage, :count do
       p = create_page(:title =&gt; nil)
       assert p.errors.on(:title)
     end
@@ -42,6 +42,7 @@ class ComatosePageTest &lt; Test::Unit::TestCase
   should &quot;generate slugs correctly&quot; do
     assert_equal 'hello-how-are-you',     new_page_slug( &quot;Hello, How Are You?&quot; )
     assert_equal 'i-have-too-much-space', new_page_slug( &quot;I    have  too   much space&quot; )
+    assert_equal 'i-have-leading-and-trailing-space', new_page_slug( &quot;   I have leading and trailing space  &quot; )
     assert_equal 'what-about-dashes',     new_page_slug( &quot;What about - dashes?&quot; )
     assert_equal 'a-bizarre-title',       new_page_slug( 'A !@!@#$%^&lt;&gt;&amp;*()_+{} Bizarre TiTle!' )
     assert_equal '001-numbers-too',       new_page_slug( &quot;001 Numbers too&quot; )
@@ -81,6 +82,11 @@ class ComatosePageTest &lt; Test::Unit::TestCase
     assert_equal 'faq/q-1/params', page.full_path
   end
 
+  should &quot;set an AR error with processor syntax error info&quot; do
+    page = create_page :title=&gt;'Title Here', :body=&gt;'h1. {% crap %}'
+    assert !page.save, page.errors.full_messages.to_sentence
+  end
+
   should &quot;render body text accurately&quot; do
     assert_equal &quot;&lt;h1&gt;Home Page&lt;/h1&gt;\n\n\n\t&lt;p&gt;This is your &lt;strong&gt;home page&lt;/strong&gt;.&lt;/p&gt;&quot;, root_page.to_html
     assert_equal &quot;&lt;h1&gt;Frequently Asked Questions&lt;/h1&gt;\n\n\n\t&lt;h2&gt;&lt;a href=\&quot;/faq/question-one\&quot;&gt;Question One?&lt;/a&gt;&lt;/h2&gt;\n\n\n&lt;p&gt;Content for &lt;strong&gt;question one&lt;/strong&gt;.&lt;/p&gt;\n\n\t&lt;h2&gt;&lt;a href=\&quot;/faq/question-two\&quot;&gt;Question Two?&lt;/a&gt;&lt;/h2&gt;\n\n\n&lt;p&gt;Content for &lt;strong&gt;question two&lt;/strong&gt;.&lt;/p&gt;&quot;, faq_page.to_html
@@ -108,7 +114,7 @@ class ComatosePageTest &lt; Test::Unit::TestCase
     end
     
     def root_page
-      Comatose::Page.root
+      ComatosePage.root
     end
     
     def faq_page</diff>
      <filename>test/unit/comatose_page_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,5 @@
 require File.dirname(__FILE__) + '/../test_helper'
-require 'comatose/page'
-require 'comatose/page_wrapper'
-require 'comatose/processing_context'
+require 'comatose'
 
 class ProcessingContextTest &lt; Test::Unit::TestCase
 </diff>
      <filename>test/unit/processing_context_test.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>lib/comatose/admin_controller.rb</filename>
    </removed>
    <removed>
      <filename>lib/comatose/admin_helper.rb</filename>
    </removed>
    <removed>
      <filename>lib/comatose/controller.rb</filename>
    </removed>
    <removed>
      <filename>lib/comatose/drops.rb</filename>
    </removed>
    <removed>
      <filename>lib/comatose/helper.rb</filename>
    </removed>
    <removed>
      <filename>lib/comatose/page.rb</filename>
    </removed>
    <removed>
      <filename>views/comatose_admin/_form.rhtml</filename>
    </removed>
    <removed>
      <filename>views/comatose_admin/_page_list_item.rhtml</filename>
    </removed>
    <removed>
      <filename>views/comatose_admin/delete.rhtml</filename>
    </removed>
    <removed>
      <filename>views/comatose_admin/edit.rhtml</filename>
    </removed>
    <removed>
      <filename>views/comatose_admin/index.rhtml</filename>
    </removed>
    <removed>
      <filename>views/comatose_admin/new.rhtml</filename>
    </removed>
    <removed>
      <filename>views/comatose_admin/reorder.rhtml</filename>
    </removed>
    <removed>
      <filename>views/comatose_admin/versions.rhtml</filename>
    </removed>
    <removed>
      <filename>views/layouts/comatose_admin.rhtml</filename>
    </removed>
    <removed>
      <filename>views/layouts/comatose_admin_customize.rhtml</filename>
    </removed>
    <removed>
      <filename>views/layouts/comatose_content.rhtml</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>4742dfc2f5e2276cb4157637a065d781ab3f80b8</id>
    </parent>
  </parents>
  <author>
    <name>M@ McCray</name>
    <email>darthapo@gmail.com</email>
  </author>
  <url>http://github.com/darthapo/comatose/commit/fb30ce5562c0819a6bae71e4dfc097e9149e814d</url>
  <id>fb30ce5562c0819a6bae71e4dfc097e9149e814d</id>
  <committed-date>2008-05-20T12:42:15-07:00</committed-date>
  <authored-date>2008-05-20T12:42:15-07:00</authored-date>
  <message>Version 2.0 (uber-alpha)
 * Removed controllers, models, and helpers from Comatose module. It was causing odd issues
 * Initial support for Rails 2.1(ish)
 * Fixed up slug generation to remove leading and trailing whitespace
 * Moved to github
 * Changed all the .rhtml files to .html.erb
 * Other needed cleanup</message>
  <tree>a43c69c413d87465148ec1d5de05f3e416119b4d</tree>
  <committer>
    <name>M@ McCray</name>
    <email>darthapo@gmail.com</email>
  </committer>
</commit>
