<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -2,40 +2,64 @@
 
 == DESCRIPTION
 
-ignore_nil lets you happily ignore nil methods on long method chains.  Keeps code pretty and much safer than &quot;rescue nil&quot;, since it only catches NoMethodError on nil objects.
+ignore_nil lets you happily ignore nil methods on long method chains.  Keeps code pretty and much
+safer than &quot;rescue nil&quot;, since it only catches NoMethodError on nil objects.
 
-ignore_nil {} will either return the last thing evaluated in the block, or nil if a NoMethodError is raised calling a method on a nil object.  Any other exceptions raised in the block are not handled, and left for the application to resolve.
+ignore_nil {} will either return the last thing evaluated in the block, or nil if a NoMethodError
+is raised calling a method on a nil object.  Any other exceptions raised in the block are not handled,
+and left for the application to resolve.  More details below.
 
 == INSTALLATION
 
 as a gem:
-  sudo gem install ssoroka-ignore_nil
+
+    sudo gem install ssoroka-ignore_nil
 
 as a plugin:
-  script/plugin install git://github.com/ssoroka/ignore_nil.git
+
+    script/plugin install git://github.com/ssoroka/ignore_nil.git
   
 == USAGE
 
-  ignore_nil { user.profile.photo }
+    ignore_nil { user.profile.photo }
   
 which is much cleaner than, say,
 
-  user &amp;&amp; user.profile &amp;&amp; user.profile.photo
+    user &amp;&amp; user.profile &amp;&amp; user.profile.photo
   
 and much much safer than
 
-  user.profile.photo rescue nil
+    user.profile.photo rescue nil
   
 which will eat any error, even if it's one you really want to see.
 
-== HELP!
+== TELL ME MORE!
+
+The plugin is really rather simple; here's the ignore_nil method:
+
+    def ignore_nil(&amp;block)
+      begin
+        yield
+      rescue NoMethodError, RuntimeError =&gt; e
+        if (e.message =~ /You have a nil object when you didn't expect it/) ||
+            (e.message =~ /undefined method `.*?' for nil:NilClass/) || (e.message =~ /^Called id for nil/)
+          return nil
+        else
+          raise e
+        end
+      end
+    end
+
+What's interesting about this is it catches both NoMethodError and RuntimeError, both of which
+can occur if a method unexpectedly returned nil and you called a method on it, but *ONLY* if
+the error message matches!  This means legitimate NoMethodError and RuntimeError messages will
+not be bothered by ignore_nil, and will still raise in your application as you expect.
 
-I really think this is much better than the new try() syntax in Rails 2.3.
-If you use and like this gem, please +1 it here:
-https://rails.lighthouseapp.com/projects/8994/tickets/2364-ignore_nil-as-a-better-alternative-to-try
+I've used this in a production application since about mid/late 2008, I'd consider it very stable.
+Feedback welcome!
 
 == AUTHOR
 
 Steven Soroka
-http://www.twitter.com/ssoroka
-http://blog.stevensoroka.ca
\ No newline at end of file
+[@ssoroka](http://www.twitter.com/ssoroka)
+[http://blog.stevensoroka.ca](http://blog.stevensoroka.ca)
\ No newline at end of file</diff>
      <filename>README.rdoc</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,7 @@ require 'rubygems'
 require 'rake'
 require 'echoe'
 
-Echoe.new('ignore_nil', '1.0.1') do |p|
+Echoe.new('ignore_nil', '1.0.2') do |p|
   p.description = 'ignore_nil lets you happily ignore nil methods on long method chains.  Keeps code pretty and much safer than &quot;rescue nil&quot;, since it only catches NoMethodError on nil objects'
   p.url = 'http://github.com/ssoroka/ignore_nil'
   p.author = 'Steven Soroka'</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -1,28 +1,29 @@
+# -*- encoding: utf-8 -*-
+
 Gem::Specification.new do |s|
   s.name = %q{ignore_nil}
-  s.version = &quot;1.0.1&quot;
+  s.version = &quot;1.0.2&quot;
 
   s.required_rubygems_version = Gem::Requirement.new(&quot;&gt;= 1.2&quot;) if s.respond_to? :required_rubygems_version=
   s.authors = [&quot;Steven Soroka&quot;]
-  s.date = %q{2008-12-11}
+  s.date = %q{2009-09-23}
   s.description = %q{ignore_nil lets you happily ignore nil methods on long method chains.  Keeps code pretty and much safer than &quot;rescue nil&quot;, since it only catches NoMethodError on nil objects}
   s.email = %q{ssoroka78@gmail.com}
   s.extra_rdoc_files = [&quot;lib/ignore_nil.rb&quot;, &quot;README.rdoc&quot;]
   s.files = [&quot;ignore_nil.gemspec&quot;, &quot;init.rb&quot;, &quot;lib/ignore_nil.rb&quot;, &quot;Manifest&quot;, &quot;Rakefile&quot;, &quot;README.rdoc&quot;, &quot;test/ignore_nil_test.rb&quot;]
-  s.has_rdoc = true
   s.homepage = %q{http://github.com/ssoroka/ignore_nil}
   s.rdoc_options = [&quot;--line-numbers&quot;, &quot;--inline-source&quot;, &quot;--title&quot;, &quot;Ignore_nil&quot;, &quot;--main&quot;, &quot;README.rdoc&quot;]
   s.require_paths = [&quot;lib&quot;]
   s.rubyforge_project = %q{ignore_nil}
-  s.rubygems_version = %q{1.2.0}
+  s.rubygems_version = %q{1.3.3}
   s.summary = %q{ignore_nil lets you happily ignore nil methods on long method chains.  Keeps code pretty and much safer than &quot;rescue nil&quot;, since it only catches NoMethodError on nil objects}
   s.test_files = [&quot;test/ignore_nil_test.rb&quot;]
 
   if s.respond_to? :specification_version then
     current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
-    s.specification_version = 2
+    s.specification_version = 3
 
-    if current_version &gt;= 3 then
+    if Gem::Version.new(Gem::RubyGemsVersion) &gt;= Gem::Version.new('1.2.0') then
     else
     end
   else</diff>
      <filename>ignore_nil.gemspec</filename>
    </modified>
    <modified>
      <diff>@@ -1 +1 @@
-require File.join(File.dirname(__FILE__),'lib','ignore_nil.rb')
\ No newline at end of file
+require File.join(File.dirname(__FILE__), 'lib', 'ignore_nil')
\ No newline at end of file</diff>
      <filename>init.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>dcc2936c1eac8e027554a2e2f24ce1cbd7f66c12</id>
    </parent>
  </parents>
  <author>
    <name>Steven Soroka</name>
    <email>ssoroka78@gmail.com</email>
  </author>
  <url>http://github.com/ssoroka/ignore_nil/commit/514620f957f95aaa83590a07ae1244ace15b68ae</url>
  <id>514620f957f95aaa83590a07ae1244ace15b68ae</id>
  <committed-date>2009-09-22T23:42:16-07:00</committed-date>
  <authored-date>2009-09-22T23:42:16-07:00</authored-date>
  <message>update README with some more details. bump to 1.0.2 just for the heck of it.</message>
  <tree>dbbe1fe1dc2f628c59c196b5cfec546806d2e247</tree>
  <committer>
    <name>Steven Soroka</name>
    <email>ssoroka78@gmail.com</email>
  </committer>
</commit>
