<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>test/acts_as_snook_extension_test.rb</filename>
    </added>
    <added>
      <filename>test/extended_comment.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -22,7 +22,7 @@ module LuckySneaks
       # 
       # * &lt;tt&gt;:comment_belongs_to&lt;/tt&gt; - Symbol or string specifying the association that the comment has a &lt;tt&gt;:belongs_to&lt;/tt&gt; relationship with.
       # * &lt;tt&gt;:ham_comments_count_field&lt;/tt&gt; - Symbol or string specifying an alternate database field to use for the ham_comments_count attribute. Default: +ham_comments_count+
-      def acts_as_snook(options = {})
+      def acts_as_snook(options = {}, &amp;block)
         cattr_accessor :spam_words
         self.spam_words = %w{
           -online 4u 4-u acne adipex advicer baccarrat blackjack bllogspot booker buy byob carisoprodol
@@ -61,6 +61,11 @@ module LuckySneaks
           after_destroy :decrement_ham_comments_count
         end
         
+        cattr_accessor :custom_callbacks_for_snooking
+        if block_given?
+          self.custom_callbacks_for_snooking = block
+        end
+        
         attr_reader :snook_credits
         attr_protected fields_for_snooking[:spam_status_field]
       end
@@ -186,6 +191,12 @@ module LuckySneaks
       deduct_snook_credits(1 * snook_body.scan(/\[(url|img)/i).size)
     end
     
+    def calculate_snook_for_custom_rules
+      if custom_callbacks_for_snooking
+        instance_eval &amp;custom_callbacks_for_snooking
+      end
+    end
+    
     def calculate_snook_score
       @snook_credits = 0
       calculate_snook_for_body_links
@@ -199,6 +210,8 @@ module LuckySneaks
       calculate_snook_for_author_link
       calculate_snook_for_matching_previous_body
       calculate_snook_for_consonant_runs
+      calculate_snook_for_bbcode
+      calculate_snook_for_custom_rules
       status = if @snook_credits &gt; 0
         &quot;ham&quot;
       elsif @snook_credits == 0
@@ -206,10 +219,18 @@ module LuckySneaks
       else
         &quot;spam&quot;
       end
+      status = @forced_snook_status || status
       self.send(&quot;#{self.class.fields_for_snooking[:spam_status_field]}=&quot;, status)
+      @forced_snook_status = nil
+      # Dont save if snook_credits under -10
       snook_credits &gt;= -10
     end
     
+    def force_snook_status(value)
+      raise ArgumentError, &quot;force_snook_status called without block&quot; unless block_given?
+      @forced_snook_status = value.to_s if yield
+    end
+    
     def snook_author
       @snook_author ||= self.send(self.class.fields_for_snooking[:author_field]) || &quot;&quot;
     end
@@ -231,11 +252,13 @@ module LuckySneaks
     end
     
     def add_snook_credits(addition)
-      @snook_credits = @snook_credits + addition
+      return if block_given? &amp;&amp; !yield
+      @snook_credits += addition
     end
     
     def deduct_snook_credits(deduction)
-      @snook_credits = @snook_credits - deduction
+      return if block_given? &amp;&amp; !yield
+      @snook_credits -= deduction
     end
     
     def previous_comment_count_for_snook_author(spam_value)</diff>
      <filename>lib/lucky_sneaks/acts_as_snook.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,4 @@
 class Entry &lt; ActiveRecord::Base
   has_many :comments
+  has_many :extended_comments
 end
\ No newline at end of file</diff>
      <filename>test/entry.rb</filename>
    </modified>
    <modified>
      <diff>@@ -11,4 +11,15 @@ ActiveRecord::Schema.define(:version =&gt; 1) do
     t.string :title
     t.integer :ham_comments_count, :default =&gt; 0
   end
+  
+  create_table :extended_comments, :force =&gt; true do |t|
+    t.integer :entry_id
+    t.string :author, :email, :url, :spam_status
+    t.text :body
+  end
+  
+  create_table :extended_entries, :force =&gt; true do |t|
+    t.string :title
+    t.integer :ham_comments_count, :default =&gt; 0
+  end
 end
\ No newline at end of file</diff>
      <filename>test/schema.rb</filename>
    </modified>
    <modified>
      <diff>@@ -16,10 +16,9 @@ end
 
 ActiveRecord::Base.establish_connection(:adapter =&gt; &quot;sqlite3&quot;, :dbfile =&gt; &quot;acts_as_url.sqlite3&quot;)
 
-require File.join(File.dirname(__FILE__), '../init')
-require File.join(File.dirname(__FILE__), 'schema')
-require File.join(File.dirname(__FILE__), 'comment')
-require File.join(File.dirname(__FILE__), 'entry')
+%w{../init schema comment entry extended_comment}.each do |foo|
+  require File.join(File.dirname(__FILE__), foo)
+end
 
 Entry.create!(:title =&gt; &quot;The Tale of Flight 815&quot;)
 </diff>
      <filename>test/test_helper.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>52b9e8b98dfb1cd51dd5213fd20016027d90a0ed</id>
    </parent>
  </parents>
  <author>
    <name>RSL</name>
    <email>rsl@luckysneaks.com</email>
  </author>
  <url>http://github.com/rsl/acts_as_snook/commit/4b121dde11fbd7526d1696ee0eceb9d93020cc99</url>
  <id>4b121dde11fbd7526d1696ee0eceb9d93020cc99</id>
  <committed-date>2009-06-22T06:34:53-07:00</committed-date>
  <authored-date>2009-06-22T06:34:53-07:00</authored-date>
  <message>added custom rule functionality</message>
  <tree>8d9ce45784bfa9102fb0688d13ff2e4f730378e9</tree>
  <committer>
    <name>RSL</name>
    <email>rsl@luckysneaks.com</email>
  </committer>
</commit>
