<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>.gitignore</filename>
    </added>
    <added>
      <filename>lib/simplest_auth/version.rb</filename>
    </added>
    <added>
      <filename>simplest_auth.gemspec</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,4 +1,4 @@
-Copyright (c) 2008 Tony Pitale and Matt Swasey of Viget Labs
+Copyright (c) 2008 Tony Pitale of Viget Labs
 
 Permission is hereby granted, free of charge, to any person obtaining
 a copy of this software and associated documentation files (the</diff>
      <filename>MIT-LICENSE</filename>
    </modified>
    <modified>
      <diff>@@ -1,22 +1,51 @@
-require 'rake'
+require 'rubygems'
+require 'rake/gempackagetask'
 require 'rake/testtask'
-require 'rake/rdoctask'
 
-desc 'Default: run unit tests.'
+require 'lib/simplest_auth/version'
+
 task :default =&gt; :test
 
-desc 'Test the simplest_auth plugin.'
-Rake::TestTask.new(:test) do |t|
-  t.libs &lt;&lt; 'lib'
-  t.pattern = 'test/**/*_test.rb'
+spec = Gem::Specification.new do |s|
+  s.name            = 'simplest_auth'
+  s.version         = SimplestAuth::Version.to_s
+  s.summary         = &quot;Simple implementation of authentication for Rails&quot;
+  s.author          = 'Tony Pitale'
+  s.email           = 'tony.pitale@viget.com'
+  s.homepage        = 'http://viget.com/extend'
+  s.files           = %w(README.textile Rakefile) + Dir.glob(&quot;lib/**/*&quot;)
+  s.test_files      = Dir.glob(&quot;test/**/*_test.rb&quot;)
+  
+  s.add_dependency('bcrypt-ruby', '~&gt; 2.0.5')
+end
+
+Rake::GemPackageTask.new(spec) do |pkg|
+  pkg.gem_spec = spec
+end
+
+Rake::TestTask.new do |t|
+  t.libs &lt;&lt; 'test'
+  t.test_files = FileList[&quot;test/**/*_test.rb&quot;]
   t.verbose = true
 end
 
-desc 'Generate documentation for the simplest_auth plugin.'
-Rake::RDocTask.new(:rdoc) do |rdoc|
-  rdoc.rdoc_dir = 'rdoc'
-  rdoc.title    = 'SimplestAuth'
-  rdoc.options &lt;&lt; '--line-numbers' &lt;&lt; '--inline-source'
-  rdoc.rdoc_files.include('README')
-  rdoc.rdoc_files.include('lib/**/*.rb')
+desc 'Generate the gemspec to serve this Gem from Github'
+task :github do
+  file = File.dirname(__FILE__) + &quot;/#{spec.name}.gemspec&quot;
+  File.open(file, 'w') {|f| f &lt;&lt; spec.to_ruby }
+  puts &quot;Created gemspec: #{file}&quot;
+end
+
+begin
+  require 'rcov/rcovtask'
+  
+  desc &quot;Generate RCov coverage report&quot;
+  Rcov::RcovTask.new(:rcov) do |t|
+    t.test_files = FileList['test/**/*_test.rb']
+    t.rcov_opts &lt;&lt; &quot;-x lib/simplest_auth.rb -x lib/simplest_auth/version.rb&quot;
+  end
+rescue LoadError
+  nil
 end
+
+task :default =&gt; 'test'</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -55,5 +55,25 @@ class UserTest &lt; Test::Unit::TestCase
       
       @user.authentic?('password')
     end
+
+    should &quot;hash a password using bcrypt&quot; do
+      @user.stubs(:password_required?).returns(true)
+      @user.expects(:crypted_password=).with('abcdefg')
+      @user.password = 'password'
+      Password.expects(:create).with('password').returns('abcdefg')
+
+      @user.send(:hash_password)
+    end
+
+    should &quot;require a password if crypted password is blank&quot; do
+      @user.stubs(:crypted_password).returns(stub(:blank? =&gt; true))
+      assert_equal true, @user.send(:password_required?)
+    end
+
+    should &quot;require a password if a password has been set&quot; do
+      @user.stubs(:crypted_password).returns(stub(:blank? =&gt; false))
+      @user.stubs(:password).returns(stub(:blank? =&gt; false))
+      assert_equal true, @user.send(:password_required?)
+    end
   end
 end</diff>
      <filename>test/unit/simplest_auth/model_test.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>init.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>4c5326430926f6e974308c6d8628d139a635b3aa</id>
    </parent>
  </parents>
  <author>
    <name>tpitale</name>
    <email>tpitale@gmail.com</email>
  </author>
  <url>http://github.com/vigetlabs/simplest_auth/commit/8d847d5476cb68ec24624c915d2e6dd82fbb7f25</url>
  <id>8d847d5476cb68ec24624c915d2e6dd82fbb7f25</id>
  <committed-date>2009-05-03T10:10:36-07:00</committed-date>
  <authored-date>2009-05-03T10:10:36-07:00</authored-date>
  <message>made into a gem, test coverage at 100%</message>
  <tree>7bfd85e2ae5f004151ab08e0fb215ae05cc253d5</tree>
  <committer>
    <name>tpitale</name>
    <email>tpitale@gmail.com</email>
  </committer>
</commit>
