mongo_session_store-rails3 3.0.5 → 3.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -54,7 +54,15 @@ group :development, :test do
54
54
  gem 'ruby-debug', :platforms => :ruby_18
55
55
  gem 'ruby-debug19', :platforms => :ruby_19
56
56
 
57
- gem 'sqlite3' # for devise User storage
57
+ if RUBY_PLATFORM == 'java'
58
+ gem 'jdbc-sqlite3'
59
+ gem 'activerecord-jdbc-adapter'
60
+ gem 'activerecord-jdbcsqlite3-adapter'
61
+ gem 'jruby-openssl'
62
+ gem 'jruby-rack'
63
+ else
64
+ gem 'sqlite3' # for devise User storage
65
+ end
58
66
  RAILS_VERS ? gem('rails', RAILS_VERS) : gem('rails')
59
67
  gem 'rspec-rails'
60
68
  gem 'devise'
@@ -11,6 +11,8 @@ begin
11
11
  include Mongoid::Timestamps
12
12
  self.collection_name = MongoSessionStore.collection_name
13
13
 
14
+ attr_accessible :_id, :data
15
+
14
16
  if respond_to?(:identity)
15
17
  # pre-Mongoid 3
16
18
  identity :type => String
@@ -1,3 +1,3 @@
1
1
  module MongoSessionStore
2
- VERSION = "3.0.5"
2
+ VERSION = "3.0.6"
3
3
  end
@@ -1,18 +1,17 @@
1
1
  require 'benchmark'
2
2
  require 'rubygems'
3
3
  require 'bundler/setup'
4
-
5
- Bundler.require(:development)
6
-
7
4
  require 'action_dispatch'
8
- require File.join(File.dirname(__FILE__),'..','lib','mongo_session_store-rails3')
5
+ require File.expand_path('../../lib/mongo_session_store-rails3', __FILE__)
9
6
 
10
7
  MongoMapper.database = "test_session_stores"
11
- Mongoid.database = Mongo::Connection.new.db("test_session_stores")
8
+ # get around Mongoid's unnecessary "requires MongoDB 2.0.0" error which is NOT triggered when loading from mongo.yml!
9
+ Mongoid.config.from_hash('database' => "test_session_stores", 'logger' => false)
12
10
 
13
11
  RUNS = 2000
14
12
 
15
13
  def benchmark(test_name, &block)
14
+ sleep 2 # cool off for my poor laptop
16
15
  time = Benchmark.realtime do
17
16
  RUNS.times do
18
17
  yield
@@ -43,6 +43,7 @@ describe Devise::SessionsController do
43
43
  response.status.should == 302
44
44
  get response.redirect_url
45
45
  response.body.squish.should =~ /You are logged in as person@example.com/
46
+ response.body.squish.should =~ /You have signed up successfully/
46
47
  end
47
48
 
48
49
  it "allows user logout" do
@@ -51,6 +52,7 @@ describe Devise::SessionsController do
51
52
  logout
52
53
  response.status.should == 302
53
54
  i_should_not_be_logged_in
55
+ response.body.squish.should =~ /Signed out successfully/
54
56
  end
55
57
 
56
58
  it "allows user login" do
@@ -60,6 +62,7 @@ describe Devise::SessionsController do
60
62
  login
61
63
  response.status.should == 302
62
64
  i_should_be_logged_in
65
+ response.body.squish.should =~ /Signed in successfully/
63
66
  end
64
67
 
65
68
  it "uses the right session store class" do
@@ -1,11 +1,11 @@
1
1
  test:
2
- adapter: sqlite3
2
+ adapter: <%= RUBY_PLATFORM == 'java' ? 'jdbcsqlite3' : 'sqlite3' %>
3
3
  database: db/test.sqlite3
4
4
  pool: 5
5
5
  timeout: 5000
6
6
 
7
7
  development:
8
- adapter: sqlite3
8
+ adapter: <%= RUBY_PLATFORM == 'java' ? 'jdbcsqlite3' : 'sqlite3' %>
9
9
  database: db/development.sqlite3
10
10
  pool: 5
11
11
  timeout: 5000
@@ -1,11 +1,11 @@
1
1
  test:
2
- adapter: sqlite3
2
+ adapter: <%= RUBY_PLATFORM == 'java' ? 'jdbcsqlite3' : 'sqlite3' %>
3
3
  database: db/test.sqlite3
4
4
  pool: 5
5
5
  timeout: 5000
6
6
 
7
7
  development:
8
- adapter: sqlite3
8
+ adapter: <%= RUBY_PLATFORM == 'java' ? 'jdbcsqlite3' : 'sqlite3' %>
9
9
  database: db/development.sqlite3
10
10
  pool: 5
11
11
  timeout: 5000
@@ -1,11 +1,11 @@
1
1
  test:
2
- adapter: sqlite3
2
+ adapter: <%= RUBY_PLATFORM == 'java' ? 'jdbcsqlite3' : 'sqlite3' %>
3
3
  database: db/test.sqlite3
4
4
  pool: 5
5
5
  timeout: 5000
6
6
 
7
7
  development:
8
- adapter: sqlite3
8
+ adapter: <%= RUBY_PLATFORM == 'java' ? 'jdbcsqlite3' : 'sqlite3' %>
9
9
  database: db/development.sqlite3
10
10
  pool: 5
11
11
  timeout: 5000
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongo_session_store-rails3
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 11
5
5
  prerelease:
6
6
  segments:
7
7
  - 3
8
8
  - 0
9
- - 5
10
- version: 3.0.5
9
+ - 6
10
+ version: 3.0.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Brian Hempel
@@ -18,7 +18,7 @@ autorequire:
18
18
  bindir: bin
19
19
  cert_chain: []
20
20
 
21
- date: 2012-02-24 00:00:00 Z
21
+ date: 2012-04-03 00:00:00 Z
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency
24
24
  name: mongo
@@ -267,7 +267,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
267
267
  requirements: []
268
268
 
269
269
  rubyforge_project:
270
- rubygems_version: 1.8.15
270
+ rubygems_version: 1.8.17
271
271
  signing_key:
272
272
  specification_version: 3
273
273
  summary: Rails session stores for MongoMapper, Mongoid, or any other ODM. Rails 3.0, 3.1, and 3.2 compatible.