<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -0,0 +1,33 @@
+= NameNanny
+
+I needed functionality to encourage user&#8217;s to be on their best behavior when they choosing a username or filling out a form. Bad behavior can come in many forms but specifically, I wanted to prevent people from registering usernames like &#8220;administrator&#8221;, &#8220;root&#8221;, &#8220;abuse&#8221;,&#8221;support&#8221; etc. I also didn&#8217;t want people to pick names like &#8220;whore&#8221; or even &#8220;hoar&#8221;,&#8221;h0ar&#8221;,&#8221;wh0r3&#8221; (you get the picture). It occurred to me that others would like this functionality too, so I created the name_nanny plug-in which can be employed in a couple of ways.
+
+== Example usage
+
+In the model you can use:
+
+  validates_wholesomeness_of :login
+
+This will check the login against values in two text files in the plug-in directory &#8220;badwords.txt&#8221;, and &#8220;restrictedwords.txt&#8221;. By default a match returns an non-descript error like &#8220;this username is already taken&#8221;. I chose a generalized error to dissuade users from trying to hack around the filter and find a word i missed.
+
+If you are filtering the body of text you may want to allow words like &#8220;administrator&#8221; in the body of the document. Therefore namenanny has a second method called &#8220;bleeptext&#8221;, which you can use thusly:
+def before_save
+    %w(description, title, author, tags).each do |column| 
+      if self[column.to_sym]
+        self[column.to_sym] = bleep_text(self[column.to_sym])
+      end
+    end
+  end
+
+A sample output might look like this:
+
+p = Post.new
+p.description = &quot;Step two: put your dick in a box.&quot;
+p.save
+puts p.description = &quot;Step two: put your bleeep in a box.&quot;
+
+You can also replace the bleeptext method with a smurftext method, which produces an equally hilarious: &#8220;Step two: put your smurf in a box.&#8221;
+
+== Authors, credits, contact
+Authors::                Mark Daggett
+Original announcement::  http://locusfoc.us/2007/2/13/name-nanny-plugin</diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 # The Name Nanny makes sure that users behave themselves when on the system.
 module NameNanny
-  RESERVED_NAMES = (IO.readlines RAILS_ROOT + '/vendor/plugins/name_nanny/lib/reserved_words.txt').each { |w| w.chop! }.freeze
-  BAD_WORDS      = (IO.readlines RAILS_ROOT + '/vendor/plugins/name_nanny/lib/bad_words.txt').each { |w| w.chop! }.freeze
+  RESERVED_NAMES = (IO.readlines RAILS_ROOT + '/vendor/plugins/name_nanny/lib/reserved_words.txt').each { |w| w.chop! }
+  BAD_WORDS      = (IO.readlines RAILS_ROOT + '/vendor/plugins/name_nanny/lib/bad_words.txt').each { |w| w.chop! }
   
   # Use a non-descript error to prevent the users from trying to hack around the filter.
   # Hopefully, they will just give up and choose something nicer.</diff>
      <filename>lib/name_nanny.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>55e9e2b15d6aa9c084fc3d89eeadecd11e564189</id>
    </parent>
  </parents>
  <author>
    <name>heavysixer</name>
    <email>heavysixer@gmail.com</email>
  </author>
  <url>http://github.com/heavysixer/name_nanny/commit/58ab5de0d2b84503c62bc02e29a8b9ee2f431915</url>
  <id>58ab5de0d2b84503c62bc02e29a8b9ee2f431915</id>
  <committed-date>2008-05-29T11:50:16-07:00</committed-date>
  <authored-date>2008-05-29T11:50:16-07:00</authored-date>
  <message>Added a proper README and removed the .freeze statement because it appeard to be causing a memory leak according to bleakhouse.</message>
  <tree>ec0b4f3f3e15954e2a1a247c12da828b6cd7de41</tree>
  <committer>
    <name>heavysixer</name>
    <email>heavysixer@gmail.com</email>
  </committer>
</commit>
