mongo_session_store-rails5 7.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.bundle/install.log +768 -0
- data/.gitignore +10 -0
- data/.rspec +1 -0
- data/.travis.yml +21 -0
- data/Gemfile +67 -0
- data/README.md +133 -0
- data/Rakefile +93 -0
- data/lib/mongo_session_store-rails3.rb +1 -0
- data/lib/mongo_session_store-rails4.rb +1 -0
- data/lib/mongo_session_store-rails5.rb +1 -0
- data/lib/mongo_session_store.rb +49 -0
- data/lib/mongo_session_store/mongo_mapper_store.rb +22 -0
- data/lib/mongo_session_store/mongo_store.rb +83 -0
- data/lib/mongo_session_store/mongo_store_base.rb +98 -0
- data/lib/mongo_session_store/mongoid_store.rb +57 -0
- data/lib/mongo_session_store/version.rb +3 -0
- data/mongo_session_store-rails3.gemspec +18 -0
- data/mongo_session_store-rails4.gemspec +18 -0
- data/mongo_session_store-rails5.gemspec +20 -0
- data/perf/benchmark.rb +92 -0
- data/release.sh +6 -0
- data/spec/integration_with_devise_spec.rb +89 -0
- data/spec/mongo_store_base_spec.rb +42 -0
- data/spec/rails_3.1_app/.gitignore +5 -0
- data/spec/rails_3.1_app/README +261 -0
- data/spec/rails_3.1_app/Rakefile +7 -0
- data/spec/rails_3.1_app/app/assets/javascripts/application.js +7 -0
- data/spec/rails_3.1_app/app/assets/stylesheets/application.css +7 -0
- data/spec/rails_3.1_app/app/controllers/application_controller.rb +3 -0
- data/spec/rails_3.1_app/app/controllers/home_controller.rb +4 -0
- data/spec/rails_3.1_app/app/helpers/application_helper.rb +2 -0
- data/spec/rails_3.1_app/app/mailers/.gitkeep +0 -0
- data/spec/rails_3.1_app/app/models/.gitkeep +0 -0
- data/spec/rails_3.1_app/app/models/user.rb +6 -0
- data/spec/rails_3.1_app/app/views/devise/confirmations/new.html.erb +12 -0
- data/spec/rails_3.1_app/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
- data/spec/rails_3.1_app/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
- data/spec/rails_3.1_app/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
- data/spec/rails_3.1_app/app/views/devise/passwords/edit.html.erb +16 -0
- data/spec/rails_3.1_app/app/views/devise/passwords/new.html.erb +12 -0
- data/spec/rails_3.1_app/app/views/devise/registrations/edit.html.erb +25 -0
- data/spec/rails_3.1_app/app/views/devise/registrations/new.html.erb +18 -0
- data/spec/rails_3.1_app/app/views/devise/sessions/new.html.erb +17 -0
- data/spec/rails_3.1_app/app/views/devise/shared/_links.erb +25 -0
- data/spec/rails_3.1_app/app/views/devise/unlocks/new.html.erb +12 -0
- data/spec/rails_3.1_app/app/views/home/index.html.erb +10 -0
- data/spec/rails_3.1_app/app/views/layouts/application.html.erb +15 -0
- data/spec/rails_3.1_app/config.ru +4 -0
- data/spec/rails_3.1_app/config/application.rb +47 -0
- data/spec/rails_3.1_app/config/boot.rb +6 -0
- data/spec/rails_3.1_app/config/database.yml +11 -0
- data/spec/rails_3.1_app/config/environment.rb +5 -0
- data/spec/rails_3.1_app/config/environments/development.rb +27 -0
- data/spec/rails_3.1_app/config/environments/production.rb +54 -0
- data/spec/rails_3.1_app/config/environments/test.rb +39 -0
- data/spec/rails_3.1_app/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/rails_3.1_app/config/initializers/devise.rb +201 -0
- data/spec/rails_3.1_app/config/initializers/inflections.rb +10 -0
- data/spec/rails_3.1_app/config/initializers/mime_types.rb +5 -0
- data/spec/rails_3.1_app/config/initializers/secret_token.rb +7 -0
- data/spec/rails_3.1_app/config/initializers/session_store.rb +9 -0
- data/spec/rails_3.1_app/config/initializers/wrap_parameters.rb +12 -0
- data/spec/rails_3.1_app/config/locales/devise.en.yml +55 -0
- data/spec/rails_3.1_app/config/locales/en.yml +5 -0
- data/spec/rails_3.1_app/config/mongo.yml +18 -0
- data/spec/rails_3.1_app/config/mongoid.yml +13 -0
- data/spec/rails_3.1_app/config/routes.rb +4 -0
- data/spec/rails_3.1_app/db/migrate/20120222195914_create_users_table.rb +12 -0
- data/spec/rails_3.1_app/db/schema.rb +20 -0
- data/spec/rails_3.1_app/lib/tasks/.gitkeep +0 -0
- data/spec/rails_3.1_app/log/.gitkeep +0 -0
- data/spec/rails_3.1_app/public/404.html +26 -0
- data/spec/rails_3.1_app/public/422.html +26 -0
- data/spec/rails_3.1_app/public/500.html +26 -0
- data/spec/rails_3.1_app/public/favicon.ico +0 -0
- data/spec/rails_3.1_app/public/robots.txt +5 -0
- data/spec/rails_3.1_app/script/rails +6 -0
- data/spec/rails_3.1_app/vendor/assets/stylesheets/.gitkeep +0 -0
- data/spec/rails_3.1_app/vendor/plugins/.gitkeep +0 -0
- data/spec/rails_3.2_app/.gitignore +5 -0
- data/spec/rails_3.2_app/README +261 -0
- data/spec/rails_3.2_app/Rakefile +7 -0
- data/spec/rails_3.2_app/app/assets/javascripts/application.js +7 -0
- data/spec/rails_3.2_app/app/assets/stylesheets/application.css +7 -0
- data/spec/rails_3.2_app/app/controllers/application_controller.rb +3 -0
- data/spec/rails_3.2_app/app/controllers/home_controller.rb +4 -0
- data/spec/rails_3.2_app/app/helpers/application_helper.rb +2 -0
- data/spec/rails_3.2_app/app/mailers/.gitkeep +0 -0
- data/spec/rails_3.2_app/app/models/.gitkeep +0 -0
- data/spec/rails_3.2_app/app/models/user.rb +6 -0
- data/spec/rails_3.2_app/app/views/devise/confirmations/new.html.erb +12 -0
- data/spec/rails_3.2_app/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
- data/spec/rails_3.2_app/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
- data/spec/rails_3.2_app/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
- data/spec/rails_3.2_app/app/views/devise/passwords/edit.html.erb +16 -0
- data/spec/rails_3.2_app/app/views/devise/passwords/new.html.erb +12 -0
- data/spec/rails_3.2_app/app/views/devise/registrations/edit.html.erb +25 -0
- data/spec/rails_3.2_app/app/views/devise/registrations/new.html.erb +18 -0
- data/spec/rails_3.2_app/app/views/devise/sessions/new.html.erb +17 -0
- data/spec/rails_3.2_app/app/views/devise/shared/_links.erb +25 -0
- data/spec/rails_3.2_app/app/views/devise/unlocks/new.html.erb +12 -0
- data/spec/rails_3.2_app/app/views/home/index.html.erb +10 -0
- data/spec/rails_3.2_app/app/views/layouts/application.html.erb +15 -0
- data/spec/rails_3.2_app/config.ru +4 -0
- data/spec/rails_3.2_app/config/application.rb +47 -0
- data/spec/rails_3.2_app/config/boot.rb +6 -0
- data/spec/rails_3.2_app/config/database.yml +11 -0
- data/spec/rails_3.2_app/config/environment.rb +5 -0
- data/spec/rails_3.2_app/config/environments/development.rb +27 -0
- data/spec/rails_3.2_app/config/environments/production.rb +54 -0
- data/spec/rails_3.2_app/config/environments/test.rb +39 -0
- data/spec/rails_3.2_app/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/rails_3.2_app/config/initializers/devise.rb +203 -0
- data/spec/rails_3.2_app/config/initializers/inflections.rb +10 -0
- data/spec/rails_3.2_app/config/initializers/mime_types.rb +5 -0
- data/spec/rails_3.2_app/config/initializers/secret_token.rb +7 -0
- data/spec/rails_3.2_app/config/initializers/session_store.rb +9 -0
- data/spec/rails_3.2_app/config/initializers/wrap_parameters.rb +12 -0
- data/spec/rails_3.2_app/config/locales/devise.en.yml +55 -0
- data/spec/rails_3.2_app/config/locales/en.yml +5 -0
- data/spec/rails_3.2_app/config/mongo.yml +18 -0
- data/spec/rails_3.2_app/config/mongoid.yml +13 -0
- data/spec/rails_3.2_app/config/routes.rb +4 -0
- data/spec/rails_3.2_app/db/migrate/20120222195914_create_users_table.rb +12 -0
- data/spec/rails_3.2_app/db/schema.rb +20 -0
- data/spec/rails_3.2_app/lib/tasks/.gitkeep +0 -0
- data/spec/rails_3.2_app/log/.gitkeep +0 -0
- data/spec/rails_3.2_app/public/404.html +26 -0
- data/spec/rails_3.2_app/public/422.html +26 -0
- data/spec/rails_3.2_app/public/500.html +26 -0
- data/spec/rails_3.2_app/public/favicon.ico +0 -0
- data/spec/rails_3.2_app/public/robots.txt +5 -0
- data/spec/rails_3.2_app/script/rails +6 -0
- data/spec/rails_3.2_app/vendor/assets/stylesheets/.gitkeep +0 -0
- data/spec/rails_3.2_app/vendor/plugins/.gitkeep +0 -0
- data/spec/rails_4.0_app/.gitignore +16 -0
- data/spec/rails_4.0_app/Rakefile +6 -0
- data/spec/rails_4.0_app/app/assets/images/.keep +0 -0
- data/spec/rails_4.0_app/app/assets/javascripts/application.js +13 -0
- data/spec/rails_4.0_app/app/assets/stylesheets/application.css +13 -0
- data/spec/rails_4.0_app/app/controllers/application_controller.rb +5 -0
- data/spec/rails_4.0_app/app/controllers/concerns/.keep +0 -0
- data/spec/rails_4.0_app/app/controllers/home_controller.rb +4 -0
- data/spec/rails_4.0_app/app/helpers/application_helper.rb +2 -0
- data/spec/rails_4.0_app/app/mailers/.keep +0 -0
- data/spec/rails_4.0_app/app/models/.keep +0 -0
- data/spec/rails_4.0_app/app/models/concerns/.keep +0 -0
- data/spec/rails_4.0_app/app/models/user.rb +5 -0
- data/spec/rails_4.0_app/app/views/devise/confirmations/new.html.erb +12 -0
- data/spec/rails_4.0_app/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
- data/spec/rails_4.0_app/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
- data/spec/rails_4.0_app/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
- data/spec/rails_4.0_app/app/views/devise/passwords/edit.html.erb +16 -0
- data/spec/rails_4.0_app/app/views/devise/passwords/new.html.erb +12 -0
- data/spec/rails_4.0_app/app/views/devise/registrations/edit.html.erb +29 -0
- data/spec/rails_4.0_app/app/views/devise/registrations/new.html.erb +18 -0
- data/spec/rails_4.0_app/app/views/devise/sessions/new.html.erb +17 -0
- data/spec/rails_4.0_app/app/views/devise/shared/_links.erb +25 -0
- data/spec/rails_4.0_app/app/views/devise/unlocks/new.html.erb +12 -0
- data/spec/rails_4.0_app/app/views/home/index.html.erb +10 -0
- data/spec/rails_4.0_app/app/views/layouts/application.html.erb +17 -0
- data/spec/rails_4.0_app/bin/bundle +3 -0
- data/spec/rails_4.0_app/bin/rails +4 -0
- data/spec/rails_4.0_app/bin/rake +4 -0
- data/spec/rails_4.0_app/config.ru +4 -0
- data/spec/rails_4.0_app/config/application.rb +26 -0
- data/spec/rails_4.0_app/config/boot.rb +4 -0
- data/spec/rails_4.0_app/config/database.yml +11 -0
- data/spec/rails_4.0_app/config/environment.rb +5 -0
- data/spec/rails_4.0_app/config/environments/development.rb +29 -0
- data/spec/rails_4.0_app/config/environments/production.rb +80 -0
- data/spec/rails_4.0_app/config/environments/test.rb +36 -0
- data/spec/rails_4.0_app/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/rails_4.0_app/config/initializers/devise.rb +254 -0
- data/spec/rails_4.0_app/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/rails_4.0_app/config/initializers/inflections.rb +16 -0
- data/spec/rails_4.0_app/config/initializers/mime_types.rb +5 -0
- data/spec/rails_4.0_app/config/initializers/secret_token.rb +12 -0
- data/spec/rails_4.0_app/config/initializers/session_store.rb +5 -0
- data/spec/rails_4.0_app/config/initializers/wrap_parameters.rb +14 -0
- data/spec/rails_4.0_app/config/locales/devise.en.yml +59 -0
- data/spec/rails_4.0_app/config/locales/en.yml +23 -0
- data/spec/rails_4.0_app/config/mongo.yml +11 -0
- data/spec/rails_4.0_app/config/mongoid.yml +13 -0
- data/spec/rails_4.0_app/config/routes.rb +4 -0
- data/spec/rails_4.0_app/db/migrate/20140301171212_add_devise_users.rb +11 -0
- data/spec/rails_4.0_app/db/schema.rb +25 -0
- data/spec/rails_4.0_app/db/seeds.rb +7 -0
- data/spec/rails_4.0_app/lib/assets/.keep +0 -0
- data/spec/rails_4.0_app/lib/tasks/.keep +0 -0
- data/spec/rails_4.0_app/log/.keep +0 -0
- data/spec/rails_4.0_app/public/404.html +58 -0
- data/spec/rails_4.0_app/public/422.html +58 -0
- data/spec/rails_4.0_app/public/500.html +57 -0
- data/spec/rails_4.0_app/public/favicon.ico +0 -0
- data/spec/rails_4.0_app/public/robots.txt +5 -0
- data/spec/rails_4.1_app/.gitignore +16 -0
- data/spec/rails_4.1_app/Rakefile +6 -0
- data/spec/rails_4.1_app/app/assets/images/.keep +0 -0
- data/spec/rails_4.1_app/app/assets/javascripts/application.js +13 -0
- data/spec/rails_4.1_app/app/assets/stylesheets/application.css +15 -0
- data/spec/rails_4.1_app/app/controllers/application_controller.rb +5 -0
- data/spec/rails_4.1_app/app/controllers/concerns/.keep +0 -0
- data/spec/rails_4.1_app/app/controllers/home_controller.rb +4 -0
- data/spec/rails_4.1_app/app/helpers/application_helper.rb +2 -0
- data/spec/rails_4.1_app/app/mailers/.keep +0 -0
- data/spec/rails_4.1_app/app/models/.keep +0 -0
- data/spec/rails_4.1_app/app/models/concerns/.keep +0 -0
- data/spec/rails_4.1_app/app/models/user.rb +5 -0
- data/spec/rails_4.1_app/app/views/devise/confirmations/new.html.erb +12 -0
- data/spec/rails_4.1_app/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
- data/spec/rails_4.1_app/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
- data/spec/rails_4.1_app/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
- data/spec/rails_4.1_app/app/views/devise/passwords/edit.html.erb +16 -0
- data/spec/rails_4.1_app/app/views/devise/passwords/new.html.erb +12 -0
- data/spec/rails_4.1_app/app/views/devise/registrations/edit.html.erb +29 -0
- data/spec/rails_4.1_app/app/views/devise/registrations/new.html.erb +18 -0
- data/spec/rails_4.1_app/app/views/devise/sessions/new.html.erb +17 -0
- data/spec/rails_4.1_app/app/views/devise/shared/_links.erb +25 -0
- data/spec/rails_4.1_app/app/views/devise/unlocks/new.html.erb +12 -0
- data/spec/rails_4.1_app/app/views/home/index.html.erb +10 -0
- data/spec/rails_4.1_app/app/views/layouts/application.html.erb +17 -0
- data/spec/rails_4.1_app/bin/bundle +3 -0
- data/spec/rails_4.1_app/bin/rails +8 -0
- data/spec/rails_4.1_app/bin/rake +8 -0
- data/spec/rails_4.1_app/bin/spring +18 -0
- data/spec/rails_4.1_app/config.ru +4 -0
- data/spec/rails_4.1_app/config/application.rb +23 -0
- data/spec/rails_4.1_app/config/boot.rb +4 -0
- data/spec/rails_4.1_app/config/database.yml +11 -0
- data/spec/rails_4.1_app/config/environment.rb +5 -0
- data/spec/rails_4.1_app/config/environments/development.rb +37 -0
- data/spec/rails_4.1_app/config/environments/production.rb +83 -0
- data/spec/rails_4.1_app/config/environments/test.rb +39 -0
- data/spec/rails_4.1_app/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/rails_4.1_app/config/initializers/cookies_serializer.rb +3 -0
- data/spec/rails_4.1_app/config/initializers/devise.rb +254 -0
- data/spec/rails_4.1_app/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/rails_4.1_app/config/initializers/inflections.rb +16 -0
- data/spec/rails_4.1_app/config/initializers/mime_types.rb +5 -0
- data/spec/rails_4.1_app/config/initializers/session_store.rb +5 -0
- data/spec/rails_4.1_app/config/initializers/wrap_parameters.rb +14 -0
- data/spec/rails_4.1_app/config/locales/devise.en.yml +59 -0
- data/spec/rails_4.1_app/config/locales/en.yml +23 -0
- data/spec/rails_4.1_app/config/mongo.yml +11 -0
- data/spec/rails_4.1_app/config/mongoid.yml +13 -0
- data/spec/rails_4.1_app/config/routes.rb +4 -0
- data/spec/rails_4.1_app/config/secrets.yml +22 -0
- data/spec/rails_4.1_app/db/migrate/20140301171212_add_devise_users.rb +11 -0
- data/spec/rails_4.1_app/db/schema.rb +25 -0
- data/spec/rails_4.1_app/db/seeds.rb +7 -0
- data/spec/rails_4.1_app/lib/assets/.keep +0 -0
- data/spec/rails_4.1_app/lib/tasks/.keep +0 -0
- data/spec/rails_4.1_app/log/.keep +0 -0
- data/spec/rails_4.1_app/public/404.html +67 -0
- data/spec/rails_4.1_app/public/422.html +67 -0
- data/spec/rails_4.1_app/public/500.html +66 -0
- data/spec/rails_4.1_app/public/favicon.ico +0 -0
- data/spec/rails_4.1_app/public/robots.txt +5 -0
- data/spec/rails_4.2_app/.gitignore +17 -0
- data/spec/rails_4.2_app/Rakefile +6 -0
- data/spec/rails_4.2_app/app/assets/images/.keep +0 -0
- data/spec/rails_4.2_app/app/assets/javascripts/application.js +13 -0
- data/spec/rails_4.2_app/app/assets/stylesheets/application.css +15 -0
- data/spec/rails_4.2_app/app/controllers/application_controller.rb +5 -0
- data/spec/rails_4.2_app/app/controllers/concerns/.keep +0 -0
- data/spec/rails_4.2_app/app/controllers/home_controller.rb +4 -0
- data/spec/rails_4.2_app/app/helpers/application_helper.rb +2 -0
- data/spec/rails_4.2_app/app/mailers/.keep +0 -0
- data/spec/rails_4.2_app/app/models/.keep +0 -0
- data/spec/rails_4.2_app/app/models/concerns/.keep +0 -0
- data/spec/rails_4.2_app/app/models/user.rb +5 -0
- data/spec/rails_4.2_app/app/views/devise/confirmations/new.html.erb +12 -0
- data/spec/rails_4.2_app/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
- data/spec/rails_4.2_app/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
- data/spec/rails_4.2_app/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
- data/spec/rails_4.2_app/app/views/devise/passwords/edit.html.erb +16 -0
- data/spec/rails_4.2_app/app/views/devise/passwords/new.html.erb +12 -0
- data/spec/rails_4.2_app/app/views/devise/registrations/edit.html.erb +29 -0
- data/spec/rails_4.2_app/app/views/devise/registrations/new.html.erb +18 -0
- data/spec/rails_4.2_app/app/views/devise/sessions/new.html.erb +17 -0
- data/spec/rails_4.2_app/app/views/devise/shared/_links.erb +25 -0
- data/spec/rails_4.2_app/app/views/devise/unlocks/new.html.erb +12 -0
- data/spec/rails_4.2_app/app/views/home/index.html.erb +10 -0
- data/spec/rails_4.2_app/app/views/layouts/application.html.erb +17 -0
- data/spec/rails_4.2_app/bin/bundle +3 -0
- data/spec/rails_4.2_app/bin/rails +8 -0
- data/spec/rails_4.2_app/bin/rake +8 -0
- data/spec/rails_4.2_app/bin/setup +29 -0
- data/spec/rails_4.2_app/bin/spring +15 -0
- data/spec/rails_4.2_app/config.ru +4 -0
- data/spec/rails_4.2_app/config/application.rb +26 -0
- data/spec/rails_4.2_app/config/boot.rb +3 -0
- data/spec/rails_4.2_app/config/database.yml +11 -0
- data/spec/rails_4.2_app/config/environment.rb +5 -0
- data/spec/rails_4.2_app/config/environments/development.rb +41 -0
- data/spec/rails_4.2_app/config/environments/production.rb +79 -0
- data/spec/rails_4.2_app/config/environments/test.rb +42 -0
- data/spec/rails_4.2_app/config/initializers/assets.rb +11 -0
- data/spec/rails_4.2_app/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/rails_4.2_app/config/initializers/cookies_serializer.rb +3 -0
- data/spec/rails_4.2_app/config/initializers/devise.rb +254 -0
- data/spec/rails_4.2_app/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/rails_4.2_app/config/initializers/inflections.rb +16 -0
- data/spec/rails_4.2_app/config/initializers/mime_types.rb +4 -0
- data/spec/rails_4.2_app/config/initializers/session_store.rb +5 -0
- data/spec/rails_4.2_app/config/initializers/wrap_parameters.rb +14 -0
- data/spec/rails_4.2_app/config/locales/en.yml +23 -0
- data/spec/rails_4.2_app/config/mongo.yml +11 -0
- data/spec/rails_4.2_app/config/mongoid.yml +13 -0
- data/spec/rails_4.2_app/config/routes.rb +4 -0
- data/spec/rails_4.2_app/config/secrets.yml +22 -0
- data/spec/rails_4.2_app/db/migrate/20140301171212_add_devise_users.rb +11 -0
- data/spec/rails_4.2_app/db/schema.rb +25 -0
- data/spec/rails_4.2_app/db/seeds.rb +7 -0
- data/spec/rails_4.2_app/lib/assets/.keep +0 -0
- data/spec/rails_4.2_app/lib/tasks/.keep +0 -0
- data/spec/rails_4.2_app/log/.keep +0 -0
- data/spec/rails_4.2_app/public/404.html +67 -0
- data/spec/rails_4.2_app/public/422.html +67 -0
- data/spec/rails_4.2_app/public/500.html +66 -0
- data/spec/rails_4.2_app/public/favicon.ico +0 -0
- data/spec/rails_4.2_app/public/robots.txt +5 -0
- data/spec/rails_helper.rb +47 -0
- data/spec/spec_helper.rb +5 -0
- metadata +409 -0
data/.gitignore
ADDED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/.travis.yml
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
language: ruby
|
2
|
+
script: "rake"
|
3
|
+
rvm:
|
4
|
+
- 1.9.3
|
5
|
+
- 2.0.0
|
6
|
+
- 2.1.5
|
7
|
+
- "2.2"
|
8
|
+
- ruby-head
|
9
|
+
- jruby-19mode
|
10
|
+
- jruby-head
|
11
|
+
- rbx-2.2.9
|
12
|
+
matrix:
|
13
|
+
allow_failures:
|
14
|
+
- rvm: jruby-head
|
15
|
+
- rvm: ruby-head
|
16
|
+
- rvm: rbx-2.2.9
|
17
|
+
before_script:
|
18
|
+
- wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.0.1.tgz -O /tmp/mongodb.tgz
|
19
|
+
- tar -xvf /tmp/mongodb.tgz
|
20
|
+
- mkdir /tmp/data
|
21
|
+
- ${PWD}/mongodb-linux-x86_64-3.0.1/bin/mongod --dbpath /tmp/data --bind_ip 127.0.0.1 &> /dev/null &
|
data/Gemfile
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
RAILS_VERS = case ENV['RAILS_VERS']
|
4
|
+
when '3.1'
|
5
|
+
'~>3.1.12'
|
6
|
+
when '3.2'
|
7
|
+
'~>3.2.18'
|
8
|
+
when '4.0'
|
9
|
+
'~>4.0.5'
|
10
|
+
when '4.1'
|
11
|
+
'~>4.1.9'
|
12
|
+
when '4.2'
|
13
|
+
'~>4.2.0'
|
14
|
+
when '5.0'
|
15
|
+
'~>5.0.0'
|
16
|
+
when nil
|
17
|
+
nil
|
18
|
+
else
|
19
|
+
raise "Invalid RAILS_VERS. Available versions are 3.1, 3.2, 4.0, 4.1, and 4.2."
|
20
|
+
end
|
21
|
+
|
22
|
+
gemspec :name => 'mongo_session_store-rails5'
|
23
|
+
|
24
|
+
group :development, :test do
|
25
|
+
gem 'rake'
|
26
|
+
|
27
|
+
case ENV['MONGO_SESSION_STORE_ORM']
|
28
|
+
when 'mongo_mapper'
|
29
|
+
gem 'mongo_mapper', '>= 0.13.1'
|
30
|
+
when 'mongoid'
|
31
|
+
if ENV['RAILS_VERS'] =~ /^5\.\d/
|
32
|
+
gem 'mongoid', '>= 6.0.0'
|
33
|
+
elsif ENV['RAILS_VERS'] =~ /^4\.\d/
|
34
|
+
gem 'mongoid', '>= 4.0.2'
|
35
|
+
elsif ENV['RAILS_VERS'] =~ /^3\.2\d/
|
36
|
+
gem 'mongoid', '>= 3.1.0'
|
37
|
+
else
|
38
|
+
gem 'mongoid', '>= 3.0.0'
|
39
|
+
end
|
40
|
+
when 'mongo'
|
41
|
+
gem 'mongo'
|
42
|
+
else
|
43
|
+
gem 'mongo' # So rake test_all can wait for Mongo to start
|
44
|
+
end
|
45
|
+
|
46
|
+
gem 'pry'
|
47
|
+
|
48
|
+
if RUBY_PLATFORM == 'java'
|
49
|
+
gem 'jdbc-sqlite3'
|
50
|
+
gem 'activerecord-jdbc-adapter'
|
51
|
+
gem 'activerecord-jdbcsqlite3-adapter'
|
52
|
+
gem 'jruby-openssl'
|
53
|
+
gem 'jruby-rack'
|
54
|
+
else
|
55
|
+
gem 'sqlite3' # for devise User storage
|
56
|
+
end
|
57
|
+
|
58
|
+
if RAILS_VERS
|
59
|
+
gem 'rails', RAILS_VERS
|
60
|
+
else
|
61
|
+
gem 'rails'
|
62
|
+
end
|
63
|
+
gem 'test-unit'
|
64
|
+
|
65
|
+
gem 'rspec-rails', '2.12.0'
|
66
|
+
gem 'devise'
|
67
|
+
end
|
data/README.md
ADDED
@@ -0,0 +1,133 @@
|
|
1
|
+
# MongoSessionStore [![Build Status](https://travis-ci.org/brianhempel/mongo_session_store.png?branch=master)](https://travis-ci.org/brianhempel/mongo_session_store) [![Gem Version](https://badge.fury.io/rb/mongo_session_store-rails4.svg)](http://badge.fury.io/rb/mongo_session_store-rails4)
|
2
|
+
|
3
|
+
## Description
|
4
|
+
|
5
|
+
MongoSessionStore is a collection of Rails-compatible session stores for MongoMapper and Mongoid, but also included is a generic Mongo store that works with any (or no!) Mongo ODM.
|
6
|
+
|
7
|
+
MongoSessionStore is tested [on Travis CI](https://travis-ci.org/brianhempel/mongo_session_store) against Ruby 1.9.3, 2.0.0, 2.1.5, 2.2.0, and JRuby with Rails 3.1 through 4.2.
|
8
|
+
|
9
|
+
Mongoid users: This gem is compatible with both Mongoid 3 and 4.
|
10
|
+
|
11
|
+
If this gem doesn't work for you, you might next try [mongo_sessions](https://github.com/biilmann/mongo_sessions).
|
12
|
+
|
13
|
+
See the [Changelog](#changelog) if you need support for an older version of Ruby, Rails, or Mongoid.
|
14
|
+
|
15
|
+
## Usage
|
16
|
+
|
17
|
+
MongoSessionStore is compatible with Rails 3.1 through 4.2.
|
18
|
+
|
19
|
+
In your Gemfile:
|
20
|
+
|
21
|
+
```ruby
|
22
|
+
gem "mongo_mapper"
|
23
|
+
# or gem "mongoid"
|
24
|
+
# or gem "mongo"
|
25
|
+
gem "mongo_session_store-rails5"
|
26
|
+
# or gem "mongo_session_store-rails4"
|
27
|
+
# or gem "mongo_session_store-rails3"
|
28
|
+
```
|
29
|
+
|
30
|
+
In the session_store initializer (config/initializers/session_store.rb):
|
31
|
+
|
32
|
+
```ruby
|
33
|
+
# MongoMapper
|
34
|
+
MyApp::Application.config.session_store :mongo_mapper_store
|
35
|
+
|
36
|
+
# Mongoid
|
37
|
+
MyApp::Application.config.session_store :mongoid_store
|
38
|
+
|
39
|
+
# anything else
|
40
|
+
MyApp::Application.config.session_store :mongo_store
|
41
|
+
MongoStore::Session.database = Mongo::Client.new(['127.0.0.1:27017'], database: \"my_app_development\")
|
42
|
+
```
|
43
|
+
|
44
|
+
By default, the sessions will be stored in the "sessions" collection in MongoDB. If you want to use a different collection, you can set that in the initializer:
|
45
|
+
|
46
|
+
```ruby
|
47
|
+
MongoSessionStore.collection_name = "client_sessions"
|
48
|
+
```
|
49
|
+
|
50
|
+
And if for some reason you want to query your sessions:
|
51
|
+
|
52
|
+
```ruby
|
53
|
+
# MongoMapper
|
54
|
+
MongoMapperStore::Session.where(:updated_at.gt => 2.days.ago)
|
55
|
+
|
56
|
+
# Mongoid
|
57
|
+
MongoidStore::Session.where(:updated_at.gt => 2.days.ago)
|
58
|
+
|
59
|
+
# Plain old Mongo
|
60
|
+
MongoStore::Session.where('updated_at' => { '$gt' => 2.days.ago })
|
61
|
+
```
|
62
|
+
|
63
|
+
## Changelog
|
64
|
+
|
65
|
+
7.0.0 supports Rails 5.0.
|
66
|
+
|
67
|
+
6.0.0 supports the Mongo Ruby Driver 2.0 for the generic MongoStore. The other stores are unchanged. Tests added for Rails 4.2. Tests against MongoDB 3.0.1 on Travis CI.
|
68
|
+
|
69
|
+
5.1.0 generates a new session ID when a session is not found. Previously, when a session ID is provided in the request but the session was not found (because for example, it was removed from Mongo by a sweeper job) a new session with the provided ID would be created. This would cause a write error if two simultaneous requests both create a session with the same ID and both try to insert a new document with that ID.
|
70
|
+
|
71
|
+
5.0.1 suppresses a warning from Mongoid 4 when setting the _id field type to String.
|
72
|
+
|
73
|
+
5.0.0 introduces Rails 4.0 and 4.1 support and Mongoid 4 support alongside the existing Rails 3.1, 3.2, and Mongoid 3 support. Ruby 1.8.7 support is dropped. The database is no longer set automatically for the MongoStore when MongoMapper or Mongoid is present. You have to set the database manually whenever you choose to use the vanilla MongoStore.
|
74
|
+
|
75
|
+
The last version to support Ruby 1.8.7 is [version 4.1.1](https://rubygems.org/gems/mongo_session_store-rails3/versions/4.1.1).
|
76
|
+
|
77
|
+
The last version to support Rails 3.0 or Mongoid 2 is [version 3.0.6](https://rubygems.org/gems/mongo_session_store-rails3/versions/3.0.6).
|
78
|
+
|
79
|
+
## Development
|
80
|
+
|
81
|
+
To run all the tests:
|
82
|
+
|
83
|
+
rake
|
84
|
+
|
85
|
+
To run the tests for a specific store (examples):
|
86
|
+
|
87
|
+
rake test_31_mongo
|
88
|
+
rake test_32_mongoid
|
89
|
+
rake test_40_mongoid
|
90
|
+
rake test_41_mongo_mapper
|
91
|
+
|
92
|
+
To see a list of all options for running tests, run
|
93
|
+
|
94
|
+
rake -T
|
95
|
+
|
96
|
+
## Previous contributors
|
97
|
+
|
98
|
+
MongoSessionStore started as a fork of the DataMapper session store, modified to work with MongoMapper and Mongoid. Much thanks to all the previous contributors:
|
99
|
+
|
100
|
+
* Nicolas Mérouze
|
101
|
+
* Chris Brickley
|
102
|
+
* Tony Pitale
|
103
|
+
* Nicola Racco
|
104
|
+
* Matt Powell
|
105
|
+
* Ryan Fitzgerald
|
106
|
+
|
107
|
+
## License
|
108
|
+
|
109
|
+
Copyright (c) 2011-2014 Brian Hempel
|
110
|
+
Copyright (c) 2010 Nicolas Mérouze
|
111
|
+
Copyright (c) 2009 Chris Brickley
|
112
|
+
Copyright (c) 2009 Tony Pitale
|
113
|
+
|
114
|
+
Permission is hereby granted, free of charge, to any person
|
115
|
+
obtaining a copy of this software and associated documentation
|
116
|
+
files (the "Software"), to deal in the Software without
|
117
|
+
restriction, including without limitation the rights to use,
|
118
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
119
|
+
copies of the Software, and to permit persons to whom the
|
120
|
+
Software is furnished to do so, subject to the following
|
121
|
+
conditions:
|
122
|
+
|
123
|
+
The above copyright notice and this permission notice shall be
|
124
|
+
included in all copies or substantial portions of the Software.
|
125
|
+
|
126
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
127
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
128
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
129
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
130
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
131
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
132
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
133
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,93 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
require 'bundler'
|
4
|
+
Bundler::GemHelper.install_tasks :name => 'mongo_session_store-rails5'
|
5
|
+
|
6
|
+
def run_with_output(command)
|
7
|
+
puts "Running: #{command}"
|
8
|
+
system(command)
|
9
|
+
end
|
10
|
+
|
11
|
+
def set_versions(rails_vers, orm)
|
12
|
+
success = true
|
13
|
+
unless File.exists?("Gemfile_Rails_#{rails_vers}_#{orm}_#{RUBY_VERSION}.lock")
|
14
|
+
success &&= run_with_output("export RAILS_VERS=#{rails_vers}; export MONGO_SESSION_STORE_ORM=#{orm}; bundle update")
|
15
|
+
success &&= run_with_output("cp Gemfile.lock Gemfile_Rails_#{rails_vers}_#{orm}_#{RUBY_VERSION}.lock")
|
16
|
+
else
|
17
|
+
success &&= run_with_output("rm Gemfile.lock")
|
18
|
+
success &&= run_with_output("cp Gemfile_Rails_#{rails_vers}_#{orm}_#{RUBY_VERSION}.lock Gemfile.lock")
|
19
|
+
end
|
20
|
+
success
|
21
|
+
end
|
22
|
+
|
23
|
+
@rails_versions = ['5.0']
|
24
|
+
@orms = ['mongo_mapper', 'mongoid', 'mongo']
|
25
|
+
|
26
|
+
task :default => :test_all
|
27
|
+
|
28
|
+
desc 'Test each session store against Rails 5.0'
|
29
|
+
task :test_all do
|
30
|
+
# inspired by http://pivotallabs.com/users/jdean/blog/articles/1728-testing-your-gem-against-multiple-rubies-and-rails-versions-with-rvm
|
31
|
+
|
32
|
+
# Wait for mongod to start on Travis.
|
33
|
+
# From the Mongo Ruby Driver gem.
|
34
|
+
if ENV['TRAVIS']
|
35
|
+
require 'mongo'
|
36
|
+
client = Mongo::Client.new(['127.0.0.1:27017'])
|
37
|
+
begin
|
38
|
+
puts "Waiting for MongoDB..."
|
39
|
+
client.command(Mongo::Server::Monitor::STATUS)
|
40
|
+
rescue Mongo::ServerSelector::NoServerAvailable => e
|
41
|
+
sleep(2)
|
42
|
+
# 1 Retry
|
43
|
+
puts "Waiting for MongoDB..."
|
44
|
+
client.cluster.scan!
|
45
|
+
client.command(Mongo::ServerSelector::NoServerAvailable)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
@failed_suites = []
|
50
|
+
|
51
|
+
@rails_versions.each do |rails_version|
|
52
|
+
@orms.each do |orm|
|
53
|
+
success = set_versions(rails_version, orm)
|
54
|
+
|
55
|
+
unless success && run_with_output("export RAILS_VERS=#{rails_version}; export MONGO_SESSION_STORE_ORM=#{orm}; bundle exec rspec spec")
|
56
|
+
@failed_suites << "Rails #{rails_version} / #{orm}"
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
if @failed_suites.any?
|
62
|
+
puts "\033[0;31mFailed:"
|
63
|
+
puts @failed_suites.join("\n")
|
64
|
+
print "\033[0m"
|
65
|
+
exit(1)
|
66
|
+
else
|
67
|
+
print "\033[0;32mAll passed! Success! "
|
68
|
+
"Yahoooo!!!".chars.each { |c| sleep 0.4; print c; STDOUT.flush }
|
69
|
+
puts "\033[0m"
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
@rails_versions.each do |rails_version|
|
74
|
+
@orms.each do |orm|
|
75
|
+
desc "Set Gemfile.lock to #{rails_version} with #{orm}"
|
76
|
+
task :"use_#{rails_version.gsub('.', '')}_#{orm}" do
|
77
|
+
set_versions(rails_version, orm)
|
78
|
+
end
|
79
|
+
|
80
|
+
desc "Test against #{rails_version} with #{orm}"
|
81
|
+
task :"test_#{rails_version.gsub('.', '')}_#{orm}" do
|
82
|
+
set_versions(rails_version, orm)
|
83
|
+
success = run_with_output("export RAILS_VERS=#{rails_version}; export MONGO_SESSION_STORE_ORM=#{orm}; bundle exec rspec spec")
|
84
|
+
exit(1) unless success
|
85
|
+
end
|
86
|
+
|
87
|
+
desc "Rebundle for #{rails_version} with #{orm}"
|
88
|
+
task :"rebundle_#{rails_version.gsub('.', '')}_#{orm}" do
|
89
|
+
run_with_output "rm Gemfile_Rails_#{rails_version}_#{orm}_#{RUBY_VERSION}.lock Gemfile.lock"
|
90
|
+
set_versions(rails_version, orm)
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'mongo_session_store'
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'mongo_session_store'
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'mongo_session_store'
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require 'securerandom'
|
2
|
+
|
3
|
+
$:.unshift File.dirname(__FILE__)
|
4
|
+
|
5
|
+
module MongoSessionStore
|
6
|
+
autoload :VERSION, 'mongo_session_store/version'
|
7
|
+
|
8
|
+
def self.collection_name=(name)
|
9
|
+
@collection_name = name
|
10
|
+
|
11
|
+
if defined?(MongoStore::Session)
|
12
|
+
MongoStore::Session.reset_collection
|
13
|
+
end
|
14
|
+
|
15
|
+
if defined?(MongoMapperStore::Session)
|
16
|
+
MongoMapperStore::Session.set_collection_name(name)
|
17
|
+
end
|
18
|
+
|
19
|
+
if defined?(MongoidStore::Session)
|
20
|
+
MongoidStore::Session.store_in :collection => MongoSessionStore.collection_name
|
21
|
+
end
|
22
|
+
|
23
|
+
@collection_name
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.collection_name
|
27
|
+
@collection_name
|
28
|
+
end
|
29
|
+
|
30
|
+
# default collection name for all the stores
|
31
|
+
self.collection_name = "sessions"
|
32
|
+
end
|
33
|
+
|
34
|
+
# we don't use autoloading because of thread concerns
|
35
|
+
# hence, this mess
|
36
|
+
load_errors = []
|
37
|
+
|
38
|
+
%w(mongo_mapper_store mongoid_store mongo_store).each do |store_name|
|
39
|
+
begin
|
40
|
+
require "mongo_session_store/#{store_name}"
|
41
|
+
rescue LoadError => e
|
42
|
+
load_errors << e
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
if load_errors.count == 3
|
47
|
+
message = "Could not load any session store!\n" + load_errors.map(&:message).join("\n")
|
48
|
+
raise LoadError, message
|
49
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'mongo_mapper'
|
2
|
+
require 'mongo_session_store/mongo_store_base'
|
3
|
+
|
4
|
+
module ActionDispatch
|
5
|
+
module Session
|
6
|
+
class MongoMapperStore < MongoStoreBase
|
7
|
+
|
8
|
+
class Session
|
9
|
+
include MongoMapper::Document
|
10
|
+
set_collection_name MongoSessionStore.collection_name
|
11
|
+
|
12
|
+
key :_id, String
|
13
|
+
key :data, Binary, :default => Marshal.dump({})
|
14
|
+
|
15
|
+
timestamps!
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
MongoMapperStore = ActionDispatch::Session::MongoMapperStore
|
@@ -0,0 +1,83 @@
|
|
1
|
+
require 'mongo'
|
2
|
+
require 'mongo_session_store/mongo_store_base'
|
3
|
+
|
4
|
+
module ActionDispatch
|
5
|
+
module Session
|
6
|
+
class MongoStore < MongoStoreBase
|
7
|
+
class Session
|
8
|
+
attr_accessor :_id, :data, :created_at, :updated_at
|
9
|
+
|
10
|
+
def initialize(options = {})
|
11
|
+
@_id = options[:_id]
|
12
|
+
@data = options[:data] || BSON::Binary.new(Marshal.dump({}), :generic)
|
13
|
+
@created_at = options[:created_at]
|
14
|
+
@updated_at = options[:updated_at]
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.load(options = {})
|
18
|
+
options[:data] = options["data"] if options["data"]
|
19
|
+
new(options)
|
20
|
+
end
|
21
|
+
|
22
|
+
def scope
|
23
|
+
collection.find(:_id => _id)
|
24
|
+
end
|
25
|
+
|
26
|
+
def destroy
|
27
|
+
scope.delete_one
|
28
|
+
end
|
29
|
+
|
30
|
+
def save
|
31
|
+
@created_at ||= Time.now
|
32
|
+
@updated_at = Time.now
|
33
|
+
|
34
|
+
attributes = {
|
35
|
+
:data => BSON::Binary.new(@data, :generic),
|
36
|
+
:created_at => @created_at,
|
37
|
+
:updated_at => @updated_at
|
38
|
+
}
|
39
|
+
|
40
|
+
scope.replace_one(attributes, upsert: true)
|
41
|
+
end
|
42
|
+
|
43
|
+
def data=(stuff)
|
44
|
+
@data = stuff.to_s
|
45
|
+
end
|
46
|
+
|
47
|
+
def self.where(query = {})
|
48
|
+
collection.find(query).map { |doc| load(doc) }
|
49
|
+
end
|
50
|
+
|
51
|
+
def self.last
|
52
|
+
where.last
|
53
|
+
end
|
54
|
+
|
55
|
+
def self.database
|
56
|
+
if @database
|
57
|
+
@database
|
58
|
+
else
|
59
|
+
raise "MongoStore needs a database, e.g. MongoStore::Session.database = Mongo::Client.new(['127.0.0.1:27017'], database: \"my_app_development\")"
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
def self.database=(database)
|
64
|
+
@database = database
|
65
|
+
end
|
66
|
+
|
67
|
+
def self.collection
|
68
|
+
@collection ||= database[MongoSessionStore.collection_name]
|
69
|
+
end
|
70
|
+
|
71
|
+
def self.reset_collection
|
72
|
+
@collection = nil
|
73
|
+
end
|
74
|
+
|
75
|
+
def collection
|
76
|
+
self.class.collection
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
MongoStore = ActionDispatch::Session::MongoStore
|