<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>vendor/plugins/aaa/test/include_into_test.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -38,7 +38,7 @@
     &lt;li&gt;&lt;a href=&quot;#&quot;&gt;&amp;nbsp;&lt;/a&gt;&lt;/li&gt;
   &lt;/ul&gt;
   &lt;ul id=&quot;attributes&quot;&gt;
-    &lt;% if @article &amp;&amp; controller.controller_name == 'articles' &amp;&amp; controller.action_name == 'edit' %&gt;
+    &lt;% if @article &amp;&amp; controller.controller_name == 'articles' &amp;&amp; controller.action_name == 'edit' -%&gt;
     &lt;li&gt;&lt;label for=&quot;search&quot;&gt;Revision:&lt;/label&gt;&lt;/li&gt;
     &lt;li&gt;
       &lt;select name=&quot;filter&quot; id=&quot;revisionnum&quot;&gt;
@@ -46,7 +46,7 @@
         &lt;%= options_from_collection_for_select @article.versions.reverse, :version, :version, params[:version].to_i %&gt;
       &lt;/select&gt;
     &lt;/li&gt;
-    &lt;% end %&gt;
+    &lt;% end -%&gt;
     &lt;% if controller.controller_name == 'comments' &amp;&amp; controller.action_name == 'index' -%&gt;
     &lt;li&gt;&lt;label for=&quot;comments_view&quot;&gt;Show comments:&lt;/label&gt;&lt;/li&gt;
     &lt;li&gt;
@@ -54,7 +54,7 @@
         &lt;%= options_for_select ['All', 'Unapproved', 'Approved'], params[:filter].to_s.humanize %&gt;
       &lt;/select&gt;
     &lt;/li&gt;
-    &lt;% end %&gt;
+    &lt;% end -%&gt;
   &lt;/ul&gt;
 &lt;/div&gt;
-&lt;% end unless @article.new_record? &amp;&amp; @article.comments.empty? -%&gt;
\ No newline at end of file
+&lt;% end unless @article &amp;&amp; @article.new_record? &amp;&amp; @article.comments.size == 0 -%&gt;
\ No newline at end of file</diff>
      <filename>app/views/admin/articles/_page_nav.rhtml</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,7 @@
 
 Module.class_eval do
   # A hash that maps Class names to an array of Modules to mix in when the class is instantiated.
-  @@class_mixins = {}
+  @@class_mixins = {} unless defined?(@@class_mixins)
   mattr_reader :class_mixins
 
   # Specifies that this module should be included into the given classes when they are instantiated.
@@ -11,18 +11,46 @@ Module.class_eval do
   #   module FooMethods
   #     include_into &quot;Foo&quot;, &quot;Bar&quot;
   #   end
+  #
+  # You can also specify a hash to have your module's methods alias_method_chained to the target 
+  # class' methods.
+  #
+  #   module FooMethods
+  #      include_into &quot;Foo&quot;, :method =&gt; :feature
+  #   end
+  #
+  # This will alias Foo#method to the newly included FooMethods#method_with_feature. The former
+  # method Foo#method will continue to be available as Foo#method_without_feature.
+  #
   def include_into(*klasses)
     klasses.flatten!
+    aliases = klasses.last.is_a?(Hash) ? klasses.pop : {}
     klasses.each do |klass|
-      (@@class_mixins[klass] ||= []) &lt;&lt; name.to_s
+      (@@class_mixins[klass] ||= []) &lt;&lt; [name.to_s, aliases]
       @@class_mixins[klass].uniq!
     end
   end
-  
+
   # add any class mixins that have been registered for this class
   def auto_include!
-    mixins = @@class_mixins[name]
-    send(:include, *mixins.collect { |name| name.constantize }) if mixins
+    if mixins = @@class_mixins[name]
+      mixins.each do |name, aliases| 
+        include name.constantize
+        aliases.each { |args| alias_chain *args }
+      end
+    end
+  end
+  
+  def alias_chain(target, feature)
+    (class &lt;&lt; self; self end).class_eval &lt;&lt;-EOC, __FILE__, __LINE__      
+      def method_added_with_#{target}_#{feature}(method)
+        if method == :#{target} &amp;&amp; !method_defined?(:#{target}_without_#{feature})
+          alias_method_chain :#{target}, :#{feature}
+        end
+        method_added_without_#{target}_#{feature}(method)
+      end
+      alias_method_chain :method_added, :#{target}_#{feature}
+    EOC
   end
 end
 </diff>
      <filename>vendor/plugins/aaa/init.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>1cd5005248cd280b894971da122345a1616d280f</id>
    </parent>
    <parent>
      <id>b9b07612fbb61a73530bd0920ef62ddbddfb2aa7</id>
    </parent>
  </parents>
  <author>
    <name>rick</name>
    <email>technoweenie@gmail.com</email>
  </author>
  <url>http://github.com/francois/mephisto/commit/2772ec18227b04b3cb618748a2900a7b93b84d94</url>
  <id>2772ec18227b04b3cb618748a2900a7b93b84d94</id>
  <committed-date>2008-02-13T10:12:12-08:00</committed-date>
  <authored-date>2008-02-13T10:12:12-08:00</authored-date>
  <message>Merge branch 'rel-0.8'</message>
  <tree>4381c9dcb98d67e4ad78416831a93b6afdb80cdc</tree>
  <committer>
    <name>rick</name>
    <email>technoweenie@gmail.com</email>
  </committer>
</commit>
