<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>.cvsignore</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,11 +1,11 @@
 Gem::Specification.new do |s|
   s.name = %q{flogger}
-  s.version = &quot;0.0.1&quot;
+  s.version = &quot;0.0.2&quot;
   s.date = %q{2008-09-11}
   s.authors = [&quot;Simplificator GmbH&quot;]
   s.email = %q{info@simplificator.com}
   s.summary = %q{flog assertions for unit tests}
-  s.homepage = %q{http://simplificator.com/}
+  s.homepage = %q{http://simplificator.com/en/lab}
   s.description = %q{adds custom assertions to test/unit so you can test for your flog score}
   s.files = ['lib/flogger.rb', 'lib/flogger/assertions.rb']
 end</diff>
      <filename>flogger.gemspec</filename>
    </modified>
    <modified>
      <diff>@@ -1,11 +1,30 @@
 module Flogger
   module InstanceMethods
-    #
-    # assert_flog([files_or_dir], options)
+    # 
+    # assert the flog score of file(s) is below a treshold.
+    # 
+    # = Samples:
+    # == Flog a file or all ruby files in a directory
+    # assert_flog(file_or_dir)
+    # == Flog several files or directories
+    # assert_flog(file_or_dir_1, file_or_dir_2, file_or_fir_n)
+    # == set your own flog threshold
+    # assert_flog(file_or_dir, :threshold =&gt; 20)
+    # == set your own flog threshold for a specific method
+    # assert_flog(file_or_dir, :thresholds =&gt; {'FooClass#bar_method'})
+    # 
+    # == options
+    #  * :treshold what flog score do we allow at most. __default__ is 20.
+    #  * :tresholds customize tresholds on a per class/method base, overrides :treshold option
+    # 
+    # == Message
+    # This assertion does not support passing in your own message like 
+    # other assertions do (optional last parameter) because the error message 
+    # lists all failures from flog.
     #
     def assert_flog(*args)
       files, options = extract_files_and_options(args)
-      options = {:limit =&gt; 20}.merge(options)
+      options = {:treshold =&gt; 20}.merge(options)
       flogger = Flog.new()
       flogger.flog_files(files)
       failures = reject_success(flogger.totals, options)
@@ -15,6 +34,10 @@ module Flogger
     end
     
     
+    def assert_floq_rails(*args)
+      assert_flog([RAILS_ROOT] + args)
+    end
+    
     
     private
     
@@ -35,7 +58,8 @@ module Flogger
     def build_flog_message(failures, options)
       message = ['Error when flogging your files:']
       failures.each do |key, value|
-        message &lt;&lt; &quot;#{key.ljust(40, ' ')} has a flog score of #{value} (exceeding limit of #{options[:limit]} by #{value - options[:limit]})&quot;
+        limit = treshold_for_key(key, options)
+        message &lt;&lt; &quot;#{key.ljust(40, ' ')} has a flog score of #{value} (exceeding treshold of #{limit} by #{value - limit})&quot;
       end
       message.join(&quot;\n&quot;)
     end
@@ -45,9 +69,16 @@ module Flogger
     #
     def reject_success(totals, options)
       totals.reject do |key, value| 
-        value &lt; options[:limit]
+        value &lt; treshold_for_key(key, options)
       end
     end
+    
+    
+    def treshold_for_key(key, options)
+      options.has_key?(:tresholds) &amp;&amp; options[:tresholds].has_key?(key) ? 
+        options[:tresholds][key] : options[:treshold]
+    end
+
   end
 end
 </diff>
      <filename>lib/flogger/assertions.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,18 +9,26 @@ module Flogger::InstanceMethods
   end
 end
 
-class TestChronic &lt; Test::Unit::TestCase
-  
-  def setup
-   
+class TestAssertions &lt; Test::Unit::TestCase
+  def test_assert_flog_raises
+    assert_raise(Test::Unit::AssertionFailedError) do
+      assert_flog(__FILE__) 
+    end
   end
-
   
-  def test_assert_flog
-    assert_flog(__FILE__, :limit =&gt; 0)
+  # flog score of &gt; 9
+  def test_tresholds
+    assert_raise(Test::Unit::AssertionFailedError) do
+      assert_flog(__FILE__, :treshold =&gt; 10) 
+    end
+    assert_raise(Test::Unit::AssertionFailedError) do
+      assert_flog(__FILE__, :treshold =&gt; 30, :tresholds =&gt; {'TestAssertions#test_extract_files_and_options' =&gt; 20}) 
+    end
+    
+    assert_flog(__FILE__, :treshold =&gt; 10, :tresholds =&gt; {'TestAssertions#test_extract_files_and_options' =&gt; 23})
   end
   
-  
+  # flog score of &gt; 22
   def test_extract_files_and_options
     files, options = public_extract_files_and_options('some')
     assert_equal(['some'], files)
@@ -34,6 +42,10 @@ class TestChronic &lt; Test::Unit::TestCase
     files, options = public_extract_files_and_options('some', 'other', :key =&gt; :value)
     assert_equal(['some', 'other'], files)
     assert_equal({:key =&gt; :value}, options)
+    
+    files, options = public_extract_files_and_options('some', 'other', {})
+    assert_equal(['some', 'other'], files)
+    assert_equal({}, options)
   end
 end
 </diff>
      <filename>test/test_assertions.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>dbe6cfe7f4bb295a3c7a0adb310e88138270fa77</id>
    </parent>
  </parents>
  <author>
    <name>pascalbetz</name>
    <email>pascal.betz@simplificator.com</email>
  </author>
  <url>http://github.com/simplificator/flogger/commit/704f6ae5fbf6c9a8d81eac8c04d8180f73e391b1</url>
  <id>704f6ae5fbf6c9a8d81eac8c04d8180f73e391b1</id>
  <committed-date>2008-09-11T01:44:21-07:00</committed-date>
  <authored-date>2008-09-11T01:44:21-07:00</authored-date>
  <message>added tests for myself</message>
  <tree>ab0340e80ac37e52b53198071de3c0f48bc018b0</tree>
  <committer>
    <name>pascalbetz</name>
    <email>pascal.betz@simplificator.com</email>
  </committer>
</commit>
