<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -9,55 +9,17 @@ require 'spec/rake/spectask'
 require 'fileutils'
 require 'merb-core'
 require 'rubigen'
-
-$RAKE_ENV = true
-
-init_file = File.join(File.dirname(__FILE__) / &quot;config&quot; / &quot;init&quot;)
-
-#Merb.load_dependencies(init_file)
-
 include FileUtils
-# # # Get Merb plugins and dependencies
-Merb::Plugins.rakefiles.each {|r| require r } 
-
-# 
-#desc &quot;Packages up Merb.&quot;
-#task :default =&gt; [:package]
-
-desc &quot;load merb_init.rb&quot;
-task :merb_init do
-  require 'merb-core'
-  require File.dirname(__FILE__)+'/config/init.rb'
-end  
-
-task :uninstall =&gt; [:clean] do
-  sh %{sudo gem uninstall #{NAME}}
-end
-
-desc 'Run all tests, specs and finish with rcov'
-task :aok do
-  sh %{rake rcov}
-  sh %{rake specs}
-end
 
-unless Gem.cache.search(&quot;haml&quot;).empty?
-  namespace :haml do
-    desc &quot;Compiles all sass files into CSS&quot;
-    task :compile_sass do
-      gem 'haml'
-      require 'sass'
-      puts &quot;*** Updating stylesheets&quot;
-      Sass::Plugin.update_stylesheets
-      puts &quot;*** Done&quot;      
-    end
-  end
-end
+# Load the basic runtime dependencies; this will include 
+# any plugins and therefore plugin rake tasks.
+init_env = ENV['MERB_ENV'] || 'rake'
+Merb.load_dependencies(:environment =&gt; init_env)
 
-##############################################################################
-# SVN
-##############################################################################
+# Get Merb plugins and dependencies
+Merb::Plugins.rakefiles.each { |r| require r }
 
-desc &quot;Add new files to subversion&quot;
-task :svn_add do
-   system &quot;svn status | grep '^\?' | sed -e 's/? *//' | sed -e 's/ /\ /g' | xargs svn add&quot;
+desc &quot;start runner environment&quot;
+task :merb_env do
+  Merb.start_environment(:environment =&gt; init_env, :adapter =&gt; 'runner')
 end
\ No newline at end of file</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,7 @@ module Admin
     before :find_article, :only =&gt; %w(edit update delete show)
 
     def index
-      @articles = Article.all(:order =&gt; &quot;created_at DESC&quot;)
+      @articles = Article.all(:order =&gt; [:created_at.desc])
       display @articles
     end
     </diff>
      <filename>app/controllers/admin/articles.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,7 +4,7 @@ module Admin
     before :check_for_user
     
     def index
-      @activity = Activity.all(:order =&gt; &quot;created_at DESC&quot;, :limit =&gt; 5)
+      @activity = Activity.all(:order =&gt; [:created_at.desc], :limit =&gt; 5)
       display @activity
     end
     </diff>
      <filename>app/controllers/admin/dashboard.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,8 @@ class Articles &lt; Application
 
   # This handles the index (recent articles), or the year/month/day views
   def index
-    @archives = Article.get_archive_hash
+    #@archives = Article.get_archive_hash
+    @archives = []
     if params[:day]
       @articles = Article.find_by_year_month_day(params[:year], params[:month], params[:day])
     elsif params[:month]</diff>
      <filename>app/controllers/articles.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,9 @@
-class Activity &lt; DataMapper::Base
-  property :message, :string, :nullable =&gt; false, :length =&gt; 255
-  property :created_at, :datetime
+class Activity
+
+  include DataMapper::Resource
+  
+  property :id, Integer, :key =&gt; true
+  property :message, String, :nullable =&gt; false, :length =&gt; 255
+  property :created_at, DateTime
+
 end
\ No newline at end of file</diff>
      <filename>app/models/activity.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,30 +1,37 @@
-class Article &lt; DataMapper::Base  
-  property :title, :string, :nullable =&gt; false, :length =&gt; 255
-  property :content, :text, :nullable =&gt; false
-  property :created_at, :datetime
-  property :published_at, :datetime
-  property :user_id, :integer, :nullable =&gt; false
-  property :permalink, :string, :length =&gt; 255
-  property :published, :boolean, :default =&gt; false
-  property :formatter, :string, :default =&gt; &quot;default&quot;
-  validates_presence_of :title, :key =&gt; &quot;uniq_title&quot;
-  validates_presence_of :content, :key =&gt; &quot;uniq_content&quot;
-  validates_presence_of :user_id, :key =&gt; &quot;uniq_user_id&quot;
+class Article
+  
+  include DataMapper::Resource
+  include DataMapper::Validate
+  
+  property :id, Integer, :key =&gt; true
+  property :title, String, :nullable =&gt; false, :length =&gt; 255
+  # was TEXT, should be TEXT again
+  property :content, String, :nullable =&gt; false
+  property :created_at, DateTime
+  property :published_at, DateTime
+  property :user_id, Integer, :nullable =&gt; false
+  property :permalink, String, :length =&gt; 255
+  property :published, TrueClass, :default =&gt; false
+  property :formatter, String, :default =&gt; &quot;default&quot;
+  
+  validates_present :title, :key =&gt; &quot;uniq_title&quot;
+  validates_present :content, :key =&gt; &quot;uniq_content&quot;
+  validates_present :user_id, :key =&gt; &quot;uniq_user_id&quot;
   
   belongs_to :user
   
   # Core filters
-  before_save :set_published_permalink
-  after_create :set_create_activity
-  after_update :set_update_activity
+  before :save, :set_published_permalink
+  after :save, :set_create_activity
+  after :save, :set_update_activity
   
   # Event hooks for plugins
-  before_create :fire_before_create_event
-  before_update :fire_before_update_event
-  before_save :fire_before_save_event
-  after_create :fire_after_create_event
-  after_update :fire_after_update_event
-  after_save :fire_after_save_event
+  before :save, :fire_before_create_event
+  before :save, :fire_before_update_event
+  before :save, :fire_before_save_event
+  after :save, :fire_after_create_event
+  after :save, :fire_after_update_event
+  after :save, :fire_after_save_event
   
   ##
   # This sets the published date and permalink when an article is published
@@ -40,23 +47,29 @@ class Article &lt; DataMapper::Base
   end
 
   def set_create_activity
-    a = Activity.new
-    a.message = &quot;Article \&quot;#{self.title}\&quot; created&quot;
-    a.save
+    if new_record?
+      a = Activity.new
+      a.message = &quot;Article \&quot;#{self.title}\&quot; created&quot;
+      a.save
+    end
   end
 
   def set_update_activity
-    a = Activity.new
-    a.message = &quot;Article \&quot;#{self.title}\&quot; updated&quot;
-    a.save
+    unless new_record?
+      a = Activity.new
+      a.message = &quot;Article \&quot;#{self.title}\&quot; updated&quot;
+      a.save
+    end
   end
 
   def fire_before_create_event
-    Hooks::Events.before_create_article(self)
+    if new_record?
+      Hooks::Events.before_create_article(self)
+    end
   end
 
   def fire_before_update_event
-    Hooks::Events.before_update_article(self)
+    Hooks::Events.before_update_article(self) unless new_record?
   end
 
   def fire_before_save_event
@@ -65,11 +78,13 @@ class Article &lt; DataMapper::Base
   end
 
   def fire_after_create_event
-    Hooks::Events.after_create_article(self)
+    if new_record?
+      Hooks::Events.after_create_article(self)
+    end
   end
   
   def fire_after_update_event
-    Hooks::Events.after_update_article(self)
+    Hooks::Events.after_update_article(self) unless new_record?
   end
 
   def fire_after_save_event
@@ -87,22 +102,22 @@ class Article &lt; DataMapper::Base
     # Custom finders
 
     def find_recent
-      self.all(:published =&gt; true, :limit =&gt; 10, :order =&gt; &quot;published_at DESC&quot;)
+      self.all(:published =&gt; true, :limit =&gt; 10, :order =&gt; [:published_at.desc])
     end
 
     def find_by_year(year)
-      self.all(:published_at.like =&gt; &quot;#{year}%&quot;, :published =&gt; true, :order =&gt; &quot;published_at DESC&quot;)
+      self.all(:published_at.like =&gt; &quot;#{year}%&quot;, :published =&gt; true, :order =&gt; [:published_at.desc])
     end
 
     def find_by_year_month(year, month)
       month = Padding::pad_single_digit(month)
-      self.all(:published_at.like =&gt; &quot;#{year}-#{month}%&quot;, :published =&gt; true, :order =&gt; &quot;published_at DESC&quot;)
+      self.all(:published_at.like =&gt; &quot;#{year}-#{month}%&quot;, :published =&gt; true, :order =&gt; [:published_at.desc])
     end
 
     def find_by_year_month_day(year, month, day)
       month = Padding::pad_single_digit(month)
       day = Padding::pad_single_digit(day)
-      self.all(:published_at.like =&gt; &quot;#{year}-#{month}-#{day}%&quot;, :published =&gt; true, :order =&gt; &quot;published_at DESC&quot;)
+      self.all(:published_at.like =&gt; &quot;#{year}-#{month}-#{day}%&quot;, :published =&gt; true, :order =&gt; [:published_at.desc])
     end
 
     def find_by_permalink(permalink)</diff>
      <filename>app/models/article.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,10 +1,15 @@
-class Configuration &lt; DataMapper::Base
-  property :title, :string
-  property :tag_line, :string, :length =&gt; 255
-  property :about, :text
-  property :about_formatter, :string
+class Configuration
 
-  after_save :set_activity
+  include DataMapper::Resource
+
+  property :id, Integer, :key =&gt; true
+  property :title, String
+  property :tag_line, String, :length =&gt; 255
+  # TODO: was TEXT, is VARCHAR now, should be TEXT again
+  property :about, String
+  property :about_formatter, String
+
+  after :save, :set_activity
 
   def set_activity
     a = Activity.new</diff>
      <filename>app/models/configuration.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,18 +1,22 @@
-class Plugin &lt; DataMapper::Base
-  property :url, :string, :length =&gt; 255
-  property :path, :string, :length =&gt; 255
-  property :name, :string
-  property :author, :string
-  property :version, :string
-  property :homepage, :string, :length =&gt; 255
-  property :about, :string, :length =&gt; 255
-  property :active, :boolean
+class Plugin
 
-  before_create :download
-  after_create :install
-  after_create :set_create_activity
-  after_update :set_update_activity
-  after_destroy :remove
+  include DataMapper::Resource
+
+  property :id, Integer, :key =&gt; true
+  property :url, String, :length =&gt; 255
+  property :path, String, :length =&gt; 255
+  property :name, String
+  property :author, String
+  property :version, String
+  property :homepage, String, :length =&gt; 255
+  property :about, String, :length =&gt; 255
+  property :active, TrueClass
+
+  before :save, :download
+  after :save, :install
+  after :save, :set_create_activity
+  after :save, :set_update_activity
+  after :destroy, :remove
 
   class &lt;&lt; self
     @@loaded = []
@@ -21,31 +25,36 @@ class Plugin &lt; DataMapper::Base
   ##
   # This grabs the plugin using its url, unpacks it, and loads the metadata for it
   def download
-    # Load the manifest yaml
-    manifest = YAML::load(Net::HTTP.get(URI.parse(url + &quot;/manifest.yml&quot;)))
-    # Grab metadata from manifest
-    self.name = manifest[&quot;plugin&quot;][&quot;name&quot;]
-    self.author = manifest[&quot;plugin&quot;][&quot;author&quot;]
-    self.version = manifest[&quot;plugin&quot;][&quot;version&quot;]
-    self.homepage = manifest[&quot;plugin&quot;][&quot;homepage&quot;]
-    self.about = manifest[&quot;plugin&quot;][&quot;about&quot;]
-    # Build the path
-    self.path = File.join(File.join(File.join(Merb.root, &quot;app&quot;), &quot;plugins&quot;), URI.parse(url).path.split(&quot;/&quot;).last.split(&quot;.&quot;).first)
-    # Remove any existing plugin at the path
-    FileUtils.rm_rf(self.path)
-    # Download all of the plugin contents
-    recurse(manifest[&quot;plugin&quot;][&quot;contents&quot;])
-    # Unpack any gems downloaded
-    unpack_gems(manifest[&quot;plugin&quot;][&quot;contents&quot;][&quot;gems&quot;][&quot;.&quot;]) unless manifest[&quot;plugin&quot;][&quot;contents&quot;][&quot;gems&quot;].nil?
+    if new_record?
+      # Load the manifest yaml
+      manifest = YAML::load(Net::HTTP.get(URI.parse(url + &quot;/manifest.yml&quot;)))
+      # Grab metadata from manifest
+      self.name = manifest[&quot;plugin&quot;][&quot;name&quot;]
+      self.author = manifest[&quot;plugin&quot;][&quot;author&quot;]
+      self.version = manifest[&quot;plugin&quot;][&quot;version&quot;]
+      self.homepage = manifest[&quot;plugin&quot;][&quot;homepage&quot;]
+      self.about = manifest[&quot;plugin&quot;][&quot;about&quot;]
+      # Build the path
+      self.path = File.join(File.join(File.join(Merb.root, &quot;app&quot;), &quot;plugins&quot;), URI.parse(url).path.split(&quot;/&quot;).last.split(&quot;.&quot;).first)
+      # Remove any existing plugin at the path
+      FileUtils.rm_rf(self.path)
+      # Download all of the plugin contents
+      recurse(manifest[&quot;plugin&quot;][&quot;contents&quot;])
+      # Unpack any gems downloaded
+      unpack_gems(manifest[&quot;plugin&quot;][&quot;contents&quot;][&quot;gems&quot;][&quot;.&quot;]) unless manifest[&quot;plugin&quot;][&quot;contents&quot;][&quot;gems&quot;].nil?
+    end
   end
 
   ##
   # This loads and installs the plugin
   def install
-    # Load the plugin
-    self.load
-    # Also, if there is an &quot;install.rb&quot; script present, run that to setup anything the plugin needs (database tables etc)
-    require File.join(self.path, &quot;install.rb&quot;) if File.exists?(File.join(self.path, &quot;install.rb&quot;))
+    if new_record?
+      # Load the plugin
+      self.load
+      # Also, if there is an &quot;install.rb&quot; script present, run that to setup anything the plugin needs (database tables etc)
+      require File.join(self.path, &quot;install.rb&quot;) if File.exists?(File.join(self.path, &quot;install.rb&quot;))
+    end
+    
   rescue Exception =&gt; err
     # Catch the error, delete the plugin, and raise an error again
     self.destroy!
@@ -55,17 +64,21 @@ class Plugin &lt; DataMapper::Base
   ##
   # This adds the activity to show a plugin has been installed
   def set_create_activity
-    a = Activity.new
-    a.message = &quot;Plugin \&quot;#{self.name}\&quot; installed&quot;
-    a.save
+    if new_record?
+      a = Activity.new
+      a.message = &quot;Plugin \&quot;#{self.name}\&quot; installed&quot;
+      a.save
+    end
   end
 
   ##
   # This adds the activity to show a plugin has been updated
   def set_update_activity
-    a = Activity.new
-    a.message = &quot;Plugin \&quot;#{self.name}\&quot; #{self.active ? 'activated' : 'de-activated'}&quot;
-    a.save
+    unless new_record?
+      a = Activity.new
+      a.message = &quot;Plugin \&quot;#{self.name}\&quot; #{self.active ? 'activated' : 'de-activated'}&quot;
+      a.save
+    end
   end
 
   ##</diff>
      <filename>app/models/plugin.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,49 +4,57 @@ begin
 rescue 
   nil
 end
-class User &lt; DataMapper::Base
+class User
+
+  include DataMapper::Resource
+  include DataMapper::Validate
   include AuthenticatedSystem::Model
 
   attr_accessor :password, :password_confirmation
 
-  property :login,                      :string
-  property :email,                      :string, :length =&gt; 255
-  property :crypted_password,           :string
-  property :salt,                       :string
-  property :remember_token_expires_at,  :datetime
-  property :remember_token,             :string
-  property :time_zone,                  :string
-  property :created_at,                 :datetime
-  property :updated_at,                 :datetime
-  property :name,                       :string
-  property :default_formatter,          :string
-
-  validates_length_of         :login,                   :within =&gt; 3..40
-  validates_uniqueness_of     :login
-  validates_presence_of       :password,                :if =&gt; proc {password_required?}
-  validates_presence_of       :password_confirmation,   :if =&gt; proc {password_required?}
-  validates_length_of         :password,                :within =&gt; 4..40, :if =&gt; proc {password_required?}
-  validates_confirmation_of   :password,                :groups =&gt; :create
-  validates_presence_of       :email
-
-  before_save :encrypt_password
-
-  after_create :set_create_activity
-  after_update :set_update_activity
+  property :id, Integer, :key =&gt; true
+  property :login,                      String
+  property :email,                      String, :length =&gt; 255
+  property :crypted_password,           String
+  property :salt,                       String
+  property :remember_token_expires_at,  DateTime
+  property :remember_token,             String
+  property :time_zone,                  String
+  property :created_at,                 DateTime
+  property :updated_at,                 DateTime
+  property :name,                       String
+  property :default_formatter,          String
+
+  validates_length            :login,                   :within =&gt; 3..40
+  validates_is_unique         :login
+  validates_present           :password,                :if =&gt; proc {password_required?}
+  validates_present           :password_confirmation,   :if =&gt; proc {password_required?}
+  validates_length            :password,                :within =&gt; 4..40, :if =&gt; proc {password_required?}
+  validates_is_confirmed      :password,                :groups =&gt; :create
+  validates_present           :email
+
+  before :save, :encrypt_password
+
+  after :save, :set_create_activity
+  after :save, :set_update_activity
 
   def set_create_activity
-    a = Activity.new
-    a.message = &quot;User \&quot;#{self.login}\&quot; created&quot;
-    a.save
+    if new_record?
+      a = Activity.new
+      a.message = &quot;User \&quot;#{self.login}\&quot; created&quot;
+      a.save
+    end
   end
 
   def set_update_activity
-    a = Activity.new
-    a.message = &quot;User \&quot;#{self.login}\&quot; updated&quot;
-    a.save
+    unless new_record?
+      a = Activity.new
+      a.message = &quot;User \&quot;#{self.login}\&quot; updated&quot;
+      a.save
+    end
   end
 
-  def login=(value)
-    @login = value.downcase unless value.nil?
+  def login=(value);
+    attribute_set :login, value.downcase unless value.nil?
   end
 end
\ No newline at end of file</diff>
      <filename>app/models/user.rb</filename>
    </modified>
    <modified>
      <diff>@@ -40,7 +40,7 @@ use_orm :datamapper
 ### merb.
 ###
 # use_test :test_unit
-use_test :rspec
+use_test :rspec, &quot;merb_stories&quot;
 
 ### Add your other dependencies here
 
@@ -51,7 +51,10 @@ dependencies &quot;merb-assets&quot;
 dependencies &quot;merb-cache&quot;
 dependency &quot;merb-action-args&quot;
 dependency &quot;merb-mailer&quot;
-dependency &quot;merb_stories&quot; if Merb.environment == &quot;test&quot;
+
+dependency &quot;dm-aggregates&quot;
+dependency &quot;dm-validations&quot;
+dependency &quot;dm-timestamps&quot;
 # OR
 # OR
 # dependencies &quot;RedCloth&quot; =&gt; &quot;&gt; 3.0&quot;, &quot;ruby-aes-cext&quot; =&gt; &quot;= 1.0&quot;</diff>
      <filename>config/init.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>0d5adc9615d8ad93e5972411da9a7f06bfdf2be5</id>
    </parent>
  </parents>
  <author>
    <name>Alexander Flatter</name>
    <email>flatter@alexander-flatters-macbook-pro.local</email>
  </author>
  <url>http://github.com/aflatter/feather/commit/17e1dda086509e223c48cac5422dd5236576d8d8</url>
  <id>17e1dda086509e223c48cac5422dd5236576d8d8</id>
  <committed-date>2008-05-14T09:10:04-07:00</committed-date>
  <authored-date>2008-05-14T09:10:04-07:00</authored-date>
  <message>Seems to be compatible to current datamapper trunk</message>
  <tree>53a211ca96004ca4ac8b9f34e3a5aeec1c1b9139</tree>
  <committer>
    <name>Alexander Flatter</name>
    <email>flatter@alexander-flatters-macbook-pro.local</email>
  </committer>
</commit>
