mongo_session_store 3.1.0 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +56 -14
- data/CHANGELOG.md +12 -2
- data/README.md +7 -1
- data/gemfiles/rails-4.0-mongo.gemfile +1 -1
- data/gemfiles/rails-4.0-mongoid.gemfile +1 -1
- data/gemfiles/rails-4.1-mongo.gemfile +1 -1
- data/gemfiles/rails-4.1-mongoid.gemfile +1 -1
- data/gemfiles/rails-4.2-mongo.gemfile +1 -1
- data/gemfiles/rails-4.2-mongoid.gemfile +1 -1
- data/gemfiles/rails-5.0-mongo.gemfile +1 -1
- data/gemfiles/rails-5.0-mongoid.gemfile +1 -1
- data/gemfiles/rails-5.1-mongo.gemfile +9 -0
- data/gemfiles/rails-5.1-mongoid.gemfile +9 -0
- data/gemfiles/rails-5.2-mongo.gemfile +9 -0
- data/gemfiles/rails-5.2-mongoid.gemfile +9 -0
- data/lib/mongo_session_store.rb +2 -0
- data/lib/mongo_session_store/mongo_store.rb +1 -1
- data/lib/mongo_session_store/version.rb +1 -1
- data/mongo_session_store.gemspec +2 -1
- data/spec/integrations/devise_spec.rb +17 -2
- data/spec/rails_helper.rb +4 -1
- data/spec/support/apps/rails_4.0_app/app/views/home/index.html.erb +5 -6
- data/spec/support/apps/rails_4.1_app/app/views/home/index.html.erb +5 -6
- data/spec/support/apps/rails_4.2_app/app/views/home/index.html.erb +3 -4
- data/spec/support/apps/rails_5.0_app/app/views/home/index.html.erb +3 -4
- data/spec/support/apps/rails_5.1_app/Rakefile +6 -0
- data/spec/support/apps/rails_5.1_app/app/controllers/application_controller.rb +3 -0
- data/spec/support/apps/rails_5.1_app/app/controllers/home_controller.rb +2 -0
- data/spec/support/apps/rails_5.1_app/app/models/application_record.rb +3 -0
- data/spec/support/apps/rails_5.1_app/app/models/user.rb +5 -0
- data/spec/support/apps/rails_5.1_app/app/views/home/index.html.erb +9 -0
- data/spec/support/apps/rails_5.1_app/app/views/layouts/application.html.erb +15 -0
- data/spec/support/apps/rails_5.1_app/bin/bundle +3 -0
- data/spec/support/apps/rails_5.1_app/bin/rails +4 -0
- data/spec/support/apps/rails_5.1_app/bin/rake +4 -0
- data/spec/support/apps/rails_5.1_app/bin/setup +34 -0
- data/spec/support/apps/rails_5.1_app/bin/update +29 -0
- data/spec/support/apps/rails_5.1_app/config.ru +5 -0
- data/spec/support/apps/rails_5.1_app/config/application.rb +12 -0
- data/spec/support/apps/rails_5.1_app/config/boot.rb +5 -0
- data/spec/support/apps/rails_5.1_app/config/database.yml +11 -0
- data/spec/support/apps/rails_5.1_app/config/environment.rb +5 -0
- data/spec/support/apps/rails_5.1_app/config/environments/development.rb +12 -0
- data/spec/support/apps/rails_5.1_app/config/environments/test.rb +19 -0
- data/spec/support/apps/rails_5.1_app/config/initializers/devise.rb +254 -0
- data/spec/support/apps/rails_5.1_app/config/initializers/session_store.rb +1 -0
- data/spec/support/apps/rails_5.1_app/config/locales/en.yml +23 -0
- data/spec/support/apps/rails_5.1_app/config/mongo.yml +11 -0
- data/spec/support/apps/rails_5.1_app/config/mongoid.yml +13 -0
- data/spec/support/apps/rails_5.1_app/config/routes.rb +4 -0
- data/spec/support/apps/rails_5.1_app/config/secrets.yml +22 -0
- data/spec/support/apps/rails_5.1_app/db/migrate/20140301171212_add_devise_users.rb +11 -0
- data/spec/support/apps/rails_5.1_app/db/schema.rb +23 -0
- data/spec/support/apps/rails_5.1_app/log/.keep +0 -0
- data/spec/support/apps/rails_5.2_app/Rakefile +6 -0
- data/spec/support/apps/rails_5.2_app/app/controllers/application_controller.rb +3 -0
- data/spec/support/apps/rails_5.2_app/app/controllers/home_controller.rb +2 -0
- data/spec/support/apps/rails_5.2_app/app/models/application_record.rb +3 -0
- data/spec/support/apps/rails_5.2_app/app/models/user.rb +5 -0
- data/spec/support/apps/rails_5.2_app/app/views/home/index.html.erb +9 -0
- data/spec/support/apps/rails_5.2_app/app/views/layouts/application.html.erb +15 -0
- data/spec/support/apps/rails_5.2_app/bin/bundle +3 -0
- data/spec/support/apps/rails_5.2_app/bin/rails +4 -0
- data/spec/support/apps/rails_5.2_app/bin/rake +4 -0
- data/spec/support/apps/rails_5.2_app/bin/setup +34 -0
- data/spec/support/apps/rails_5.2_app/bin/update +29 -0
- data/spec/support/apps/rails_5.2_app/config.ru +5 -0
- data/spec/support/apps/rails_5.2_app/config/application.rb +12 -0
- data/spec/support/apps/rails_5.2_app/config/boot.rb +5 -0
- data/spec/support/apps/rails_5.2_app/config/database.yml +11 -0
- data/spec/support/apps/rails_5.2_app/config/environment.rb +5 -0
- data/spec/support/apps/rails_5.2_app/config/environments/development.rb +12 -0
- data/spec/support/apps/rails_5.2_app/config/environments/test.rb +19 -0
- data/spec/support/apps/rails_5.2_app/config/initializers/devise.rb +254 -0
- data/spec/support/apps/rails_5.2_app/config/initializers/session_store.rb +1 -0
- data/spec/support/apps/rails_5.2_app/config/locales/en.yml +23 -0
- data/spec/support/apps/rails_5.2_app/config/mongo.yml +11 -0
- data/spec/support/apps/rails_5.2_app/config/mongoid.yml +13 -0
- data/spec/support/apps/rails_5.2_app/config/routes.rb +4 -0
- data/spec/support/apps/rails_5.2_app/config/secrets.yml +22 -0
- data/spec/support/apps/rails_5.2_app/db/migrate/20140301171212_add_devise_users.rb +11 -0
- data/spec/support/apps/rails_5.2_app/db/schema.rb +23 -0
- data/spec/support/apps/rails_5.2_app/log/.keep +0 -0
- metadata +139 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 98a3bc915313a9b027a2c7483dec78a95f193838e48405319d54dcb24938a979
|
4
|
+
data.tar.gz: 1236cd6f4cdf7ca4b997a05bd12a749b3ad57ffac50688ddc38935fe959f7dd9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6cabedbc5554f3e0f7b6531191cd2db03a4b9ef45e1d5cc6b4bf49519a93e82618101c1945e089738310480c58fb6e910bf219416b053164751c7da8d8be7e41
|
7
|
+
data.tar.gz: f428bfafdea80679efe71b464233b18b32096ab22de94484c0ab1b8625f27f6f127170144c42fe4f9d8fe68c0173c6a6bc762725c08b7f00a63e5c4b5ebb4484
|
data/.travis.yml
CHANGED
@@ -1,11 +1,17 @@
|
|
1
|
+
branches:
|
2
|
+
only:
|
3
|
+
- master
|
4
|
+
- develop
|
1
5
|
language: ruby
|
2
6
|
|
3
7
|
cache: bundler
|
4
8
|
|
5
9
|
rvm:
|
6
10
|
- 2.1.10
|
7
|
-
- 2.3.
|
8
|
-
- 2.4.
|
11
|
+
- 2.3.8
|
12
|
+
- 2.4.5
|
13
|
+
- 2.5.5
|
14
|
+
- 2.6.3
|
9
15
|
|
10
16
|
gemfile:
|
11
17
|
- gemfiles/rails-4.0-mongo.gemfile
|
@@ -16,29 +22,65 @@ gemfile:
|
|
16
22
|
- gemfiles/rails-4.2-mongoid.gemfile
|
17
23
|
- gemfiles/rails-5.0-mongo.gemfile
|
18
24
|
- gemfiles/rails-5.0-mongoid.gemfile
|
25
|
+
- gemfiles/rails-5.1-mongo.gemfile
|
26
|
+
- gemfiles/rails-5.1-mongoid.gemfile
|
27
|
+
- gemfiles/rails-5.2-mongo.gemfile
|
28
|
+
- gemfiles/rails-5.2-mongoid.gemfile
|
19
29
|
|
20
30
|
matrix:
|
21
31
|
fast_finish: true
|
22
32
|
include:
|
23
|
-
- rvm: 2.
|
24
|
-
gemfile: gemfiles/rails-
|
33
|
+
- rvm: 2.5.5
|
34
|
+
gemfile: gemfiles/rails-5.2-mongo.gemfile
|
25
35
|
script: bundle exec rubocop
|
26
|
-
- rvm: 2.
|
27
|
-
gemfile: gemfiles/rails-
|
36
|
+
- rvm: 2.5.5
|
37
|
+
gemfile: gemfiles/rails-5.2-mongo.gemfile
|
28
38
|
script: bundle exec danger
|
29
39
|
exclude:
|
30
|
-
- rvm: 2.4.1
|
31
|
-
gemfile: gemfiles/rails-4.0-mongo.gemfile
|
32
|
-
- rvm: 2.4.1
|
33
|
-
gemfile: gemfiles/rails-4.0-mongoid.gemfile
|
34
|
-
- rvm: 2.4.1
|
35
|
-
gemfile: gemfiles/rails-4.1-mongo.gemfile
|
36
|
-
- rvm: 2.4.1
|
37
|
-
gemfile: gemfiles/rails-4.1-mongoid.gemfile
|
38
40
|
- rvm: 2.1.10
|
39
41
|
gemfile: gemfiles/rails-5.0-mongo.gemfile
|
40
42
|
- rvm: 2.1.10
|
41
43
|
gemfile: gemfiles/rails-5.0-mongoid.gemfile
|
44
|
+
- rvm: 2.1.10
|
45
|
+
gemfile: gemfiles/rails-5.1-mongo.gemfile
|
46
|
+
- rvm: 2.1.10
|
47
|
+
gemfile: gemfiles/rails-5.1-mongoid.gemfile
|
48
|
+
- rvm: 2.1.10
|
49
|
+
gemfile: gemfiles/rails-5.2-mongo.gemfile
|
50
|
+
- rvm: 2.1.10
|
51
|
+
gemfile: gemfiles/rails-5.2-mongoid.gemfile
|
52
|
+
- rvm: 2.4.5
|
53
|
+
gemfile: gemfiles/rails-4.0-mongo.gemfile
|
54
|
+
- rvm: 2.4.5
|
55
|
+
gemfile: gemfiles/rails-4.0-mongoid.gemfile
|
56
|
+
- rvm: 2.4.5
|
57
|
+
gemfile: gemfiles/rails-4.1-mongo.gemfile
|
58
|
+
- rvm: 2.4.5
|
59
|
+
gemfile: gemfiles/rails-4.1-mongoid.gemfile
|
60
|
+
- rvm: 2.5.5
|
61
|
+
gemfile: gemfiles/rails-4.0-mongo.gemfile
|
62
|
+
- rvm: 2.5.5
|
63
|
+
gemfile: gemfiles/rails-4.0-mongoid.gemfile
|
64
|
+
- rvm: 2.5.5
|
65
|
+
gemfile: gemfiles/rails-4.1-mongo.gemfile
|
66
|
+
- rvm: 2.5.5
|
67
|
+
gemfile: gemfiles/rails-4.1-mongoid.gemfile
|
68
|
+
- rvm: 2.5.5
|
69
|
+
gemfile: gemfiles/rails-4.2-mongo.gemfile
|
70
|
+
- rvm: 2.5.5
|
71
|
+
gemfile: gemfiles/rails-4.2-mongoid.gemfile
|
72
|
+
- rvm: 2.6.3
|
73
|
+
gemfile: gemfiles/rails-4.0-mongo.gemfile
|
74
|
+
- rvm: 2.6.3
|
75
|
+
gemfile: gemfiles/rails-4.0-mongoid.gemfile
|
76
|
+
- rvm: 2.6.3
|
77
|
+
gemfile: gemfiles/rails-4.1-mongo.gemfile
|
78
|
+
- rvm: 2.6.3
|
79
|
+
gemfile: gemfiles/rails-4.1-mongoid.gemfile
|
80
|
+
- rvm: 2.6.3
|
81
|
+
gemfile: gemfiles/rails-4.2-mongo.gemfile
|
82
|
+
- rvm: 2.6.3
|
83
|
+
gemfile: gemfiles/rails-4.2-mongoid.gemfile
|
42
84
|
|
43
85
|
services: mongodb
|
44
86
|
|
data/CHANGELOG.md
CHANGED
@@ -1,10 +1,20 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
-
##
|
3
|
+
## (unreleased)
|
4
4
|
|
5
|
-
* [#31](https://github.com/mongoid/mongo_session_store/pull/31): Add Rails 5 support - [@tombruijn](https://github.com/tombruijn).
|
6
5
|
* Your contribution here.
|
7
6
|
|
7
|
+
## 3.2.0
|
8
|
+
|
9
|
+
* [#32](https://github.com/mongoid/mongo_session_store/pull/32): Add Rails 5.1 support - [@tombruijn](https://github.com/tombruijn).
|
10
|
+
* [#36](https://github.com/mongoid/mongo_session_store/pull/36): Add gem specific main error class - [@tombruijn](https://github.com/tombruijn).
|
11
|
+
* [#38](https://github.com/mongoid/mongo_session_store/pull/38): Support rails 5.2 - [@tombruijn](https://github.com/tombruijn).
|
12
|
+
* [#41](https://github.com/mongoid/mongo_session_store/pull/41): Add Ruby 2.5 and 2.6 support - [@tombruijn](https://github.com/tombruijn).
|
13
|
+
|
14
|
+
## 3.1.0
|
15
|
+
|
16
|
+
* [#31](https://github.com/mongoid/mongo_session_store/pull/31): Add Rails 5.0 support - [@tombruijn](https://github.com/tombruijn).
|
17
|
+
|
8
18
|
## 3.0.0
|
9
19
|
|
10
20
|
* Drop Ruby 1.8, 1.9 and 2.0 support - [@tombruijn](https://github.com/tombruijn).
|
data/README.md
CHANGED
@@ -11,7 +11,7 @@ MongoSessionStore is a [Rails][rails]-compatible session store for
|
|
11
11
|
Driver][mongo]. It also allows for custom Mongo session store that works with
|
12
12
|
any (or no!) Mongo ODM.
|
13
13
|
|
14
|
-
MongoSessionStore version 3 is compatible with Rails 4.0 through
|
14
|
+
MongoSessionStore version 3 is compatible with Rails 4.0 through 5.2. For Rails
|
15
15
|
3 support please check out issue [#17][issue-rails3] for options and let us
|
16
16
|
know if you need support.
|
17
17
|
|
@@ -88,6 +88,12 @@ BUNDLE_GEMFILE=gemfiles/rails-4.1-mongo.gemfile bundle exec rake
|
|
88
88
|
BUNDLE_GEMFILE=gemfiles/rails-4.1-mongoid.gemfile bundle exec rake
|
89
89
|
BUNDLE_GEMFILE=gemfiles/rails-4.2-mongo.gemfile bundle exec rake
|
90
90
|
BUNDLE_GEMFILE=gemfiles/rails-4.2-mongoid.gemfile bundle exec rake
|
91
|
+
BUNDLE_GEMFILE=gemfiles/rails-5.0-mongo.gemfile bundle exec rake
|
92
|
+
BUNDLE_GEMFILE=gemfiles/rails-5.0-mongoid.gemfile bundle exec rake
|
93
|
+
BUNDLE_GEMFILE=gemfiles/rails-5.1-mongo.gemfile bundle exec rake
|
94
|
+
BUNDLE_GEMFILE=gemfiles/rails-5.1-mongoid.gemfile bundle exec rake
|
95
|
+
BUNDLE_GEMFILE=gemfiles/rails-5.2-mongo.gemfile bundle exec rake
|
96
|
+
BUNDLE_GEMFILE=gemfiles/rails-5.2-mongoid.gemfile bundle exec rake
|
91
97
|
```
|
92
98
|
|
93
99
|
### Performance benchmark
|
data/lib/mongo_session_store.rb
CHANGED
data/mongo_session_store.gemspec
CHANGED
@@ -17,7 +17,8 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.add_dependency "actionpack", ">= 4.0"
|
18
18
|
s.add_dependency "mongo", "~> 2.0"
|
19
19
|
|
20
|
-
s.add_development_dependency "rspec-rails", "~> 3"
|
20
|
+
s.add_development_dependency "rspec-rails", "~> 3.6"
|
21
|
+
s.add_development_dependency "capybara", "~> 2.15.0"
|
21
22
|
s.add_development_dependency "pry", "~> 0.10"
|
22
23
|
s.add_development_dependency "rake", "~> 11"
|
23
24
|
s.add_development_dependency "rubocop", "0.45.0"
|
@@ -1,18 +1,33 @@
|
|
1
1
|
require "rails_helper"
|
2
2
|
|
3
|
+
current_rails_version = Gem::Version.new(Gem.loaded_specs["rails"].version)
|
4
|
+
rails_5_version = Gem::Version.new("5.0.0")
|
5
|
+
IS_RAILS_5 = current_rails_version > rails_5_version
|
6
|
+
|
3
7
|
describe Devise::SessionsController, :type => :request do
|
8
|
+
def rails5?
|
9
|
+
IS_RAILS_5
|
10
|
+
end
|
11
|
+
|
12
|
+
def prepare_request_params(params)
|
13
|
+
params = { :params => params } if rails5?
|
14
|
+
params
|
15
|
+
end
|
16
|
+
|
4
17
|
def create_user
|
5
|
-
post "/users",
|
18
|
+
post "/users", prepare_request_params(
|
6
19
|
"user[email]" => "person@example.com",
|
7
20
|
"user[password]" => "secret",
|
8
21
|
"user[password_confirmation]" => "secret"
|
22
|
+
)
|
9
23
|
end
|
10
24
|
|
11
25
|
def sign_in
|
12
|
-
post "/users/sign_in",
|
26
|
+
post "/users/sign_in", prepare_request_params(
|
13
27
|
"user[email]" => "person@example.com",
|
14
28
|
"user[password]" => "secret",
|
15
29
|
"user[password_confirmation]" => "secret"
|
30
|
+
)
|
16
31
|
end
|
17
32
|
|
18
33
|
def sign_out
|
data/spec/rails_helper.rb
CHANGED
@@ -1,7 +1,10 @@
|
|
1
1
|
ENV["RAILS_ENV"] = "test"
|
2
|
+
rails_version = Gem.loaded_specs["rails"].version.to_s[/^\d\.\d/]
|
3
|
+
if Gem.loaded_specs["rails"].version >= Gem::Version.new("5.2")
|
4
|
+
require "active_support/message_encryptor"
|
5
|
+
end
|
2
6
|
require "spec_helper"
|
3
7
|
require "rails"
|
4
|
-
rails_version = Gem.loaded_specs["rails"].version.to_s[/^\d\.\d/]
|
5
8
|
require "support/apps/rails_#{rails_version}_app/config/environment"
|
6
9
|
require "rspec/rails"
|
7
10
|
|
@@ -1,10 +1,9 @@
|
|
1
1
|
You are signed
|
2
2
|
<% if user_signed_in? %>
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
</form>
|
3
|
+
in as <%= current_user.email %>.
|
4
|
+
<%= form_tag destroy_user_session_path, :method => :delete do %>
|
5
|
+
<%= button_tag "Sign out" %>
|
6
|
+
<% end %>
|
8
7
|
<% else %>
|
9
|
-
|
8
|
+
out. <%= link_to "Sign in", new_user_session_path %>
|
10
9
|
<% end %>
|
@@ -1,10 +1,9 @@
|
|
1
1
|
You are signed
|
2
2
|
<% if user_signed_in? %>
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
</form>
|
3
|
+
in as <%= current_user.email %>.
|
4
|
+
<%= form_tag destroy_user_session_path, :method => :delete do %>
|
5
|
+
<%= button_tag "Sign out" %>
|
6
|
+
<% end %>
|
8
7
|
<% else %>
|
9
|
-
|
8
|
+
out. <%= link_to "Sign in", new_user_session_path %>
|
10
9
|
<% end %>
|
@@ -1,10 +1,9 @@
|
|
1
1
|
You are signed
|
2
2
|
<% if user_signed_in? %>
|
3
3
|
in as <%= current_user.email %>.
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
</form>
|
4
|
+
<%= form_tag destroy_user_session_path, :method => :delete do %>
|
5
|
+
<%= button_tag "Sign out" %>
|
6
|
+
<% end %>
|
8
7
|
<% else %>
|
9
8
|
out. <%= link_to "Sign in", new_user_session_path %>
|
10
9
|
<% end %>
|
@@ -1,10 +1,9 @@
|
|
1
1
|
You are signed
|
2
2
|
<% if user_signed_in? %>
|
3
3
|
in as <%= current_user.email %>.
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
</form>
|
4
|
+
<%= form_tag destroy_user_session_path, :method => :delete do %>
|
5
|
+
<%= button_tag "Sign out" %>
|
6
|
+
<% end %>
|
8
7
|
<% else %>
|
9
8
|
out. <%= link_to "Sign in", new_user_session_path %>
|
10
9
|
<% end %>
|