<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/dm_session_store/session_store.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -6,6 +6,9 @@ For those using DataMapper with Rails there was no option for storing sessions
 in a database (most people remove ActiveRecord). This little gem adds the
 required classes to use DataMapper to store sessions in the database.
 
+Now supports Rails &gt;= 2.3.0 in version 0.2.0. If you need support before that,
+try version 0.1.0.
+
 h2. Installation
 
   sudo gem install tpitale-dm_session_store
@@ -15,7 +18,10 @@ h2. Usage
 In Rails config/environment.rb
 
   config.gem 'tpitale-dm_session_store, :lib =&gt; 'dm_session_store'
-  config.action_controller.session_store = CGI::Session::DMSessionStore
+
+In the session_store initializer:
+
+  ActionController::Base.session_store = DataMapper::SessionStore
 
 Obviously, for this to work, you had better follow one of the many online
 resources for using DataMapper with Rails.</diff>
      <filename>README.textile</filename>
    </modified>
    <modified>
      <diff>@@ -17,6 +17,7 @@ spec = Gem::Specification.new do |s|
   s.test_files      = Dir.glob(&quot;test/**/*_test.rb&quot;)
   
   s.add_dependency('dm-core', '~&gt; 0.9.11')
+  s.add_dependency('actionpack', '~&gt; 2.3.0')
 end
 
 Rake::GemPackageTask.new(spec) do |pkg|</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,3 @@
 $:.unshift File.dirname(__FILE__)
 
-require 'dm_session_store/session_ext'
+require 'dm_session_store/session_store'</diff>
      <filename>lib/dm_session_store.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,7 @@ module DmSessionStore
   module Version
     
     MAJOR = 0
-    MINOR = 1
+    MINOR = 2
     TINY  = 0
     
     def self.to_s # :nodoc:</diff>
      <filename>lib/dm_session_store/version.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,5 +5,6 @@ require 'rubygems'
 require 'test/unit'
 require 'shoulda'
 require 'mocha'
+require 'action_controller' # version &gt;= 2.3.0
 
 require File.dirname(__FILE__) + '/../lib/dm_session_store'
\ No newline at end of file</diff>
      <filename>test/test_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,61 +1,35 @@
 require File.join(File.dirname(__FILE__), &quot;..&quot;, &quot;test_helper&quot;)
-require 'cgi'
-require 'cgi/session'
 
-class CGI
-  class Session
-
-    class DMSessionStoreTest &lt; Test::Unit::TestCase
-      context &quot;The DMSessionStore initialize method&quot; do
-        should &quot;raise CGI:Session::NoSession if session is not a new_session&quot; do
-          DMSessionStore::DMSession.stubs(:find_by_session_id).with(&quot;1&quot;).returns(nil)
-          session = DMSessionStore::DMSession.new(:session_id =&gt; &quot;1&quot;)
-          session.stubs(:new_session).with().returns(false)
-          assert_raise CGI::Session::NoSession, &quot;uninitialized session&quot; do
-            DMSessionStore.new(session)
-          end
-        end
+module DataMapper
+  class SessionStoreTest &lt; Test::Unit::TestCase
+    context &quot;An instance of the SessionStore class&quot; do
+      setup do
+        @session_klass = SessionStore::Session
+        @session_store = SessionStore.new('app')
       end
 
-      context &quot;An instance of the DMSessionStore class&quot; do
-        setup do
-          @session = DMSessionStore::DMSession.new(:session_id =&gt; &quot;1&quot;, :data =&gt; {:hello =&gt; 'world'})
-          DMSessionStore::DMSession.stubs(:find_by_session_id).with(&quot;1&quot;).returns(nil)
-          old_session = DMSessionStore::DMSession.new(:session_id =&gt; &quot;1&quot;)
-          old_session.stubs(:new_session).with().returns(true)
-          DMSessionStore::DMSession.stubs(:new).with(:session_id =&gt; &quot;1&quot;, :data =&gt; {}).returns(@session)
-          @session_store = DMSessionStore.new(old_session)
-        end
-
-        should &quot;have the session&quot; do
-          assert_equal @session, @session_store.model
-        end
-
-        should &quot;return the data from session&quot; do
-          assert_equal({:hello =&gt; 'world'}, @session_store.restore)
-        end
-
-        should &quot;save the session&quot; do
-          @session.expects(:save).with().returns(true)
-          assert_equal true, @session_store.update
-        end
-
-        should &quot;save and unreference the session&quot; do
-          @session_store.expects(:update)
-          @session_store.close
-          assert_equal nil, @session_store.model
-        end
+      should &quot;get a session&quot; do
+        env = {}
+        session = stub(:data =&gt; 'data')
+        @session_store.expects(:find_session).with(1).returns(session)
+        assert_equal([1, 'data'], @session_store.send(:get_session, env, 1))
+        assert_equal({'rack.session.record' =&gt; session}, env)
+      end
 
-        should &quot;destroy and unreference the session&quot; do
-          @session.expects(:destroy)
-          @session_store.delete
-          assert_equal nil, @session_store.model
-        end
+      should &quot;set a session&quot; do
+        env = {}
+        session = stub
+        session.expects(:data=).with({:color =&gt; 'yellow'})
+        session.stubs(:save).returns(true)
+        @session_store.expects(:find_session).with(1).returns(session)
+        assert @session_store.send(:set_session, env, 1, {:color =&gt; 'yellow'})
+        assert_equal({'rack.session.record' =&gt; session}, env)
+      end
 
-        should &quot;log with DataMapper&quot; do
-          DataMapper::Logger.expects(:new).with(STDERR, :fatal).returns('logger')
-          assert_equal 'logger', @session_store.send(:logger)
-        end
+      should &quot;find a session&quot; do
+        @session_klass.expects(:first).with(:session_id =&gt; 1).returns(nil)
+        @session_klass.expects(:new).with(:session_id =&gt; 1, :data =&gt; {}).returns('session')
+        assert_equal 'session', @session_store.send(:find_session, 1)
       end
     end
   end</diff>
      <filename>test/unit/dm_session_store_test.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>lib/dm_session_store/session_ext.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>5cc7764837e4d2d990b97cb505fb6e87c887cf05</id>
    </parent>
  </parents>
  <author>
    <name>tpitale</name>
    <email>tpitale@gmail.com</email>
  </author>
  <url>http://github.com/tpitale/dm_session_store/commit/1f6fd9990ac471835efe5bdab4f70c05b265be90</url>
  <id>1f6fd9990ac471835efe5bdab4f70c05b265be90</id>
  <committed-date>2009-05-03T11:36:43-07:00</committed-date>
  <authored-date>2009-05-03T11:34:52-07:00</authored-date>
  <message>major updates to work with Rails &gt;= 2.3.0
updated readme and version to 0.2.0</message>
  <tree>6b0c7baf3d5bfd38f1788b2712c645bf3adc8ea2</tree>
  <committer>
    <name>tpitale</name>
    <email>tpitale@gmail.com</email>
  </committer>
</commit>
