From 3798e3bd4dba6711826ba9664651b4d6da2e9dbf Mon Sep 17 00:00:00 2001 From: Tom de Bruijn Date: Tue, 10 Feb 2026 22:05:12 +0100 Subject: [PATCH 1/4] Update RuboCop to a more recent version Which runs on more recent Ruby versions too. --- .rubocop.yml | 8 ++++---- mongo_session_store.gemspec | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index f1fe371..2494de5 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -21,19 +21,19 @@ Style/StringLiterals: Style/StringLiteralsInInterpolation: EnforcedStyle: double_quotes -Style/AlignParameters: +Layout/ParameterAlignment: EnforcedStyle: with_fixed_indentation -Style/MultilineOperationIndentation: +Layout/MultilineOperationIndentation: EnforcedStyle: indented -Style/AlignHash: +Layout/HashAlignment: EnforcedLastArgumentHashStyle: ignore_implicit Style/HashSyntax: EnforcedStyle: hash_rockets -Style/IndentArray: +Layout/FirstArrayElementIndentation: EnforcedStyle: consistent Style/FormatString: diff --git a/mongo_session_store.gemspec b/mongo_session_store.gemspec index 3dc4ee4..be47506 100644 --- a/mongo_session_store.gemspec +++ b/mongo_session_store.gemspec @@ -21,6 +21,6 @@ Gem::Specification.new do |s| s.add_development_dependency "capybara", "~> 2.15.0" s.add_development_dependency "pry", "~> 0.10" s.add_development_dependency "rake", "~> 11" - s.add_development_dependency "rubocop", "0.45.0" s.add_development_dependency "mongoid-danger", "~> 0.1.0" + s.add_development_dependency "rubocop", "1.84.1" end From 7c80257ca946d06fcc8726836c56965cb775e9be Mon Sep 17 00:00:00 2001 From: Tom de Bruijn Date: Thu, 7 Aug 2025 08:53:42 +0200 Subject: [PATCH 2/4] Move CI to GitHub Actions In the process I've removed old Rails 4.0 versions because they're long EOL and I can't make it work locally or on the CI. It doesn't test on all the EOL Ruby versions, but only tests on the Ruby 2.6 or 2.7 depending on the Rails version it tests agains. I've not migrated danger as there's another PR open for that. --- .github/workflows/ci.yml | 83 ++++++ .travis.yml | 109 -------- Gemfile | 2 + README.md | 8 +- gemfiles/rails-4.0-mongo.gemfile | 9 - gemfiles/rails-4.0-mongoid.gemfile | 9 - gemfiles/rails-4.1-mongo.gemfile | 9 - gemfiles/rails-4.1-mongoid.gemfile | 9 - gemfiles/rails-4.2-mongo.gemfile | 9 - gemfiles/rails-4.2-mongoid.gemfile | 9 - gemfiles/rails-5.1-mongoid.gemfile | 2 +- gemfiles/rails-6.0-mongo.gemfile | 3 + gemfiles/rails-6.0-mongoid.gemfile | 3 + lib/mongo_session_store/mongoid_store.rb | 1 + mongo_session_store.gemspec | 8 +- spec/spec_helper.rb | 5 +- spec/support/apps/rails_4.0_app/Rakefile | 6 - .../app/controllers/application_controller.rb | 5 - .../app/controllers/home_controller.rb | 2 - .../apps/rails_4.0_app/app/models/user.rb | 5 - .../app/views/home/index.html.erb | 9 - .../app/views/layouts/application.html.erb | 17 -- spec/support/apps/rails_4.0_app/bin/bundle | 3 - spec/support/apps/rails_4.0_app/bin/rails | 4 - spec/support/apps/rails_4.0_app/bin/rake | 4 - spec/support/apps/rails_4.0_app/config.ru | 4 - .../apps/rails_4.0_app/config/application.rb | 11 - .../support/apps/rails_4.0_app/config/boot.rb | 4 - .../apps/rails_4.0_app/config/database.yml | 11 - .../apps/rails_4.0_app/config/environment.rb | 5 - .../config/environments/development.rb | 12 - .../rails_4.0_app/config/environments/test.rb | 19 -- .../config/initializers/devise.rb | 254 ------------------ .../config/initializers/secret_token.rb | 12 - .../config/initializers/session_store.rb | 1 - .../config/locales/devise.en.yml | 59 ---- .../apps/rails_4.0_app/config/locales/en.yml | 23 -- .../apps/rails_4.0_app/config/mongo.yml | 11 - .../apps/rails_4.0_app/config/mongoid.yml | 13 - .../apps/rails_4.0_app/config/routes.rb | 5 - .../20140301171212_add_devise_users.rb | 11 - spec/support/apps/rails_4.0_app/db/schema.rb | 25 -- .../apps/rails_4.0_app/lib/assets/.keep | 0 .../apps/rails_4.0_app/lib/tasks/.keep | 0 spec/support/apps/rails_4.0_app/log/.keep | 0 spec/support/apps/rails_4.1_app/Rakefile | 3 - .../app/controllers/application_controller.rb | 5 - .../app/controllers/home_controller.rb | 2 - .../apps/rails_4.1_app/app/models/user.rb | 5 - .../app/views/home/index.html.erb | 9 - .../app/views/layouts/application.html.erb | 17 -- spec/support/apps/rails_4.1_app/bin/bundle | 3 - spec/support/apps/rails_4.1_app/bin/rails | 4 - spec/support/apps/rails_4.1_app/bin/rake | 4 - spec/support/apps/rails_4.1_app/config.ru | 2 - .../apps/rails_4.1_app/config/application.rb | 11 - .../support/apps/rails_4.1_app/config/boot.rb | 4 - .../apps/rails_4.1_app/config/database.yml | 11 - .../apps/rails_4.1_app/config/environment.rb | 5 - .../config/environments/development.rb | 12 - .../rails_4.1_app/config/environments/test.rb | 19 -- .../config/initializers/devise.rb | 254 ------------------ .../config/initializers/session_store.rb | 1 - .../config/locales/devise.en.yml | 59 ---- .../apps/rails_4.1_app/config/locales/en.yml | 23 -- .../apps/rails_4.1_app/config/mongo.yml | 11 - .../apps/rails_4.1_app/config/mongoid.yml | 13 - .../apps/rails_4.1_app/config/routes.rb | 5 - .../apps/rails_4.1_app/config/secrets.yml | 22 -- .../20140301171212_add_devise_users.rb | 11 - spec/support/apps/rails_4.1_app/db/schema.rb | 25 -- .../apps/rails_4.1_app/lib/assets/.keep | 0 .../apps/rails_4.1_app/lib/tasks/.keep | 0 spec/support/apps/rails_4.1_app/log/.keep | 0 spec/support/apps/rails_4.2_app/Rakefile | 2 - .../app/controllers/application_controller.rb | 5 - .../app/controllers/home_controller.rb | 2 - .../apps/rails_4.2_app/app/models/user.rb | 5 - .../app/views/home/index.html.erb | 9 - .../app/views/layouts/application.html.erb | 15 -- spec/support/apps/rails_4.2_app/bin/bundle | 3 - spec/support/apps/rails_4.2_app/bin/rails | 8 - spec/support/apps/rails_4.2_app/bin/rake | 4 - spec/support/apps/rails_4.2_app/config.ru | 4 - .../apps/rails_4.2_app/config/application.rb | 11 - .../support/apps/rails_4.2_app/config/boot.rb | 3 - .../apps/rails_4.2_app/config/database.yml | 11 - .../apps/rails_4.2_app/config/environment.rb | 5 - .../config/environments/development.rb | 12 - .../rails_4.2_app/config/environments/test.rb | 19 -- .../config/initializers/devise.rb | 254 ------------------ .../config/initializers/session_store.rb | 1 - .../apps/rails_4.2_app/config/locales/en.yml | 23 -- .../apps/rails_4.2_app/config/mongo.yml | 11 - .../apps/rails_4.2_app/config/mongoid.yml | 13 - .../apps/rails_4.2_app/config/routes.rb | 5 - .../apps/rails_4.2_app/config/secrets.yml | 22 -- .../20140301171212_add_devise_users.rb | 11 - spec/support/apps/rails_4.2_app/db/schema.rb | 25 -- spec/support/rack_app.rb | 4 +- 100 files changed, 103 insertions(+), 1737 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml delete mode 100644 gemfiles/rails-4.0-mongo.gemfile delete mode 100644 gemfiles/rails-4.0-mongoid.gemfile delete mode 100644 gemfiles/rails-4.1-mongo.gemfile delete mode 100644 gemfiles/rails-4.1-mongoid.gemfile delete mode 100644 gemfiles/rails-4.2-mongo.gemfile delete mode 100644 gemfiles/rails-4.2-mongoid.gemfile delete mode 100644 spec/support/apps/rails_4.0_app/Rakefile delete mode 100644 spec/support/apps/rails_4.0_app/app/controllers/application_controller.rb delete mode 100644 spec/support/apps/rails_4.0_app/app/controllers/home_controller.rb delete mode 100644 spec/support/apps/rails_4.0_app/app/models/user.rb delete mode 100644 spec/support/apps/rails_4.0_app/app/views/home/index.html.erb delete mode 100644 spec/support/apps/rails_4.0_app/app/views/layouts/application.html.erb delete mode 100755 spec/support/apps/rails_4.0_app/bin/bundle delete mode 100755 spec/support/apps/rails_4.0_app/bin/rails delete mode 100755 spec/support/apps/rails_4.0_app/bin/rake delete mode 100644 spec/support/apps/rails_4.0_app/config.ru delete mode 100644 spec/support/apps/rails_4.0_app/config/application.rb delete mode 100644 spec/support/apps/rails_4.0_app/config/boot.rb delete mode 100644 spec/support/apps/rails_4.0_app/config/database.yml delete mode 100644 spec/support/apps/rails_4.0_app/config/environment.rb delete mode 100644 spec/support/apps/rails_4.0_app/config/environments/development.rb delete mode 100644 spec/support/apps/rails_4.0_app/config/environments/test.rb delete mode 100644 spec/support/apps/rails_4.0_app/config/initializers/devise.rb delete mode 100644 spec/support/apps/rails_4.0_app/config/initializers/secret_token.rb delete mode 100644 spec/support/apps/rails_4.0_app/config/initializers/session_store.rb delete mode 100644 spec/support/apps/rails_4.0_app/config/locales/devise.en.yml delete mode 100644 spec/support/apps/rails_4.0_app/config/locales/en.yml delete mode 100644 spec/support/apps/rails_4.0_app/config/mongo.yml delete mode 100644 spec/support/apps/rails_4.0_app/config/mongoid.yml delete mode 100644 spec/support/apps/rails_4.0_app/config/routes.rb delete mode 100644 spec/support/apps/rails_4.0_app/db/migrate/20140301171212_add_devise_users.rb delete mode 100644 spec/support/apps/rails_4.0_app/db/schema.rb delete mode 100644 spec/support/apps/rails_4.0_app/lib/assets/.keep delete mode 100644 spec/support/apps/rails_4.0_app/lib/tasks/.keep delete mode 100644 spec/support/apps/rails_4.0_app/log/.keep delete mode 100644 spec/support/apps/rails_4.1_app/Rakefile delete mode 100644 spec/support/apps/rails_4.1_app/app/controllers/application_controller.rb delete mode 100644 spec/support/apps/rails_4.1_app/app/controllers/home_controller.rb delete mode 100644 spec/support/apps/rails_4.1_app/app/models/user.rb delete mode 100644 spec/support/apps/rails_4.1_app/app/views/home/index.html.erb delete mode 100644 spec/support/apps/rails_4.1_app/app/views/layouts/application.html.erb delete mode 100755 spec/support/apps/rails_4.1_app/bin/bundle delete mode 100755 spec/support/apps/rails_4.1_app/bin/rails delete mode 100755 spec/support/apps/rails_4.1_app/bin/rake delete mode 100644 spec/support/apps/rails_4.1_app/config.ru delete mode 100644 spec/support/apps/rails_4.1_app/config/application.rb delete mode 100644 spec/support/apps/rails_4.1_app/config/boot.rb delete mode 100644 spec/support/apps/rails_4.1_app/config/database.yml delete mode 100644 spec/support/apps/rails_4.1_app/config/environment.rb delete mode 100644 spec/support/apps/rails_4.1_app/config/environments/development.rb delete mode 100644 spec/support/apps/rails_4.1_app/config/environments/test.rb delete mode 100644 spec/support/apps/rails_4.1_app/config/initializers/devise.rb delete mode 100644 spec/support/apps/rails_4.1_app/config/initializers/session_store.rb delete mode 100644 spec/support/apps/rails_4.1_app/config/locales/devise.en.yml delete mode 100644 spec/support/apps/rails_4.1_app/config/locales/en.yml delete mode 100644 spec/support/apps/rails_4.1_app/config/mongo.yml delete mode 100644 spec/support/apps/rails_4.1_app/config/mongoid.yml delete mode 100644 spec/support/apps/rails_4.1_app/config/routes.rb delete mode 100644 spec/support/apps/rails_4.1_app/config/secrets.yml delete mode 100644 spec/support/apps/rails_4.1_app/db/migrate/20140301171212_add_devise_users.rb delete mode 100644 spec/support/apps/rails_4.1_app/db/schema.rb delete mode 100644 spec/support/apps/rails_4.1_app/lib/assets/.keep delete mode 100644 spec/support/apps/rails_4.1_app/lib/tasks/.keep delete mode 100644 spec/support/apps/rails_4.1_app/log/.keep delete mode 100644 spec/support/apps/rails_4.2_app/Rakefile delete mode 100644 spec/support/apps/rails_4.2_app/app/controllers/application_controller.rb delete mode 100644 spec/support/apps/rails_4.2_app/app/controllers/home_controller.rb delete mode 100644 spec/support/apps/rails_4.2_app/app/models/user.rb delete mode 100644 spec/support/apps/rails_4.2_app/app/views/home/index.html.erb delete mode 100644 spec/support/apps/rails_4.2_app/app/views/layouts/application.html.erb delete mode 100755 spec/support/apps/rails_4.2_app/bin/bundle delete mode 100755 spec/support/apps/rails_4.2_app/bin/rails delete mode 100755 spec/support/apps/rails_4.2_app/bin/rake delete mode 100644 spec/support/apps/rails_4.2_app/config.ru delete mode 100644 spec/support/apps/rails_4.2_app/config/application.rb delete mode 100644 spec/support/apps/rails_4.2_app/config/boot.rb delete mode 100644 spec/support/apps/rails_4.2_app/config/database.yml delete mode 100644 spec/support/apps/rails_4.2_app/config/environment.rb delete mode 100644 spec/support/apps/rails_4.2_app/config/environments/development.rb delete mode 100644 spec/support/apps/rails_4.2_app/config/environments/test.rb delete mode 100644 spec/support/apps/rails_4.2_app/config/initializers/devise.rb delete mode 100644 spec/support/apps/rails_4.2_app/config/initializers/session_store.rb delete mode 100644 spec/support/apps/rails_4.2_app/config/locales/en.yml delete mode 100644 spec/support/apps/rails_4.2_app/config/mongo.yml delete mode 100644 spec/support/apps/rails_4.2_app/config/mongoid.yml delete mode 100644 spec/support/apps/rails_4.2_app/config/routes.rb delete mode 100644 spec/support/apps/rails_4.2_app/config/secrets.yml delete mode 100644 spec/support/apps/rails_4.2_app/db/migrate/20140301171212_add_devise_users.rb delete mode 100644 spec/support/apps/rails_4.2_app/db/schema.rb diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..818549d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,83 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + types: + - opened + - reopened + - synchronize + +concurrency: + group: "${{ github.workflow }}-${{ github.ref }}" + cancel-in-progress: "${{ !contains(github.ref, 'main')}}" + +jobs: + test: + name: "Run tests" + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + ruby: + - "3.4" + - "3.3" + gemfile: + - gemfiles/rails-6.0-mongo.gemfile + - gemfiles/rails-6.0-mongoid.gemfile + include: + - gemfile: gemfiles/rails-5.2-mongo.gemfile + ruby: "2.7" + - gemfile: gemfiles/rails-5.2-mongoid.gemfile + ruby: "2.7" + - gemfile: gemfiles/rails-5.1-mongo.gemfile + ruby: "2.6" + - gemfile: gemfiles/rails-5.1-mongoid.gemfile + ruby: "2.6" + - gemfile: gemfiles/rails-5.0-mongo.gemfile + ruby: "2.6" + - gemfile: gemfiles/rails-5.0-mongoid.gemfile + ruby: "2.6" + + services: + mongodb: + image: mongo:3.6 + ports: + - 27017:27017 + + env: + BUNDLE_GEMFILE: ${{ matrix.gemfile }} + + steps: + - name: Checkout project + uses: actions/checkout@v4 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + + - name: Run tests + run: bundle exec rake test + + rubocop: + name: "RuboCop" + runs-on: ubuntu-latest + + steps: + - name: Checkout project + uses: actions/checkout@v4 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.3" + gemfile: gemfiles/rails-6.0-mongo.gemfile + bundler-cache: true + + - name: Run RuboCop + run: bundle exec rubocop diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 0a71a3f..0000000 --- a/.travis.yml +++ /dev/null @@ -1,109 +0,0 @@ -branches: - only: - - master - - develop -language: ruby - -cache: bundler - -rvm: - - 2.1.10 - - 2.3.8 - - 2.4.5 - - 2.5.5 - - 2.6.3 - -gemfile: - - gemfiles/rails-4.0-mongo.gemfile - - gemfiles/rails-4.0-mongoid.gemfile - - gemfiles/rails-4.1-mongo.gemfile - - gemfiles/rails-4.1-mongoid.gemfile - - gemfiles/rails-4.2-mongo.gemfile - - gemfiles/rails-4.2-mongoid.gemfile - - gemfiles/rails-5.0-mongo.gemfile - - gemfiles/rails-5.0-mongoid.gemfile - - gemfiles/rails-5.1-mongo.gemfile - - gemfiles/rails-5.1-mongoid.gemfile - - gemfiles/rails-5.2-mongo.gemfile - - gemfiles/rails-5.2-mongoid.gemfile - - gemfiles/rails-6.0-mongo.gemfile - - gemfiles/rails-6.0-mongoid.gemfile - -matrix: - fast_finish: true - include: - - rvm: 2.5.5 - gemfile: gemfiles/rails-5.2-mongo.gemfile - script: bundle exec rubocop - - rvm: 2.5.5 - gemfile: gemfiles/rails-5.2-mongo.gemfile - script: bundle exec danger - exclude: - - rvm: 2.1.10 - gemfile: gemfiles/rails-5.0-mongo.gemfile - - rvm: 2.1.10 - gemfile: gemfiles/rails-5.0-mongoid.gemfile - - rvm: 2.1.10 - gemfile: gemfiles/rails-5.1-mongo.gemfile - - rvm: 2.1.10 - gemfile: gemfiles/rails-5.1-mongoid.gemfile - - rvm: 2.1.10 - gemfile: gemfiles/rails-5.2-mongo.gemfile - - rvm: 2.1.10 - gemfile: gemfiles/rails-5.2-mongoid.gemfile - - rvm: 2.1.10 - gemfile: gemfiles/rails-6.0-mongo.gemfile - - rvm: 2.1.10 - gemfile: gemfiles/rails-6.0-mongoid.gemfile - - rvm: 2.3.8 - gemfile: gemfiles/rails-6.0-mongo.gemfile - - rvm: 2.3.8 - gemfile: gemfiles/rails-6.0-mongoid.gemfile - - rvm: 2.4.5 - gemfile: gemfiles/rails-4.0-mongo.gemfile - - rvm: 2.4.5 - gemfile: gemfiles/rails-4.0-mongoid.gemfile - - rvm: 2.4.5 - gemfile: gemfiles/rails-4.1-mongo.gemfile - - rvm: 2.4.5 - gemfile: gemfiles/rails-4.1-mongoid.gemfile - - rvm: 2.4.5 - gemfile: gemfiles/rails-6.0-mongo.gemfile - - rvm: 2.4.5 - gemfile: gemfiles/rails-6.0-mongoid.gemfile - - rvm: 2.5.5 - gemfile: gemfiles/rails-4.0-mongo.gemfile - - rvm: 2.5.5 - gemfile: gemfiles/rails-4.0-mongoid.gemfile - - rvm: 2.5.5 - gemfile: gemfiles/rails-4.1-mongo.gemfile - - rvm: 2.5.5 - gemfile: gemfiles/rails-4.1-mongoid.gemfile - - rvm: 2.5.5 - gemfile: gemfiles/rails-4.2-mongo.gemfile - - rvm: 2.5.5 - gemfile: gemfiles/rails-4.2-mongoid.gemfile - - rvm: 2.6.3 - gemfile: gemfiles/rails-4.0-mongo.gemfile - - rvm: 2.6.3 - gemfile: gemfiles/rails-4.0-mongoid.gemfile - - rvm: 2.6.3 - gemfile: gemfiles/rails-4.1-mongo.gemfile - - rvm: 2.6.3 - gemfile: gemfiles/rails-4.1-mongoid.gemfile - - rvm: 2.6.3 - gemfile: gemfiles/rails-4.2-mongo.gemfile - - rvm: 2.6.3 - gemfile: gemfiles/rails-4.2-mongoid.gemfile - -services: mongodb - -addons: - apt: - sources: - - mongodb-3.2-precise - packages: - - mongodb-org-server - -script: - - bundle exec rake test diff --git a/Gemfile b/Gemfile index b4e2a20..6573003 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,5 @@ source "https://rubygems.org" gemspec + +gem "rubocop", "1.84.1" diff --git a/README.md b/README.md index 5eb7181..de89c99 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ MongoSessionStore is a [Rails][rails]-compatible session store for Driver][mongo]. It also allows for custom Mongo session store that works with any (or no!) Mongo ODM. -MongoSessionStore version 3 is compatible with Rails 4.0 through 5.2. For Rails +MongoSessionStore version 3 is compatible with Rails 5.0+. For Rails 3 support please check out issue [#17][issue-rails3] for options and let us know if you need support. @@ -82,12 +82,6 @@ bundle exec rake Examples: ```sh -BUNDLE_GEMFILE=gemfiles/rails-4.0-mongo.gemfile bundle exec rake -BUNDLE_GEMFILE=gemfiles/rails-4.0-mongoid.gemfile bundle exec rake -BUNDLE_GEMFILE=gemfiles/rails-4.1-mongo.gemfile bundle exec rake -BUNDLE_GEMFILE=gemfiles/rails-4.1-mongoid.gemfile bundle exec rake -BUNDLE_GEMFILE=gemfiles/rails-4.2-mongo.gemfile bundle exec rake -BUNDLE_GEMFILE=gemfiles/rails-4.2-mongoid.gemfile bundle exec rake BUNDLE_GEMFILE=gemfiles/rails-5.0-mongo.gemfile bundle exec rake BUNDLE_GEMFILE=gemfiles/rails-5.0-mongoid.gemfile bundle exec rake BUNDLE_GEMFILE=gemfiles/rails-5.1-mongo.gemfile bundle exec rake diff --git a/gemfiles/rails-4.0-mongo.gemfile b/gemfiles/rails-4.0-mongo.gemfile deleted file mode 100644 index 83442f2..0000000 --- a/gemfiles/rails-4.0-mongo.gemfile +++ /dev/null @@ -1,9 +0,0 @@ -source "https://rubygems.org" - -gem "mongo" - -gem "rails", "~> 4.0.0" -gem "devise", "~> 3.5" -gem "sqlite3", "~> 1.3.6" - -gemspec :path => "../" diff --git a/gemfiles/rails-4.0-mongoid.gemfile b/gemfiles/rails-4.0-mongoid.gemfile deleted file mode 100644 index 03564c5..0000000 --- a/gemfiles/rails-4.0-mongoid.gemfile +++ /dev/null @@ -1,9 +0,0 @@ -source "https://rubygems.org" - -gem "mongoid" - -gem "rails", "~> 4.0.0" -gem "devise", "~> 3.5" -gem "sqlite3", "~> 1.3.6" - -gemspec :path => "../" diff --git a/gemfiles/rails-4.1-mongo.gemfile b/gemfiles/rails-4.1-mongo.gemfile deleted file mode 100644 index ef38a16..0000000 --- a/gemfiles/rails-4.1-mongo.gemfile +++ /dev/null @@ -1,9 +0,0 @@ -source "https://rubygems.org" - -gem "mongo" - -gem "rails", "~> 4.1.0" -gem "devise", Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.1") ? "3.5.10" : ">= 4.2" -gem "sqlite3", "~> 1.3.6" - -gemspec :path => "../" diff --git a/gemfiles/rails-4.1-mongoid.gemfile b/gemfiles/rails-4.1-mongoid.gemfile deleted file mode 100644 index b09c1f4..0000000 --- a/gemfiles/rails-4.1-mongoid.gemfile +++ /dev/null @@ -1,9 +0,0 @@ -source "https://rubygems.org" - -gem "mongoid" - -gem "rails", "~> 4.1.0" -gem "devise", Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.1") ? "3.5.10" : ">= 4.2" -gem "sqlite3", "~> 1.3.6" - -gemspec :path => "../" diff --git a/gemfiles/rails-4.2-mongo.gemfile b/gemfiles/rails-4.2-mongo.gemfile deleted file mode 100644 index e67417d..0000000 --- a/gemfiles/rails-4.2-mongo.gemfile +++ /dev/null @@ -1,9 +0,0 @@ -source "https://rubygems.org" - -gem "mongo" - -gem "rails", "~> 4.2.8" -gem "devise", Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.1") ? "3.5.10" : ">= 4.2" -gem "sqlite3", "~> 1.3.6" - -gemspec :path => "../" diff --git a/gemfiles/rails-4.2-mongoid.gemfile b/gemfiles/rails-4.2-mongoid.gemfile deleted file mode 100644 index cf68caf..0000000 --- a/gemfiles/rails-4.2-mongoid.gemfile +++ /dev/null @@ -1,9 +0,0 @@ -source "https://rubygems.org" - -gem "mongoid" - -gem "rails", "~> 4.2.8" -gem "devise", Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.1") ? "3.5.10" : ">= 4.2" -gem "sqlite3", "~> 1.3.6" - -gemspec :path => "../" diff --git a/gemfiles/rails-5.1-mongoid.gemfile b/gemfiles/rails-5.1-mongoid.gemfile index 039d7f1..3026635 100644 --- a/gemfiles/rails-5.1-mongoid.gemfile +++ b/gemfiles/rails-5.1-mongoid.gemfile @@ -1,6 +1,6 @@ source "https://rubygems.org" -gem "mongoid" +gem "mongoid", "~> 7.0" gem "rails", "~> 5.1.0" gem "devise", ">= 4.2" diff --git a/gemfiles/rails-6.0-mongo.gemfile b/gemfiles/rails-6.0-mongo.gemfile index 0fc3419..5498b5a 100644 --- a/gemfiles/rails-6.0-mongo.gemfile +++ b/gemfiles/rails-6.0-mongo.gemfile @@ -5,5 +5,8 @@ gem "mongo" gem "rails", "~> 6.0.0" gem "devise", "~> 4.7.0" gem "sqlite3", "~> 1.4.0" +gem "bigdecimal" +gem "mutex_m" +gem "drb" gemspec :path => "../" diff --git a/gemfiles/rails-6.0-mongoid.gemfile b/gemfiles/rails-6.0-mongoid.gemfile index f49690d..2a1a2a1 100644 --- a/gemfiles/rails-6.0-mongoid.gemfile +++ b/gemfiles/rails-6.0-mongoid.gemfile @@ -5,5 +5,8 @@ gem "mongoid" gem "rails", "~> 6.0.0" gem "devise", "~> 4.7.0" gem "sqlite3", "~> 1.4.0" +gem "bigdecimal" +gem "mutex_m" +gem "drb" gemspec :path => "../" diff --git a/lib/mongo_session_store/mongoid_store.rb b/lib/mongo_session_store/mongoid_store.rb index 140b1a5..cc4c610 100644 --- a/lib/mongo_session_store/mongoid_store.rb +++ b/lib/mongo_session_store/mongoid_store.rb @@ -38,6 +38,7 @@ def pack(data) def unpack(packed) return unless packed + if packed.respond_to? :data Marshal.load(packed.data) else diff --git a/mongo_session_store.gemspec b/mongo_session_store.gemspec index be47506..2899f06 100644 --- a/mongo_session_store.gemspec +++ b/mongo_session_store.gemspec @@ -1,4 +1,4 @@ -require File.expand_path("../lib/mongo_session_store/version", __FILE__) +require File.expand_path("lib/mongo_session_store/version", __dir__) Gem::Specification.new do |s| s.name = "mongo_session_store" @@ -17,10 +17,8 @@ Gem::Specification.new do |s| s.add_dependency "actionpack", ">= 4.0" s.add_dependency "mongo", "~> 2.0" - s.add_development_dependency "rspec-rails", "~> 3.6" s.add_development_dependency "capybara", "~> 2.15.0" - s.add_development_dependency "pry", "~> 0.10" - s.add_development_dependency "rake", "~> 11" s.add_development_dependency "mongoid-danger", "~> 0.1.0" - s.add_development_dependency "rubocop", "1.84.1" + s.add_development_dependency "rake" + s.add_development_dependency "rspec-rails", ">= 4.0" end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index b1dec43..0c3f40a 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -27,6 +27,7 @@ def mongo_orm config.before :suite do Mongo::Logger.logger.level = ::Logger::INFO + mongodb_host = ENV["MONGODB_HOST"] || "127.0.0.1" if mongo_orm == "mongoid" Mongoid.logger.level = Logger::INFO Mongoid.configure do |c| @@ -34,14 +35,14 @@ def mongo_orm "clients" => { "default" => { "database" => TestDatabaseHelper.test_database_name, - "hosts" => ["127.0.0.1:27017"] + "hosts" => ["#{mongodb_host}:27017"] } } ) end else MongoStore::Session.database = Mongo::Client.new( - ["127.0.0.1:27017"], + ["#{mongodb_host}:27017"], :database => TestDatabaseHelper.test_database_name ) end diff --git a/spec/support/apps/rails_4.0_app/Rakefile b/spec/support/apps/rails_4.0_app/Rakefile deleted file mode 100644 index afe6ad0..0000000 --- a/spec/support/apps/rails_4.0_app/Rakefile +++ /dev/null @@ -1,6 +0,0 @@ -# Add your own tasks in files placed in lib/tasks ending in .rake, -# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. - -require File.expand_path('../config/application', __FILE__) - -Rails40App::Application.load_tasks diff --git a/spec/support/apps/rails_4.0_app/app/controllers/application_controller.rb b/spec/support/apps/rails_4.0_app/app/controllers/application_controller.rb deleted file mode 100644 index d83690e..0000000 --- a/spec/support/apps/rails_4.0_app/app/controllers/application_controller.rb +++ /dev/null @@ -1,5 +0,0 @@ -class ApplicationController < ActionController::Base - # Prevent CSRF attacks by raising an exception. - # For APIs, you may want to use :null_session instead. - protect_from_forgery with: :exception -end diff --git a/spec/support/apps/rails_4.0_app/app/controllers/home_controller.rb b/spec/support/apps/rails_4.0_app/app/controllers/home_controller.rb deleted file mode 100644 index fc0b474..0000000 --- a/spec/support/apps/rails_4.0_app/app/controllers/home_controller.rb +++ /dev/null @@ -1,2 +0,0 @@ -class HomeController < ApplicationController -end diff --git a/spec/support/apps/rails_4.0_app/app/models/user.rb b/spec/support/apps/rails_4.0_app/app/models/user.rb deleted file mode 100644 index ce62fef..0000000 --- a/spec/support/apps/rails_4.0_app/app/models/user.rb +++ /dev/null @@ -1,5 +0,0 @@ -class User < ActiveRecord::Base - # Include default devise modules. Others available are: - # :confirmable, :lockable, :timeoutable and :omniauthable - devise :database_authenticatable, :registerable -end \ No newline at end of file diff --git a/spec/support/apps/rails_4.0_app/app/views/home/index.html.erb b/spec/support/apps/rails_4.0_app/app/views/home/index.html.erb deleted file mode 100644 index 70751e2..0000000 --- a/spec/support/apps/rails_4.0_app/app/views/home/index.html.erb +++ /dev/null @@ -1,9 +0,0 @@ -You are signed -<% if user_signed_in? %> - in as <%= current_user.email %>. - <%= form_tag destroy_user_session_path, :method => :delete do %> - <%= button_tag "Sign out" %> - <% end %> -<% else %> - out. <%= link_to "Sign in", new_user_session_path %> -<% end %> diff --git a/spec/support/apps/rails_4.0_app/app/views/layouts/application.html.erb b/spec/support/apps/rails_4.0_app/app/views/layouts/application.html.erb deleted file mode 100644 index 346b1a7..0000000 --- a/spec/support/apps/rails_4.0_app/app/views/layouts/application.html.erb +++ /dev/null @@ -1,17 +0,0 @@ - - - - Rails40App - <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %> - <%= javascript_include_tag "application", "data-turbolinks-track" => true %> - <%= csrf_meta_tags %> - - - -<%= notice %> -<%= alert %> - -<%= yield %> - - - diff --git a/spec/support/apps/rails_4.0_app/bin/bundle b/spec/support/apps/rails_4.0_app/bin/bundle deleted file mode 100755 index fe18745..0000000 --- a/spec/support/apps/rails_4.0_app/bin/bundle +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env ruby -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __FILE__) -load Gem.bin_path("bundler", "bundle") diff --git a/spec/support/apps/rails_4.0_app/bin/rails b/spec/support/apps/rails_4.0_app/bin/rails deleted file mode 100755 index 017b1b0..0000000 --- a/spec/support/apps/rails_4.0_app/bin/rails +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env ruby -APP_PATH = File.expand_path("../../config/application", __FILE__) -require_relative "../config/boot" -require "rails/commands" diff --git a/spec/support/apps/rails_4.0_app/bin/rake b/spec/support/apps/rails_4.0_app/bin/rake deleted file mode 100755 index 4fbf10b..0000000 --- a/spec/support/apps/rails_4.0_app/bin/rake +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env ruby -require_relative "../config/boot" -require "rake" -Rake.application.run diff --git a/spec/support/apps/rails_4.0_app/config.ru b/spec/support/apps/rails_4.0_app/config.ru deleted file mode 100644 index 5bc2a61..0000000 --- a/spec/support/apps/rails_4.0_app/config.ru +++ /dev/null @@ -1,4 +0,0 @@ -# This file is used by Rack-based servers to start the application. - -require ::File.expand_path('../config/environment', __FILE__) -run Rails.application diff --git a/spec/support/apps/rails_4.0_app/config/application.rb b/spec/support/apps/rails_4.0_app/config/application.rb deleted file mode 100644 index b808b3c..0000000 --- a/spec/support/apps/rails_4.0_app/config/application.rb +++ /dev/null @@ -1,11 +0,0 @@ -require File.expand_path("../boot", __FILE__) - -require "action_controller/railtie" -require "active_record/railtie" - -Bundler.require(:default, Rails.env) - -module Rails40App - class Application < Rails::Application - end -end diff --git a/spec/support/apps/rails_4.0_app/config/boot.rb b/spec/support/apps/rails_4.0_app/config/boot.rb deleted file mode 100644 index 3596736..0000000 --- a/spec/support/apps/rails_4.0_app/config/boot.rb +++ /dev/null @@ -1,4 +0,0 @@ -# Set up gems listed in the Gemfile. -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) - -require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE']) diff --git a/spec/support/apps/rails_4.0_app/config/database.yml b/spec/support/apps/rails_4.0_app/config/database.yml deleted file mode 100644 index ba965c6..0000000 --- a/spec/support/apps/rails_4.0_app/config/database.yml +++ /dev/null @@ -1,11 +0,0 @@ -test: - adapter: <%= RUBY_PLATFORM == "java" ? "jdbcsqlite3" : "sqlite3" %> - database: db/test.sqlite3 - pool: 5 - timeout: 5000 - -development: - adapter: <%= RUBY_PLATFORM == "java" ? "jdbcsqlite3" : "sqlite3" %> - database: db/development.sqlite3 - pool: 5 - timeout: 5000 diff --git a/spec/support/apps/rails_4.0_app/config/environment.rb b/spec/support/apps/rails_4.0_app/config/environment.rb deleted file mode 100644 index 82b8201..0000000 --- a/spec/support/apps/rails_4.0_app/config/environment.rb +++ /dev/null @@ -1,5 +0,0 @@ -# Load the Rails application. -require File.expand_path('../application', __FILE__) - -# Initialize the Rails application. -Rails40App::Application.initialize! diff --git a/spec/support/apps/rails_4.0_app/config/environments/development.rb b/spec/support/apps/rails_4.0_app/config/environments/development.rb deleted file mode 100644 index c6e9913..0000000 --- a/spec/support/apps/rails_4.0_app/config/environments/development.rb +++ /dev/null @@ -1,12 +0,0 @@ -Rails40App::Application.configure do - config.cache_classes = false - - config.eager_load = false - - config.consider_all_requests_local = true - config.action_controller.perform_caching = false - - config.active_support.deprecation = :log - - config.active_record.migration_error = :page_load -end diff --git a/spec/support/apps/rails_4.0_app/config/environments/test.rb b/spec/support/apps/rails_4.0_app/config/environments/test.rb deleted file mode 100644 index 91f9064..0000000 --- a/spec/support/apps/rails_4.0_app/config/environments/test.rb +++ /dev/null @@ -1,19 +0,0 @@ -Rails40App::Application.configure do - config.cache_classes = true - - config.eager_load = false - - config.serve_static_files = true - config.static_cache_control = "public, max-age=3600" - - config.consider_all_requests_local = true - config.action_controller.perform_caching = false - - config.action_dispatch.show_exceptions = false - - config.action_controller.allow_forgery_protection = false - - config.active_support.test_order = :random - - config.active_support.deprecation = :stderr -end diff --git a/spec/support/apps/rails_4.0_app/config/initializers/devise.rb b/spec/support/apps/rails_4.0_app/config/initializers/devise.rb deleted file mode 100644 index 3ef1b25..0000000 --- a/spec/support/apps/rails_4.0_app/config/initializers/devise.rb +++ /dev/null @@ -1,254 +0,0 @@ -# Use this hook to configure devise mailer, warden hooks and so forth. -# Many of these configuration options can be set straight in your model. -Devise.setup do |config| - # The secret key used by Devise. Devise uses this key to generate - # random tokens. Changing this key will render invalid all existing - # confirmation, reset password and unlock tokens in the database. - # config.secret_key = 'e757e9f98c1f53b25c1adef7d90a786c4224a963b67ec3e0011b89cc5c1349a46423d4ae047aa0ca57e658154996ab281439fea2ea5185f5c3dadcd8fb878472' - - # ==> Mailer Configuration - # Configure the e-mail address which will be shown in Devise::Mailer, - # note that it will be overwritten if you use your own mailer class - # with default "from" parameter. - config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com' - - # Configure the class responsible to send e-mails. - # config.mailer = 'Devise::Mailer' - - # ==> ORM configuration - # Load and configure the ORM. Supports :active_record (default) and - # :mongoid (bson_ext recommended) by default. Other ORMs may be - # available as additional gems. - require 'devise/orm/active_record' - - # ==> Configuration for any authentication mechanism - # Configure which keys are used when authenticating a user. The default is - # just :email. You can configure it to use [:username, :subdomain], so for - # authenticating a user, both parameters are required. Remember that those - # parameters are used only when authenticating and not when retrieving from - # session. If you need permissions, you should implement that in a before filter. - # You can also supply a hash where the value is a boolean determining whether - # or not authentication should be aborted when the value is not present. - # config.authentication_keys = [ :email ] - - # Configure parameters from the request object used for authentication. Each entry - # given should be a request method and it will automatically be passed to the - # find_for_authentication method and considered in your model lookup. For instance, - # if you set :request_keys to [:subdomain], :subdomain will be used on authentication. - # The same considerations mentioned for authentication_keys also apply to request_keys. - # config.request_keys = [] - - # Configure which authentication keys should be case-insensitive. - # These keys will be downcased upon creating or modifying a user and when used - # to authenticate or find a user. Default is :email. - config.case_insensitive_keys = [ :email ] - - # Configure which authentication keys should have whitespace stripped. - # These keys will have whitespace before and after removed upon creating or - # modifying a user and when used to authenticate or find a user. Default is :email. - config.strip_whitespace_keys = [ :email ] - - # Tell if authentication through request.params is enabled. True by default. - # It can be set to an array that will enable params authentication only for the - # given strategies, for example, `config.params_authenticatable = [:database]` will - # enable it only for database (email + password) authentication. - # config.params_authenticatable = true - - # Tell if authentication through HTTP Auth is enabled. False by default. - # It can be set to an array that will enable http authentication only for the - # given strategies, for example, `config.http_authenticatable = [:database]` will - # enable it only for database authentication. The supported strategies are: - # :database = Support basic authentication with authentication key + password - # config.http_authenticatable = false - - # If http headers should be returned for AJAX requests. True by default. - # config.http_authenticatable_on_xhr = true - - # The realm used in Http Basic Authentication. 'Application' by default. - # config.http_authentication_realm = 'Application' - - # It will change confirmation, password recovery and other workflows - # to behave the same regardless if the e-mail provided was right or wrong. - # Does not affect registerable. - # config.paranoid = true - - # By default Devise will store the user in session. You can skip storage for - # particular strategies by setting this option. - # Notice that if you are skipping storage for all authentication paths, you - # may want to disable generating routes to Devise's sessions controller by - # passing :skip => :sessions to `devise_for` in your config/routes.rb - config.skip_session_storage = [:http_auth] - - # By default, Devise cleans up the CSRF token on authentication to - # avoid CSRF token fixation attacks. This means that, when using AJAX - # requests for sign in and sign up, you need to get a new CSRF token - # from the server. You can disable this option at your own risk. - # config.clean_up_csrf_token_on_authentication = true - - # ==> Configuration for :database_authenticatable - # For bcrypt, this is the cost for hashing the password and defaults to 10. If - # using other encryptors, it sets how many times you want the password re-encrypted. - # - # Limiting the stretches to just one in testing will increase the performance of - # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use - # a value less than 10 in other environments. - config.stretches = Rails.env.test? ? 1 : 10 - - # Setup a pepper to generate the encrypted password. - # config.pepper = '267f77e7a8218e1066a6820bdf87edfa152fb3fba5e8a9ec063732dcbdd24e7ee6ae7a13620e1f32f291e8d9cd276c2514ad04c951d450d4da2fba08ae660350' - - # ==> Configuration for :confirmable - # A period that the user is allowed to access the website even without - # confirming their account. For instance, if set to 2.days, the user will be - # able to access the website for two days without confirming their account, - # access will be blocked just in the third day. Default is 0.days, meaning - # the user cannot access the website without confirming their account. - # config.allow_unconfirmed_access_for = 2.days - - # A period that the user is allowed to confirm their account before their - # token becomes invalid. For example, if set to 3.days, the user can confirm - # their account within 3 days after the mail was sent, but on the fourth day - # their account can't be confirmed with the token any more. - # Default is nil, meaning there is no restriction on how long a user can take - # before confirming their account. - # config.confirm_within = 3.days - - # If true, requires any email changes to be confirmed (exactly the same way as - # initial account confirmation) to be applied. Requires additional unconfirmed_email - # db field (see migrations). Until confirmed new email is stored in - # unconfirmed email column, and copied to email column on successful confirmation. - config.reconfirmable = true - - # Defines which key will be used when confirming an account - # config.confirmation_keys = [ :email ] - - # ==> Configuration for :rememberable - # The time the user will be remembered without asking for credentials again. - # config.remember_for = 2.weeks - - # If true, extends the user's remember period when remembered via cookie. - # config.extend_remember_period = false - - # Options to be passed to the created cookie. For instance, you can set - # :secure => true in order to force SSL only cookies. - # config.rememberable_options = {} - - # ==> Configuration for :validatable - # Range for password length. - config.password_length = 8..128 - - # Email regex used to validate email formats. It simply asserts that - # one (and only one) @ exists in the given string. This is mainly - # to give user feedback and not to assert the e-mail validity. - # config.email_regexp = /\A[^@]+@[^@]+\z/ - - # ==> Configuration for :timeoutable - # The time you want to timeout the user session without activity. After this - # time the user will be asked for credentials again. Default is 30 minutes. - # config.timeout_in = 30.minutes - - # If true, expires auth token on session timeout. - # config.expire_auth_token_on_timeout = false - - # ==> Configuration for :lockable - # Defines which strategy will be used to lock an account. - # :failed_attempts = Locks an account after a number of failed attempts to sign in. - # :none = No lock strategy. You should handle locking by yourself. - # config.lock_strategy = :failed_attempts - - # Defines which key will be used when locking and unlocking an account - # config.unlock_keys = [ :email ] - - # Defines which strategy will be used to unlock an account. - # :email = Sends an unlock link to the user email - # :time = Re-enables login after a certain amount of time (see :unlock_in below) - # :both = Enables both strategies - # :none = No unlock strategy. You should handle unlocking by yourself. - # config.unlock_strategy = :both - - # Number of authentication tries before locking an account if lock_strategy - # is failed attempts. - # config.maximum_attempts = 20 - - # Time interval to unlock the account if :time is enabled as unlock_strategy. - # config.unlock_in = 1.hour - - # Warn on the last attempt before the account is locked. - # config.last_attempt_warning = false - - # ==> Configuration for :recoverable - # - # Defines which key will be used when recovering the password for an account - # config.reset_password_keys = [ :email ] - - # Time interval you can reset your password with a reset password key. - # Don't put a too small interval or your users won't have the time to - # change their passwords. - config.reset_password_within = 6.hours - - # ==> Configuration for :encryptable - # Allow you to use another encryption algorithm besides bcrypt (default). You can use - # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1, - # :authlogic_sha512 (then you should set stretches above to 20 for default behavior) - # and :restful_authentication_sha1 (then you should set stretches to 10, and copy - # REST_AUTH_SITE_KEY to pepper). - # - # Require the `devise-encryptable` gem when using anything other than bcrypt - # config.encryptor = :sha512 - - # ==> Scopes configuration - # Turn scoped views on. Before rendering "sessions/new", it will first check for - # "users/sessions/new". It's turned off by default because it's slower if you - # are using only default views. - # config.scoped_views = false - - # Configure the default scope given to Warden. By default it's the first - # devise role declared in your routes (usually :user). - # config.default_scope = :user - - # Set this configuration to false if you want /users/sign_out to sign out - # only the current scope. By default, Devise signs out all scopes. - # config.sign_out_all_scopes = true - - # ==> Navigation configuration - # Lists the formats that should be treated as navigational. Formats like - # :html, should redirect to the sign in page when the user does not have - # access, but formats like :xml or :json, should return 401. - # - # If you have any extra navigational formats, like :iphone or :mobile, you - # should add them to the navigational formats lists. - # - # The "*/*" below is required to match Internet Explorer requests. - # config.navigational_formats = ['*/*', :html] - - # The default HTTP method used to sign out a resource. Default is :delete. - config.sign_out_via = :delete - - # ==> OmniAuth - # Add a new OmniAuth provider. Check the wiki for more information on setting - # up on your models and hooks. - # config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo' - - # ==> Warden configuration - # If you want to use other strategies, that are not supported by Devise, or - # change the failure app, you can configure them inside the config.warden block. - # - # config.warden do |manager| - # manager.intercept_401 = false - # manager.default_strategies(:scope => :user).unshift :some_external_strategy - # end - - # ==> Mountable engine configurations - # When using Devise inside an engine, let's call it `MyEngine`, and this engine - # is mountable, there are some extra configurations to be taken into account. - # The following options are available, assuming the engine is mounted as: - # - # mount MyEngine, at: '/my_engine' - # - # The router that invoked `devise_for`, in the example above, would be: - # config.router_name = :my_engine - # - # When using omniauth, Devise cannot automatically set Omniauth path, - # so you need to do it manually. For the users scope, it would be: - # config.omniauth_path_prefix = '/my_engine/users/auth' -end diff --git a/spec/support/apps/rails_4.0_app/config/initializers/secret_token.rb b/spec/support/apps/rails_4.0_app/config/initializers/secret_token.rb deleted file mode 100644 index 2526d40..0000000 --- a/spec/support/apps/rails_4.0_app/config/initializers/secret_token.rb +++ /dev/null @@ -1,12 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Your secret key is used for verifying the integrity of signed cookies. -# If you change this key, all old signed cookies will become invalid! - -# Make sure the secret is at least 30 characters and all random, -# no regular words or you'll be exposed to dictionary attacks. -# You can use `rake secret` to generate a secure secret key. - -# Make sure your secret_key_base is kept private -# if you're sharing your code publicly. -Rails40App::Application.config.secret_key_base = '8b41ef7c55a0a37494838312778829e44dd2e44700175a0b3897d4a72a05ffe0f27694345469da43c96b01ac67b96faa11ea4aa53a7d93e89606293c9e6fd3e4' diff --git a/spec/support/apps/rails_4.0_app/config/initializers/session_store.rb b/spec/support/apps/rails_4.0_app/config/initializers/session_store.rb deleted file mode 100644 index a9801f4..0000000 --- a/spec/support/apps/rails_4.0_app/config/initializers/session_store.rb +++ /dev/null @@ -1 +0,0 @@ -Rails40App::Application.config.session_store :"#{mongo_orm}_store" diff --git a/spec/support/apps/rails_4.0_app/config/locales/devise.en.yml b/spec/support/apps/rails_4.0_app/config/locales/devise.en.yml deleted file mode 100644 index abccdb0..0000000 --- a/spec/support/apps/rails_4.0_app/config/locales/devise.en.yml +++ /dev/null @@ -1,59 +0,0 @@ -# Additional translations at https://github.com/plataformatec/devise/wiki/I18n - -en: - devise: - confirmations: - confirmed: "Your account was successfully confirmed." - send_instructions: "You will receive an email with instructions about how to confirm your account in a few minutes." - send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions about how to confirm your account in a few minutes." - failure: - already_authenticated: "You are already signed in." - inactive: "Your account is not activated yet." - invalid: "Invalid email or password." - locked: "Your account is locked." - last_attempt: "You have one more attempt before your account will be locked." - not_found_in_database: "Invalid email or password." - timeout: "Your session expired. Please sign in again to continue." - unauthenticated: "You need to sign in or sign up before continuing." - unconfirmed: "You have to confirm your account before continuing." - mailer: - confirmation_instructions: - subject: "Confirmation instructions" - reset_password_instructions: - subject: "Reset password instructions" - unlock_instructions: - subject: "Unlock Instructions" - omniauth_callbacks: - failure: "Could not authenticate you from %{kind} because \"%{reason}\"." - success: "Successfully authenticated from %{kind} account." - passwords: - no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided." - send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes." - send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes." - updated: "Your password was changed successfully. You are now signed in." - updated_not_active: "Your password was changed successfully." - registrations: - destroyed: "Bye! Your account was successfully cancelled. We hope to see you again soon." - signed_up: "Welcome! You have signed up successfully." - signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated." - signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked." - signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please open the link to activate your account." - update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and click on the confirm link to finalize confirming your new email address." - updated: "You updated your account successfully." - sessions: - signed_in: "Signed in successfully." - signed_out: "Signed out successfully." - unlocks: - send_instructions: "You will receive an email with instructions about how to unlock your account in a few minutes." - send_paranoid_instructions: "If your account exists, you will receive an email with instructions about how to unlock it in a few minutes." - unlocked: "Your account has been unlocked successfully. Please sign in to continue." - errors: - messages: - already_confirmed: "was already confirmed, please try signing in" - confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one" - expired: "has expired, please request a new one" - not_found: "not found" - not_locked: "was not locked" - not_saved: - one: "1 error prohibited this %{resource} from being saved:" - other: "%{count} errors prohibited this %{resource} from being saved:" diff --git a/spec/support/apps/rails_4.0_app/config/locales/en.yml b/spec/support/apps/rails_4.0_app/config/locales/en.yml deleted file mode 100644 index 0653957..0000000 --- a/spec/support/apps/rails_4.0_app/config/locales/en.yml +++ /dev/null @@ -1,23 +0,0 @@ -# Files in the config/locales directory are used for internationalization -# and are automatically loaded by Rails. If you want to use locales other -# than English, add the necessary files in this directory. -# -# To use the locales, use `I18n.t`: -# -# I18n.t 'hello' -# -# In views, this is aliased to just `t`: -# -# <%= t('hello') %> -# -# To use a different locale, set it with `I18n.locale`: -# -# I18n.locale = :es -# -# This would use the information in config/locales/es.yml. -# -# To learn more, please read the Rails Internationalization guide -# available at http://guides.rubyonrails.org/i18n.html. - -en: - hello: "Hello world" diff --git a/spec/support/apps/rails_4.0_app/config/mongo.yml b/spec/support/apps/rails_4.0_app/config/mongo.yml deleted file mode 100644 index 83d9e61..0000000 --- a/spec/support/apps/rails_4.0_app/config/mongo.yml +++ /dev/null @@ -1,11 +0,0 @@ -defaults: &defaults - host: 127.0.0.1 - port: 27017 - -development: - <<: *defaults - database: rails40_app_development - -test: - <<: *defaults - database: rails40_app_test diff --git a/spec/support/apps/rails_4.0_app/config/mongoid.yml b/spec/support/apps/rails_4.0_app/config/mongoid.yml deleted file mode 100644 index 397dbf5..0000000 --- a/spec/support/apps/rails_4.0_app/config/mongoid.yml +++ /dev/null @@ -1,13 +0,0 @@ -development: - clients: - default: - database: rails40_app_development - hosts: - - localhost:27017 - -test: - clients: - default: - database: rails40_app_test - hosts: - - localhost:27017 diff --git a/spec/support/apps/rails_4.0_app/config/routes.rb b/spec/support/apps/rails_4.0_app/config/routes.rb deleted file mode 100644 index a19d10f..0000000 --- a/spec/support/apps/rails_4.0_app/config/routes.rb +++ /dev/null @@ -1,5 +0,0 @@ -Rails40App::Application.routes.draw do - devise_for :users - mount MyAppWrapped => "/rack_test" - root :to => "home#index" -end diff --git a/spec/support/apps/rails_4.0_app/db/migrate/20140301171212_add_devise_users.rb b/spec/support/apps/rails_4.0_app/db/migrate/20140301171212_add_devise_users.rb deleted file mode 100644 index 40d6405..0000000 --- a/spec/support/apps/rails_4.0_app/db/migrate/20140301171212_add_devise_users.rb +++ /dev/null @@ -1,11 +0,0 @@ -class AddDeviseUsers < ActiveRecord::Migration - def change - create_table(:users) do |t| - t.string :email, :null => false, :default => "" - t.string :encrypted_password, :null => false, :default => "" - t.timestamps - end - - add_index :users, :email, :unique => true - end -end diff --git a/spec/support/apps/rails_4.0_app/db/schema.rb b/spec/support/apps/rails_4.0_app/db/schema.rb deleted file mode 100644 index e01e64b..0000000 --- a/spec/support/apps/rails_4.0_app/db/schema.rb +++ /dev/null @@ -1,25 +0,0 @@ -# encoding: UTF-8 -# This file is auto-generated from the current state of the database. Instead -# of editing this file, please use the migrations feature of Active Record to -# incrementally modify your database, and then regenerate this schema definition. -# -# Note that this schema.rb definition is the authoritative source for your -# database schema. If you need to create the application database on another -# system, you should be using db:schema:load, not running all the migrations -# from scratch. The latter is a flawed and unsustainable approach (the more migrations -# you'll amass, the slower it'll run and the greater likelihood for issues). -# -# It's strongly recommended that you check this file into your version control system. - -ActiveRecord::Schema.define(version: 20140301171212) do - - create_table "users", force: true do |t| - t.string "email", default: "", null: false - t.string "encrypted_password", default: "", null: false - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "users", ["email"], name: "index_users_on_email", unique: true - -end diff --git a/spec/support/apps/rails_4.0_app/lib/assets/.keep b/spec/support/apps/rails_4.0_app/lib/assets/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/spec/support/apps/rails_4.0_app/lib/tasks/.keep b/spec/support/apps/rails_4.0_app/lib/tasks/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/spec/support/apps/rails_4.0_app/log/.keep b/spec/support/apps/rails_4.0_app/log/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/spec/support/apps/rails_4.1_app/Rakefile b/spec/support/apps/rails_4.1_app/Rakefile deleted file mode 100644 index 4149772..0000000 --- a/spec/support/apps/rails_4.1_app/Rakefile +++ /dev/null @@ -1,3 +0,0 @@ -require File.expand_path("../config/application", __FILE__) - -Rails.application.load_tasks diff --git a/spec/support/apps/rails_4.1_app/app/controllers/application_controller.rb b/spec/support/apps/rails_4.1_app/app/controllers/application_controller.rb deleted file mode 100644 index d83690e..0000000 --- a/spec/support/apps/rails_4.1_app/app/controllers/application_controller.rb +++ /dev/null @@ -1,5 +0,0 @@ -class ApplicationController < ActionController::Base - # Prevent CSRF attacks by raising an exception. - # For APIs, you may want to use :null_session instead. - protect_from_forgery with: :exception -end diff --git a/spec/support/apps/rails_4.1_app/app/controllers/home_controller.rb b/spec/support/apps/rails_4.1_app/app/controllers/home_controller.rb deleted file mode 100644 index fc0b474..0000000 --- a/spec/support/apps/rails_4.1_app/app/controllers/home_controller.rb +++ /dev/null @@ -1,2 +0,0 @@ -class HomeController < ApplicationController -end diff --git a/spec/support/apps/rails_4.1_app/app/models/user.rb b/spec/support/apps/rails_4.1_app/app/models/user.rb deleted file mode 100644 index ce62fef..0000000 --- a/spec/support/apps/rails_4.1_app/app/models/user.rb +++ /dev/null @@ -1,5 +0,0 @@ -class User < ActiveRecord::Base - # Include default devise modules. Others available are: - # :confirmable, :lockable, :timeoutable and :omniauthable - devise :database_authenticatable, :registerable -end \ No newline at end of file diff --git a/spec/support/apps/rails_4.1_app/app/views/home/index.html.erb b/spec/support/apps/rails_4.1_app/app/views/home/index.html.erb deleted file mode 100644 index 70751e2..0000000 --- a/spec/support/apps/rails_4.1_app/app/views/home/index.html.erb +++ /dev/null @@ -1,9 +0,0 @@ -You are signed -<% if user_signed_in? %> - in as <%= current_user.email %>. - <%= form_tag destroy_user_session_path, :method => :delete do %> - <%= button_tag "Sign out" %> - <% end %> -<% else %> - out. <%= link_to "Sign in", new_user_session_path %> -<% end %> diff --git a/spec/support/apps/rails_4.1_app/app/views/layouts/application.html.erb b/spec/support/apps/rails_4.1_app/app/views/layouts/application.html.erb deleted file mode 100644 index 1fcab69..0000000 --- a/spec/support/apps/rails_4.1_app/app/views/layouts/application.html.erb +++ /dev/null @@ -1,17 +0,0 @@ - - - - Rails41App - <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> - <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> - <%= csrf_meta_tags %> - - - -<%= notice %> -<%= alert %> - -<%= yield %> - - - diff --git a/spec/support/apps/rails_4.1_app/bin/bundle b/spec/support/apps/rails_4.1_app/bin/bundle deleted file mode 100755 index fe18745..0000000 --- a/spec/support/apps/rails_4.1_app/bin/bundle +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env ruby -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __FILE__) -load Gem.bin_path("bundler", "bundle") diff --git a/spec/support/apps/rails_4.1_app/bin/rails b/spec/support/apps/rails_4.1_app/bin/rails deleted file mode 100755 index 017b1b0..0000000 --- a/spec/support/apps/rails_4.1_app/bin/rails +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env ruby -APP_PATH = File.expand_path("../../config/application", __FILE__) -require_relative "../config/boot" -require "rails/commands" diff --git a/spec/support/apps/rails_4.1_app/bin/rake b/spec/support/apps/rails_4.1_app/bin/rake deleted file mode 100755 index 4fbf10b..0000000 --- a/spec/support/apps/rails_4.1_app/bin/rake +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env ruby -require_relative "../config/boot" -require "rake" -Rake.application.run diff --git a/spec/support/apps/rails_4.1_app/config.ru b/spec/support/apps/rails_4.1_app/config.ru deleted file mode 100644 index fea4a9e..0000000 --- a/spec/support/apps/rails_4.1_app/config.ru +++ /dev/null @@ -1,2 +0,0 @@ -require ::File.expand_path("../config/environment", __FILE__) -run Rails.application diff --git a/spec/support/apps/rails_4.1_app/config/application.rb b/spec/support/apps/rails_4.1_app/config/application.rb deleted file mode 100644 index b9e574f..0000000 --- a/spec/support/apps/rails_4.1_app/config/application.rb +++ /dev/null @@ -1,11 +0,0 @@ -require File.expand_path("../boot", __FILE__) - -require "action_controller/railtie" -require "active_record/railtie" - -Bundler.require(*Rails.groups) - -module Rails41App - class Application < Rails::Application - end -end diff --git a/spec/support/apps/rails_4.1_app/config/boot.rb b/spec/support/apps/rails_4.1_app/config/boot.rb deleted file mode 100644 index 5e5f0c1..0000000 --- a/spec/support/apps/rails_4.1_app/config/boot.rb +++ /dev/null @@ -1,4 +0,0 @@ -# Set up gems listed in the Gemfile. -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) - -require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) diff --git a/spec/support/apps/rails_4.1_app/config/database.yml b/spec/support/apps/rails_4.1_app/config/database.yml deleted file mode 100644 index ba965c6..0000000 --- a/spec/support/apps/rails_4.1_app/config/database.yml +++ /dev/null @@ -1,11 +0,0 @@ -test: - adapter: <%= RUBY_PLATFORM == "java" ? "jdbcsqlite3" : "sqlite3" %> - database: db/test.sqlite3 - pool: 5 - timeout: 5000 - -development: - adapter: <%= RUBY_PLATFORM == "java" ? "jdbcsqlite3" : "sqlite3" %> - database: db/development.sqlite3 - pool: 5 - timeout: 5000 diff --git a/spec/support/apps/rails_4.1_app/config/environment.rb b/spec/support/apps/rails_4.1_app/config/environment.rb deleted file mode 100644 index ee8d90d..0000000 --- a/spec/support/apps/rails_4.1_app/config/environment.rb +++ /dev/null @@ -1,5 +0,0 @@ -# Load the Rails application. -require File.expand_path('../application', __FILE__) - -# Initialize the Rails application. -Rails.application.initialize! diff --git a/spec/support/apps/rails_4.1_app/config/environments/development.rb b/spec/support/apps/rails_4.1_app/config/environments/development.rb deleted file mode 100644 index d3ca8d9..0000000 --- a/spec/support/apps/rails_4.1_app/config/environments/development.rb +++ /dev/null @@ -1,12 +0,0 @@ -Rails.application.configure do - config.cache_classes = false - - config.eager_load = false - - config.consider_all_requests_local = true - config.action_controller.perform_caching = false - - config.active_support.deprecation = :log - - config.active_record.migration_error = :page_load -end diff --git a/spec/support/apps/rails_4.1_app/config/environments/test.rb b/spec/support/apps/rails_4.1_app/config/environments/test.rb deleted file mode 100644 index 0f54616..0000000 --- a/spec/support/apps/rails_4.1_app/config/environments/test.rb +++ /dev/null @@ -1,19 +0,0 @@ -Rails.application.configure do - config.cache_classes = true - - config.eager_load = false - - config.serve_static_files = true - config.static_cache_control = "public, max-age=3600" - - config.consider_all_requests_local = true - config.action_controller.perform_caching = false - - config.action_dispatch.show_exceptions = false - - config.action_controller.allow_forgery_protection = false - - config.active_support.test_order = :random - - config.active_support.deprecation = :stderr -end diff --git a/spec/support/apps/rails_4.1_app/config/initializers/devise.rb b/spec/support/apps/rails_4.1_app/config/initializers/devise.rb deleted file mode 100644 index 5f2a3e8..0000000 --- a/spec/support/apps/rails_4.1_app/config/initializers/devise.rb +++ /dev/null @@ -1,254 +0,0 @@ -# Use this hook to configure devise mailer, warden hooks and so forth. -# Many of these configuration options can be set straight in your model. -Devise.setup do |config| - # The secret key used by Devise. Devise uses this key to generate - # random tokens. Changing this key will render invalid all existing - # confirmation, reset password and unlock tokens in the database. - # config.secret_key = '8520db904cf1def8752b3f9e5e0e2e1e88f2a5545d894ad073e93b6da6bad1228d09cd3ab5b9566a55b74d3bea699d87c17414c52a54c0644bb6810a5bbca3e2' - - # ==> Mailer Configuration - # Configure the e-mail address which will be shown in Devise::Mailer, - # note that it will be overwritten if you use your own mailer class - # with default "from" parameter. - config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com' - - # Configure the class responsible to send e-mails. - # config.mailer = 'Devise::Mailer' - - # ==> ORM configuration - # Load and configure the ORM. Supports :active_record (default) and - # :mongoid (bson_ext recommended) by default. Other ORMs may be - # available as additional gems. - require 'devise/orm/active_record' - - # ==> Configuration for any authentication mechanism - # Configure which keys are used when authenticating a user. The default is - # just :email. You can configure it to use [:username, :subdomain], so for - # authenticating a user, both parameters are required. Remember that those - # parameters are used only when authenticating and not when retrieving from - # session. If you need permissions, you should implement that in a before filter. - # You can also supply a hash where the value is a boolean determining whether - # or not authentication should be aborted when the value is not present. - # config.authentication_keys = [ :email ] - - # Configure parameters from the request object used for authentication. Each entry - # given should be a request method and it will automatically be passed to the - # find_for_authentication method and considered in your model lookup. For instance, - # if you set :request_keys to [:subdomain], :subdomain will be used on authentication. - # The same considerations mentioned for authentication_keys also apply to request_keys. - # config.request_keys = [] - - # Configure which authentication keys should be case-insensitive. - # These keys will be downcased upon creating or modifying a user and when used - # to authenticate or find a user. Default is :email. - config.case_insensitive_keys = [ :email ] - - # Configure which authentication keys should have whitespace stripped. - # These keys will have whitespace before and after removed upon creating or - # modifying a user and when used to authenticate or find a user. Default is :email. - config.strip_whitespace_keys = [ :email ] - - # Tell if authentication through request.params is enabled. True by default. - # It can be set to an array that will enable params authentication only for the - # given strategies, for example, `config.params_authenticatable = [:database]` will - # enable it only for database (email + password) authentication. - # config.params_authenticatable = true - - # Tell if authentication through HTTP Auth is enabled. False by default. - # It can be set to an array that will enable http authentication only for the - # given strategies, for example, `config.http_authenticatable = [:database]` will - # enable it only for database authentication. The supported strategies are: - # :database = Support basic authentication with authentication key + password - # config.http_authenticatable = false - - # If http headers should be returned for AJAX requests. True by default. - # config.http_authenticatable_on_xhr = true - - # The realm used in Http Basic Authentication. 'Application' by default. - # config.http_authentication_realm = 'Application' - - # It will change confirmation, password recovery and other workflows - # to behave the same regardless if the e-mail provided was right or wrong. - # Does not affect registerable. - # config.paranoid = true - - # By default Devise will store the user in session. You can skip storage for - # particular strategies by setting this option. - # Notice that if you are skipping storage for all authentication paths, you - # may want to disable generating routes to Devise's sessions controller by - # passing :skip => :sessions to `devise_for` in your config/routes.rb - config.skip_session_storage = [:http_auth] - - # By default, Devise cleans up the CSRF token on authentication to - # avoid CSRF token fixation attacks. This means that, when using AJAX - # requests for sign in and sign up, you need to get a new CSRF token - # from the server. You can disable this option at your own risk. - # config.clean_up_csrf_token_on_authentication = true - - # ==> Configuration for :database_authenticatable - # For bcrypt, this is the cost for hashing the password and defaults to 10. If - # using other encryptors, it sets how many times you want the password re-encrypted. - # - # Limiting the stretches to just one in testing will increase the performance of - # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use - # a value less than 10 in other environments. - config.stretches = Rails.env.test? ? 1 : 10 - - # Setup a pepper to generate the encrypted password. - # config.pepper = '30efc0523d0953dad5356bac16efa34f7d10176e193a6dcbd69ed1bd459dfcb4b3bdcec895d62519bcd6c5f6104070a13875933ab7439c1e3735341c9ee595df' - - # ==> Configuration for :confirmable - # A period that the user is allowed to access the website even without - # confirming their account. For instance, if set to 2.days, the user will be - # able to access the website for two days without confirming their account, - # access will be blocked just in the third day. Default is 0.days, meaning - # the user cannot access the website without confirming their account. - # config.allow_unconfirmed_access_for = 2.days - - # A period that the user is allowed to confirm their account before their - # token becomes invalid. For example, if set to 3.days, the user can confirm - # their account within 3 days after the mail was sent, but on the fourth day - # their account can't be confirmed with the token any more. - # Default is nil, meaning there is no restriction on how long a user can take - # before confirming their account. - # config.confirm_within = 3.days - - # If true, requires any email changes to be confirmed (exactly the same way as - # initial account confirmation) to be applied. Requires additional unconfirmed_email - # db field (see migrations). Until confirmed new email is stored in - # unconfirmed email column, and copied to email column on successful confirmation. - config.reconfirmable = true - - # Defines which key will be used when confirming an account - # config.confirmation_keys = [ :email ] - - # ==> Configuration for :rememberable - # The time the user will be remembered without asking for credentials again. - # config.remember_for = 2.weeks - - # If true, extends the user's remember period when remembered via cookie. - # config.extend_remember_period = false - - # Options to be passed to the created cookie. For instance, you can set - # :secure => true in order to force SSL only cookies. - # config.rememberable_options = {} - - # ==> Configuration for :validatable - # Range for password length. - config.password_length = 8..128 - - # Email regex used to validate email formats. It simply asserts that - # one (and only one) @ exists in the given string. This is mainly - # to give user feedback and not to assert the e-mail validity. - # config.email_regexp = /\A[^@]+@[^@]+\z/ - - # ==> Configuration for :timeoutable - # The time you want to timeout the user session without activity. After this - # time the user will be asked for credentials again. Default is 30 minutes. - # config.timeout_in = 30.minutes - - # If true, expires auth token on session timeout. - # config.expire_auth_token_on_timeout = false - - # ==> Configuration for :lockable - # Defines which strategy will be used to lock an account. - # :failed_attempts = Locks an account after a number of failed attempts to sign in. - # :none = No lock strategy. You should handle locking by yourself. - # config.lock_strategy = :failed_attempts - - # Defines which key will be used when locking and unlocking an account - # config.unlock_keys = [ :email ] - - # Defines which strategy will be used to unlock an account. - # :email = Sends an unlock link to the user email - # :time = Re-enables login after a certain amount of time (see :unlock_in below) - # :both = Enables both strategies - # :none = No unlock strategy. You should handle unlocking by yourself. - # config.unlock_strategy = :both - - # Number of authentication tries before locking an account if lock_strategy - # is failed attempts. - # config.maximum_attempts = 20 - - # Time interval to unlock the account if :time is enabled as unlock_strategy. - # config.unlock_in = 1.hour - - # Warn on the last attempt before the account is locked. - # config.last_attempt_warning = false - - # ==> Configuration for :recoverable - # - # Defines which key will be used when recovering the password for an account - # config.reset_password_keys = [ :email ] - - # Time interval you can reset your password with a reset password key. - # Don't put a too small interval or your users won't have the time to - # change their passwords. - config.reset_password_within = 6.hours - - # ==> Configuration for :encryptable - # Allow you to use another encryption algorithm besides bcrypt (default). You can use - # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1, - # :authlogic_sha512 (then you should set stretches above to 20 for default behavior) - # and :restful_authentication_sha1 (then you should set stretches to 10, and copy - # REST_AUTH_SITE_KEY to pepper). - # - # Require the `devise-encryptable` gem when using anything other than bcrypt - # config.encryptor = :sha512 - - # ==> Scopes configuration - # Turn scoped views on. Before rendering "sessions/new", it will first check for - # "users/sessions/new". It's turned off by default because it's slower if you - # are using only default views. - # config.scoped_views = false - - # Configure the default scope given to Warden. By default it's the first - # devise role declared in your routes (usually :user). - # config.default_scope = :user - - # Set this configuration to false if you want /users/sign_out to sign out - # only the current scope. By default, Devise signs out all scopes. - # config.sign_out_all_scopes = true - - # ==> Navigation configuration - # Lists the formats that should be treated as navigational. Formats like - # :html, should redirect to the sign in page when the user does not have - # access, but formats like :xml or :json, should return 401. - # - # If you have any extra navigational formats, like :iphone or :mobile, you - # should add them to the navigational formats lists. - # - # The "*/*" below is required to match Internet Explorer requests. - # config.navigational_formats = ['*/*', :html] - - # The default HTTP method used to sign out a resource. Default is :delete. - config.sign_out_via = :delete - - # ==> OmniAuth - # Add a new OmniAuth provider. Check the wiki for more information on setting - # up on your models and hooks. - # config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo' - - # ==> Warden configuration - # If you want to use other strategies, that are not supported by Devise, or - # change the failure app, you can configure them inside the config.warden block. - # - # config.warden do |manager| - # manager.intercept_401 = false - # manager.default_strategies(:scope => :user).unshift :some_external_strategy - # end - - # ==> Mountable engine configurations - # When using Devise inside an engine, let's call it `MyEngine`, and this engine - # is mountable, there are some extra configurations to be taken into account. - # The following options are available, assuming the engine is mounted as: - # - # mount MyEngine, at: '/my_engine' - # - # The router that invoked `devise_for`, in the example above, would be: - # config.router_name = :my_engine - # - # When using omniauth, Devise cannot automatically set Omniauth path, - # so you need to do it manually. For the users scope, it would be: - # config.omniauth_path_prefix = '/my_engine/users/auth' -end diff --git a/spec/support/apps/rails_4.1_app/config/initializers/session_store.rb b/spec/support/apps/rails_4.1_app/config/initializers/session_store.rb deleted file mode 100644 index 85a942b..0000000 --- a/spec/support/apps/rails_4.1_app/config/initializers/session_store.rb +++ /dev/null @@ -1 +0,0 @@ -Rails.application.config.session_store :"#{mongo_orm}_store" diff --git a/spec/support/apps/rails_4.1_app/config/locales/devise.en.yml b/spec/support/apps/rails_4.1_app/config/locales/devise.en.yml deleted file mode 100644 index abccdb0..0000000 --- a/spec/support/apps/rails_4.1_app/config/locales/devise.en.yml +++ /dev/null @@ -1,59 +0,0 @@ -# Additional translations at https://github.com/plataformatec/devise/wiki/I18n - -en: - devise: - confirmations: - confirmed: "Your account was successfully confirmed." - send_instructions: "You will receive an email with instructions about how to confirm your account in a few minutes." - send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions about how to confirm your account in a few minutes." - failure: - already_authenticated: "You are already signed in." - inactive: "Your account is not activated yet." - invalid: "Invalid email or password." - locked: "Your account is locked." - last_attempt: "You have one more attempt before your account will be locked." - not_found_in_database: "Invalid email or password." - timeout: "Your session expired. Please sign in again to continue." - unauthenticated: "You need to sign in or sign up before continuing." - unconfirmed: "You have to confirm your account before continuing." - mailer: - confirmation_instructions: - subject: "Confirmation instructions" - reset_password_instructions: - subject: "Reset password instructions" - unlock_instructions: - subject: "Unlock Instructions" - omniauth_callbacks: - failure: "Could not authenticate you from %{kind} because \"%{reason}\"." - success: "Successfully authenticated from %{kind} account." - passwords: - no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided." - send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes." - send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes." - updated: "Your password was changed successfully. You are now signed in." - updated_not_active: "Your password was changed successfully." - registrations: - destroyed: "Bye! Your account was successfully cancelled. We hope to see you again soon." - signed_up: "Welcome! You have signed up successfully." - signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated." - signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked." - signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please open the link to activate your account." - update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and click on the confirm link to finalize confirming your new email address." - updated: "You updated your account successfully." - sessions: - signed_in: "Signed in successfully." - signed_out: "Signed out successfully." - unlocks: - send_instructions: "You will receive an email with instructions about how to unlock your account in a few minutes." - send_paranoid_instructions: "If your account exists, you will receive an email with instructions about how to unlock it in a few minutes." - unlocked: "Your account has been unlocked successfully. Please sign in to continue." - errors: - messages: - already_confirmed: "was already confirmed, please try signing in" - confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one" - expired: "has expired, please request a new one" - not_found: "not found" - not_locked: "was not locked" - not_saved: - one: "1 error prohibited this %{resource} from being saved:" - other: "%{count} errors prohibited this %{resource} from being saved:" diff --git a/spec/support/apps/rails_4.1_app/config/locales/en.yml b/spec/support/apps/rails_4.1_app/config/locales/en.yml deleted file mode 100644 index 0653957..0000000 --- a/spec/support/apps/rails_4.1_app/config/locales/en.yml +++ /dev/null @@ -1,23 +0,0 @@ -# Files in the config/locales directory are used for internationalization -# and are automatically loaded by Rails. If you want to use locales other -# than English, add the necessary files in this directory. -# -# To use the locales, use `I18n.t`: -# -# I18n.t 'hello' -# -# In views, this is aliased to just `t`: -# -# <%= t('hello') %> -# -# To use a different locale, set it with `I18n.locale`: -# -# I18n.locale = :es -# -# This would use the information in config/locales/es.yml. -# -# To learn more, please read the Rails Internationalization guide -# available at http://guides.rubyonrails.org/i18n.html. - -en: - hello: "Hello world" diff --git a/spec/support/apps/rails_4.1_app/config/mongo.yml b/spec/support/apps/rails_4.1_app/config/mongo.yml deleted file mode 100644 index f48bd7b..0000000 --- a/spec/support/apps/rails_4.1_app/config/mongo.yml +++ /dev/null @@ -1,11 +0,0 @@ -defaults: &defaults - host: 127.0.0.1 - port: 27017 - -development: - <<: *defaults - database: rails41_app_development - -test: - <<: *defaults - database: rails41_app_test diff --git a/spec/support/apps/rails_4.1_app/config/mongoid.yml b/spec/support/apps/rails_4.1_app/config/mongoid.yml deleted file mode 100644 index 532786c..0000000 --- a/spec/support/apps/rails_4.1_app/config/mongoid.yml +++ /dev/null @@ -1,13 +0,0 @@ -development: - clients: - default: - database: rails41_app_development - hosts: - - localhost:27017 - -test: - clients: - default: - database: rails41_app_test - hosts: - - localhost:27017 diff --git a/spec/support/apps/rails_4.1_app/config/routes.rb b/spec/support/apps/rails_4.1_app/config/routes.rb deleted file mode 100644 index b68c690..0000000 --- a/spec/support/apps/rails_4.1_app/config/routes.rb +++ /dev/null @@ -1,5 +0,0 @@ -Rails.application.routes.draw do - devise_for :users - mount MyAppWrapped => "/rack_test" - root :to => "home#index" -end diff --git a/spec/support/apps/rails_4.1_app/config/secrets.yml b/spec/support/apps/rails_4.1_app/config/secrets.yml deleted file mode 100644 index 46c567f..0000000 --- a/spec/support/apps/rails_4.1_app/config/secrets.yml +++ /dev/null @@ -1,22 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Your secret key is used for verifying the integrity of signed cookies. -# If you change this key, all old signed cookies will become invalid! - -# Make sure the secret is at least 30 characters and all random, -# no regular words or you'll be exposed to dictionary attacks. -# You can use `rake secret` to generate a secure secret key. - -# Make sure the secrets in this file are kept private -# if you're sharing your code publicly. - -development: - secret_key_base: a8ef04e888ee54014dfb4f32ca538e987f1c160db5ee225b2e863b82664d356be5746975fd059da6b0c00215ce1c597bceeacb119093c94be461161181975a76 - -test: - secret_key_base: f777f8cc4e8ca43ff30bae1dcdb77088467cff65759fc4298c5e6644ad0d9cf22f8128b3eabde1ea8ef37724d8bdab38088e4d11f6a7389cf0d0f7db3cb1f719 - -# Do not keep production secrets in the repository, -# instead read values from the environment. -production: - secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> diff --git a/spec/support/apps/rails_4.1_app/db/migrate/20140301171212_add_devise_users.rb b/spec/support/apps/rails_4.1_app/db/migrate/20140301171212_add_devise_users.rb deleted file mode 100644 index 40d6405..0000000 --- a/spec/support/apps/rails_4.1_app/db/migrate/20140301171212_add_devise_users.rb +++ /dev/null @@ -1,11 +0,0 @@ -class AddDeviseUsers < ActiveRecord::Migration - def change - create_table(:users) do |t| - t.string :email, :null => false, :default => "" - t.string :encrypted_password, :null => false, :default => "" - t.timestamps - end - - add_index :users, :email, :unique => true - end -end diff --git a/spec/support/apps/rails_4.1_app/db/schema.rb b/spec/support/apps/rails_4.1_app/db/schema.rb deleted file mode 100644 index e01e64b..0000000 --- a/spec/support/apps/rails_4.1_app/db/schema.rb +++ /dev/null @@ -1,25 +0,0 @@ -# encoding: UTF-8 -# This file is auto-generated from the current state of the database. Instead -# of editing this file, please use the migrations feature of Active Record to -# incrementally modify your database, and then regenerate this schema definition. -# -# Note that this schema.rb definition is the authoritative source for your -# database schema. If you need to create the application database on another -# system, you should be using db:schema:load, not running all the migrations -# from scratch. The latter is a flawed and unsustainable approach (the more migrations -# you'll amass, the slower it'll run and the greater likelihood for issues). -# -# It's strongly recommended that you check this file into your version control system. - -ActiveRecord::Schema.define(version: 20140301171212) do - - create_table "users", force: true do |t| - t.string "email", default: "", null: false - t.string "encrypted_password", default: "", null: false - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "users", ["email"], name: "index_users_on_email", unique: true - -end diff --git a/spec/support/apps/rails_4.1_app/lib/assets/.keep b/spec/support/apps/rails_4.1_app/lib/assets/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/spec/support/apps/rails_4.1_app/lib/tasks/.keep b/spec/support/apps/rails_4.1_app/lib/tasks/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/spec/support/apps/rails_4.1_app/log/.keep b/spec/support/apps/rails_4.1_app/log/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/spec/support/apps/rails_4.2_app/Rakefile b/spec/support/apps/rails_4.2_app/Rakefile deleted file mode 100644 index 0a5996d..0000000 --- a/spec/support/apps/rails_4.2_app/Rakefile +++ /dev/null @@ -1,2 +0,0 @@ -require File.expand_path("../config/application", __FILE__) -Rails.application.load_tasks diff --git a/spec/support/apps/rails_4.2_app/app/controllers/application_controller.rb b/spec/support/apps/rails_4.2_app/app/controllers/application_controller.rb deleted file mode 100644 index d83690e..0000000 --- a/spec/support/apps/rails_4.2_app/app/controllers/application_controller.rb +++ /dev/null @@ -1,5 +0,0 @@ -class ApplicationController < ActionController::Base - # Prevent CSRF attacks by raising an exception. - # For APIs, you may want to use :null_session instead. - protect_from_forgery with: :exception -end diff --git a/spec/support/apps/rails_4.2_app/app/controllers/home_controller.rb b/spec/support/apps/rails_4.2_app/app/controllers/home_controller.rb deleted file mode 100644 index fc0b474..0000000 --- a/spec/support/apps/rails_4.2_app/app/controllers/home_controller.rb +++ /dev/null @@ -1,2 +0,0 @@ -class HomeController < ApplicationController -end diff --git a/spec/support/apps/rails_4.2_app/app/models/user.rb b/spec/support/apps/rails_4.2_app/app/models/user.rb deleted file mode 100644 index ce62fef..0000000 --- a/spec/support/apps/rails_4.2_app/app/models/user.rb +++ /dev/null @@ -1,5 +0,0 @@ -class User < ActiveRecord::Base - # Include default devise modules. Others available are: - # :confirmable, :lockable, :timeoutable and :omniauthable - devise :database_authenticatable, :registerable -end \ No newline at end of file diff --git a/spec/support/apps/rails_4.2_app/app/views/home/index.html.erb b/spec/support/apps/rails_4.2_app/app/views/home/index.html.erb deleted file mode 100644 index 70751e2..0000000 --- a/spec/support/apps/rails_4.2_app/app/views/home/index.html.erb +++ /dev/null @@ -1,9 +0,0 @@ -You are signed -<% if user_signed_in? %> - in as <%= current_user.email %>. - <%= form_tag destroy_user_session_path, :method => :delete do %> - <%= button_tag "Sign out" %> - <% end %> -<% else %> - out. <%= link_to "Sign in", new_user_session_path %> -<% end %> diff --git a/spec/support/apps/rails_4.2_app/app/views/layouts/application.html.erb b/spec/support/apps/rails_4.2_app/app/views/layouts/application.html.erb deleted file mode 100644 index 3aa454a..0000000 --- a/spec/support/apps/rails_4.2_app/app/views/layouts/application.html.erb +++ /dev/null @@ -1,15 +0,0 @@ - - - - Rails41App - <%= csrf_meta_tags %> - - - -<%= notice %> -<%= alert %> - -<%= yield %> - - - diff --git a/spec/support/apps/rails_4.2_app/bin/bundle b/spec/support/apps/rails_4.2_app/bin/bundle deleted file mode 100755 index 66e9889..0000000 --- a/spec/support/apps/rails_4.2_app/bin/bundle +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env ruby -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) -load Gem.bin_path('bundler', 'bundle') diff --git a/spec/support/apps/rails_4.2_app/bin/rails b/spec/support/apps/rails_4.2_app/bin/rails deleted file mode 100755 index 4d608ed..0000000 --- a/spec/support/apps/rails_4.2_app/bin/rails +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env ruby -begin - load File.expand_path("../spring", __FILE__) -rescue LoadError -end -APP_PATH = File.expand_path('../../config/application', __FILE__) -require_relative '../config/boot' -require 'rails/commands' diff --git a/spec/support/apps/rails_4.2_app/bin/rake b/spec/support/apps/rails_4.2_app/bin/rake deleted file mode 100755 index 1724048..0000000 --- a/spec/support/apps/rails_4.2_app/bin/rake +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env ruby -require_relative '../config/boot' -require 'rake' -Rake.application.run diff --git a/spec/support/apps/rails_4.2_app/config.ru b/spec/support/apps/rails_4.2_app/config.ru deleted file mode 100644 index bd83b25..0000000 --- a/spec/support/apps/rails_4.2_app/config.ru +++ /dev/null @@ -1,4 +0,0 @@ -# This file is used by Rack-based servers to start the application. - -require ::File.expand_path('../config/environment', __FILE__) -run Rails.application diff --git a/spec/support/apps/rails_4.2_app/config/application.rb b/spec/support/apps/rails_4.2_app/config/application.rb deleted file mode 100644 index 82d7beb..0000000 --- a/spec/support/apps/rails_4.2_app/config/application.rb +++ /dev/null @@ -1,11 +0,0 @@ -require File.expand_path("../boot", __FILE__) - -require "action_controller/railtie" -require "active_record/railtie" - -Bundler.require(*Rails.groups) - -module Rails42App - class Application < Rails::Application - end -end diff --git a/spec/support/apps/rails_4.2_app/config/boot.rb b/spec/support/apps/rails_4.2_app/config/boot.rb deleted file mode 100644 index fb24cf2..0000000 --- a/spec/support/apps/rails_4.2_app/config/boot.rb +++ /dev/null @@ -1,3 +0,0 @@ -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __FILE__) - -require "bundler/setup" # Set up gems listed in the Gemfile. diff --git a/spec/support/apps/rails_4.2_app/config/database.yml b/spec/support/apps/rails_4.2_app/config/database.yml deleted file mode 100644 index ba965c6..0000000 --- a/spec/support/apps/rails_4.2_app/config/database.yml +++ /dev/null @@ -1,11 +0,0 @@ -test: - adapter: <%= RUBY_PLATFORM == "java" ? "jdbcsqlite3" : "sqlite3" %> - database: db/test.sqlite3 - pool: 5 - timeout: 5000 - -development: - adapter: <%= RUBY_PLATFORM == "java" ? "jdbcsqlite3" : "sqlite3" %> - database: db/development.sqlite3 - pool: 5 - timeout: 5000 diff --git a/spec/support/apps/rails_4.2_app/config/environment.rb b/spec/support/apps/rails_4.2_app/config/environment.rb deleted file mode 100644 index 1711985..0000000 --- a/spec/support/apps/rails_4.2_app/config/environment.rb +++ /dev/null @@ -1,5 +0,0 @@ -# Load the Rails application. -require File.expand_path("../application", __FILE__) - -# Initialize the Rails application. -Rails.application.initialize! diff --git a/spec/support/apps/rails_4.2_app/config/environments/development.rb b/spec/support/apps/rails_4.2_app/config/environments/development.rb deleted file mode 100644 index d3ca8d9..0000000 --- a/spec/support/apps/rails_4.2_app/config/environments/development.rb +++ /dev/null @@ -1,12 +0,0 @@ -Rails.application.configure do - config.cache_classes = false - - config.eager_load = false - - config.consider_all_requests_local = true - config.action_controller.perform_caching = false - - config.active_support.deprecation = :log - - config.active_record.migration_error = :page_load -end diff --git a/spec/support/apps/rails_4.2_app/config/environments/test.rb b/spec/support/apps/rails_4.2_app/config/environments/test.rb deleted file mode 100644 index 0f54616..0000000 --- a/spec/support/apps/rails_4.2_app/config/environments/test.rb +++ /dev/null @@ -1,19 +0,0 @@ -Rails.application.configure do - config.cache_classes = true - - config.eager_load = false - - config.serve_static_files = true - config.static_cache_control = "public, max-age=3600" - - config.consider_all_requests_local = true - config.action_controller.perform_caching = false - - config.action_dispatch.show_exceptions = false - - config.action_controller.allow_forgery_protection = false - - config.active_support.test_order = :random - - config.active_support.deprecation = :stderr -end diff --git a/spec/support/apps/rails_4.2_app/config/initializers/devise.rb b/spec/support/apps/rails_4.2_app/config/initializers/devise.rb deleted file mode 100644 index 5f2a3e8..0000000 --- a/spec/support/apps/rails_4.2_app/config/initializers/devise.rb +++ /dev/null @@ -1,254 +0,0 @@ -# Use this hook to configure devise mailer, warden hooks and so forth. -# Many of these configuration options can be set straight in your model. -Devise.setup do |config| - # The secret key used by Devise. Devise uses this key to generate - # random tokens. Changing this key will render invalid all existing - # confirmation, reset password and unlock tokens in the database. - # config.secret_key = '8520db904cf1def8752b3f9e5e0e2e1e88f2a5545d894ad073e93b6da6bad1228d09cd3ab5b9566a55b74d3bea699d87c17414c52a54c0644bb6810a5bbca3e2' - - # ==> Mailer Configuration - # Configure the e-mail address which will be shown in Devise::Mailer, - # note that it will be overwritten if you use your own mailer class - # with default "from" parameter. - config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com' - - # Configure the class responsible to send e-mails. - # config.mailer = 'Devise::Mailer' - - # ==> ORM configuration - # Load and configure the ORM. Supports :active_record (default) and - # :mongoid (bson_ext recommended) by default. Other ORMs may be - # available as additional gems. - require 'devise/orm/active_record' - - # ==> Configuration for any authentication mechanism - # Configure which keys are used when authenticating a user. The default is - # just :email. You can configure it to use [:username, :subdomain], so for - # authenticating a user, both parameters are required. Remember that those - # parameters are used only when authenticating and not when retrieving from - # session. If you need permissions, you should implement that in a before filter. - # You can also supply a hash where the value is a boolean determining whether - # or not authentication should be aborted when the value is not present. - # config.authentication_keys = [ :email ] - - # Configure parameters from the request object used for authentication. Each entry - # given should be a request method and it will automatically be passed to the - # find_for_authentication method and considered in your model lookup. For instance, - # if you set :request_keys to [:subdomain], :subdomain will be used on authentication. - # The same considerations mentioned for authentication_keys also apply to request_keys. - # config.request_keys = [] - - # Configure which authentication keys should be case-insensitive. - # These keys will be downcased upon creating or modifying a user and when used - # to authenticate or find a user. Default is :email. - config.case_insensitive_keys = [ :email ] - - # Configure which authentication keys should have whitespace stripped. - # These keys will have whitespace before and after removed upon creating or - # modifying a user and when used to authenticate or find a user. Default is :email. - config.strip_whitespace_keys = [ :email ] - - # Tell if authentication through request.params is enabled. True by default. - # It can be set to an array that will enable params authentication only for the - # given strategies, for example, `config.params_authenticatable = [:database]` will - # enable it only for database (email + password) authentication. - # config.params_authenticatable = true - - # Tell if authentication through HTTP Auth is enabled. False by default. - # It can be set to an array that will enable http authentication only for the - # given strategies, for example, `config.http_authenticatable = [:database]` will - # enable it only for database authentication. The supported strategies are: - # :database = Support basic authentication with authentication key + password - # config.http_authenticatable = false - - # If http headers should be returned for AJAX requests. True by default. - # config.http_authenticatable_on_xhr = true - - # The realm used in Http Basic Authentication. 'Application' by default. - # config.http_authentication_realm = 'Application' - - # It will change confirmation, password recovery and other workflows - # to behave the same regardless if the e-mail provided was right or wrong. - # Does not affect registerable. - # config.paranoid = true - - # By default Devise will store the user in session. You can skip storage for - # particular strategies by setting this option. - # Notice that if you are skipping storage for all authentication paths, you - # may want to disable generating routes to Devise's sessions controller by - # passing :skip => :sessions to `devise_for` in your config/routes.rb - config.skip_session_storage = [:http_auth] - - # By default, Devise cleans up the CSRF token on authentication to - # avoid CSRF token fixation attacks. This means that, when using AJAX - # requests for sign in and sign up, you need to get a new CSRF token - # from the server. You can disable this option at your own risk. - # config.clean_up_csrf_token_on_authentication = true - - # ==> Configuration for :database_authenticatable - # For bcrypt, this is the cost for hashing the password and defaults to 10. If - # using other encryptors, it sets how many times you want the password re-encrypted. - # - # Limiting the stretches to just one in testing will increase the performance of - # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use - # a value less than 10 in other environments. - config.stretches = Rails.env.test? ? 1 : 10 - - # Setup a pepper to generate the encrypted password. - # config.pepper = '30efc0523d0953dad5356bac16efa34f7d10176e193a6dcbd69ed1bd459dfcb4b3bdcec895d62519bcd6c5f6104070a13875933ab7439c1e3735341c9ee595df' - - # ==> Configuration for :confirmable - # A period that the user is allowed to access the website even without - # confirming their account. For instance, if set to 2.days, the user will be - # able to access the website for two days without confirming their account, - # access will be blocked just in the third day. Default is 0.days, meaning - # the user cannot access the website without confirming their account. - # config.allow_unconfirmed_access_for = 2.days - - # A period that the user is allowed to confirm their account before their - # token becomes invalid. For example, if set to 3.days, the user can confirm - # their account within 3 days after the mail was sent, but on the fourth day - # their account can't be confirmed with the token any more. - # Default is nil, meaning there is no restriction on how long a user can take - # before confirming their account. - # config.confirm_within = 3.days - - # If true, requires any email changes to be confirmed (exactly the same way as - # initial account confirmation) to be applied. Requires additional unconfirmed_email - # db field (see migrations). Until confirmed new email is stored in - # unconfirmed email column, and copied to email column on successful confirmation. - config.reconfirmable = true - - # Defines which key will be used when confirming an account - # config.confirmation_keys = [ :email ] - - # ==> Configuration for :rememberable - # The time the user will be remembered without asking for credentials again. - # config.remember_for = 2.weeks - - # If true, extends the user's remember period when remembered via cookie. - # config.extend_remember_period = false - - # Options to be passed to the created cookie. For instance, you can set - # :secure => true in order to force SSL only cookies. - # config.rememberable_options = {} - - # ==> Configuration for :validatable - # Range for password length. - config.password_length = 8..128 - - # Email regex used to validate email formats. It simply asserts that - # one (and only one) @ exists in the given string. This is mainly - # to give user feedback and not to assert the e-mail validity. - # config.email_regexp = /\A[^@]+@[^@]+\z/ - - # ==> Configuration for :timeoutable - # The time you want to timeout the user session without activity. After this - # time the user will be asked for credentials again. Default is 30 minutes. - # config.timeout_in = 30.minutes - - # If true, expires auth token on session timeout. - # config.expire_auth_token_on_timeout = false - - # ==> Configuration for :lockable - # Defines which strategy will be used to lock an account. - # :failed_attempts = Locks an account after a number of failed attempts to sign in. - # :none = No lock strategy. You should handle locking by yourself. - # config.lock_strategy = :failed_attempts - - # Defines which key will be used when locking and unlocking an account - # config.unlock_keys = [ :email ] - - # Defines which strategy will be used to unlock an account. - # :email = Sends an unlock link to the user email - # :time = Re-enables login after a certain amount of time (see :unlock_in below) - # :both = Enables both strategies - # :none = No unlock strategy. You should handle unlocking by yourself. - # config.unlock_strategy = :both - - # Number of authentication tries before locking an account if lock_strategy - # is failed attempts. - # config.maximum_attempts = 20 - - # Time interval to unlock the account if :time is enabled as unlock_strategy. - # config.unlock_in = 1.hour - - # Warn on the last attempt before the account is locked. - # config.last_attempt_warning = false - - # ==> Configuration for :recoverable - # - # Defines which key will be used when recovering the password for an account - # config.reset_password_keys = [ :email ] - - # Time interval you can reset your password with a reset password key. - # Don't put a too small interval or your users won't have the time to - # change their passwords. - config.reset_password_within = 6.hours - - # ==> Configuration for :encryptable - # Allow you to use another encryption algorithm besides bcrypt (default). You can use - # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1, - # :authlogic_sha512 (then you should set stretches above to 20 for default behavior) - # and :restful_authentication_sha1 (then you should set stretches to 10, and copy - # REST_AUTH_SITE_KEY to pepper). - # - # Require the `devise-encryptable` gem when using anything other than bcrypt - # config.encryptor = :sha512 - - # ==> Scopes configuration - # Turn scoped views on. Before rendering "sessions/new", it will first check for - # "users/sessions/new". It's turned off by default because it's slower if you - # are using only default views. - # config.scoped_views = false - - # Configure the default scope given to Warden. By default it's the first - # devise role declared in your routes (usually :user). - # config.default_scope = :user - - # Set this configuration to false if you want /users/sign_out to sign out - # only the current scope. By default, Devise signs out all scopes. - # config.sign_out_all_scopes = true - - # ==> Navigation configuration - # Lists the formats that should be treated as navigational. Formats like - # :html, should redirect to the sign in page when the user does not have - # access, but formats like :xml or :json, should return 401. - # - # If you have any extra navigational formats, like :iphone or :mobile, you - # should add them to the navigational formats lists. - # - # The "*/*" below is required to match Internet Explorer requests. - # config.navigational_formats = ['*/*', :html] - - # The default HTTP method used to sign out a resource. Default is :delete. - config.sign_out_via = :delete - - # ==> OmniAuth - # Add a new OmniAuth provider. Check the wiki for more information on setting - # up on your models and hooks. - # config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo' - - # ==> Warden configuration - # If you want to use other strategies, that are not supported by Devise, or - # change the failure app, you can configure them inside the config.warden block. - # - # config.warden do |manager| - # manager.intercept_401 = false - # manager.default_strategies(:scope => :user).unshift :some_external_strategy - # end - - # ==> Mountable engine configurations - # When using Devise inside an engine, let's call it `MyEngine`, and this engine - # is mountable, there are some extra configurations to be taken into account. - # The following options are available, assuming the engine is mounted as: - # - # mount MyEngine, at: '/my_engine' - # - # The router that invoked `devise_for`, in the example above, would be: - # config.router_name = :my_engine - # - # When using omniauth, Devise cannot automatically set Omniauth path, - # so you need to do it manually. For the users scope, it would be: - # config.omniauth_path_prefix = '/my_engine/users/auth' -end diff --git a/spec/support/apps/rails_4.2_app/config/initializers/session_store.rb b/spec/support/apps/rails_4.2_app/config/initializers/session_store.rb deleted file mode 100644 index 85a942b..0000000 --- a/spec/support/apps/rails_4.2_app/config/initializers/session_store.rb +++ /dev/null @@ -1 +0,0 @@ -Rails.application.config.session_store :"#{mongo_orm}_store" diff --git a/spec/support/apps/rails_4.2_app/config/locales/en.yml b/spec/support/apps/rails_4.2_app/config/locales/en.yml deleted file mode 100644 index 0653957..0000000 --- a/spec/support/apps/rails_4.2_app/config/locales/en.yml +++ /dev/null @@ -1,23 +0,0 @@ -# Files in the config/locales directory are used for internationalization -# and are automatically loaded by Rails. If you want to use locales other -# than English, add the necessary files in this directory. -# -# To use the locales, use `I18n.t`: -# -# I18n.t 'hello' -# -# In views, this is aliased to just `t`: -# -# <%= t('hello') %> -# -# To use a different locale, set it with `I18n.locale`: -# -# I18n.locale = :es -# -# This would use the information in config/locales/es.yml. -# -# To learn more, please read the Rails Internationalization guide -# available at http://guides.rubyonrails.org/i18n.html. - -en: - hello: "Hello world" diff --git a/spec/support/apps/rails_4.2_app/config/mongo.yml b/spec/support/apps/rails_4.2_app/config/mongo.yml deleted file mode 100644 index f3ac51c..0000000 --- a/spec/support/apps/rails_4.2_app/config/mongo.yml +++ /dev/null @@ -1,11 +0,0 @@ -defaults: &defaults - host: 127.0.0.1 - port: 27017 - -development: - <<: *defaults - database: test_database - -test: - <<: *defaults - database: test_database diff --git a/spec/support/apps/rails_4.2_app/config/mongoid.yml b/spec/support/apps/rails_4.2_app/config/mongoid.yml deleted file mode 100644 index 01c5c0f..0000000 --- a/spec/support/apps/rails_4.2_app/config/mongoid.yml +++ /dev/null @@ -1,13 +0,0 @@ -development: - clients: - default: - database: test_database - hosts: - - 127.0.0.1:27017 - -test: - clients: - default: - database: test_database - hosts: - - 127.0.0.1:27017 diff --git a/spec/support/apps/rails_4.2_app/config/routes.rb b/spec/support/apps/rails_4.2_app/config/routes.rb deleted file mode 100644 index b68c690..0000000 --- a/spec/support/apps/rails_4.2_app/config/routes.rb +++ /dev/null @@ -1,5 +0,0 @@ -Rails.application.routes.draw do - devise_for :users - mount MyAppWrapped => "/rack_test" - root :to => "home#index" -end diff --git a/spec/support/apps/rails_4.2_app/config/secrets.yml b/spec/support/apps/rails_4.2_app/config/secrets.yml deleted file mode 100644 index 438056c..0000000 --- a/spec/support/apps/rails_4.2_app/config/secrets.yml +++ /dev/null @@ -1,22 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Your secret key is used for verifying the integrity of signed cookies. -# If you change this key, all old signed cookies will become invalid! - -# Make sure the secret is at least 30 characters and all random, -# no regular words or you'll be exposed to dictionary attacks. -# You can use `rake secret` to generate a secure secret key. - -# Make sure the secrets in this file are kept private -# if you're sharing your code publicly. - -development: - secret_key_base: f572c56330979d77b1f486dfc2cc38990a79eade97da6680e956c0b57967abc3b87759491959283d95f8377a56d30401f8ddac4575c5e1148150a16f09be7c1d - -test: - secret_key_base: cc274453aa400d96444af8c114d32dada6359a8703c7e390e84149f007e1d16aee99b9a6de1a294db718a57317baa54bd57a0bca424bc30d8d15b521c2ccec5d - -# Do not keep production secrets in the repository, -# instead read values from the environment. -production: - secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> diff --git a/spec/support/apps/rails_4.2_app/db/migrate/20140301171212_add_devise_users.rb b/spec/support/apps/rails_4.2_app/db/migrate/20140301171212_add_devise_users.rb deleted file mode 100644 index 40d6405..0000000 --- a/spec/support/apps/rails_4.2_app/db/migrate/20140301171212_add_devise_users.rb +++ /dev/null @@ -1,11 +0,0 @@ -class AddDeviseUsers < ActiveRecord::Migration - def change - create_table(:users) do |t| - t.string :email, :null => false, :default => "" - t.string :encrypted_password, :null => false, :default => "" - t.timestamps - end - - add_index :users, :email, :unique => true - end -end diff --git a/spec/support/apps/rails_4.2_app/db/schema.rb b/spec/support/apps/rails_4.2_app/db/schema.rb deleted file mode 100644 index e01e64b..0000000 --- a/spec/support/apps/rails_4.2_app/db/schema.rb +++ /dev/null @@ -1,25 +0,0 @@ -# encoding: UTF-8 -# This file is auto-generated from the current state of the database. Instead -# of editing this file, please use the migrations feature of Active Record to -# incrementally modify your database, and then regenerate this schema definition. -# -# Note that this schema.rb definition is the authoritative source for your -# database schema. If you need to create the application database on another -# system, you should be using db:schema:load, not running all the migrations -# from scratch. The latter is a flawed and unsustainable approach (the more migrations -# you'll amass, the slower it'll run and the greater likelihood for issues). -# -# It's strongly recommended that you check this file into your version control system. - -ActiveRecord::Schema.define(version: 20140301171212) do - - create_table "users", force: true do |t| - t.string "email", default: "", null: false - t.string "encrypted_password", default: "", null: false - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "users", ["email"], name: "index_users_on_email", unique: true - -end diff --git a/spec/support/rack_app.rb b/spec/support/rack_app.rb index 53ed115..6b25696 100644 --- a/spec/support/rack_app.rb +++ b/spec/support/rack_app.rb @@ -9,6 +9,8 @@ def call(_env) end MyAppWrapped = Rack::Builder.new do |builder| - builder.use Rack::Session::Cookie, :secret => "Very secret secret" + if defined?(Rack::Session::Cookie) + builder.use Rack::Session::Cookie, :secret => "Very secret secret" + end builder.run MyApp.new end From 41d519a7095de5d47ee0f80be9b2aaa962f52f32 Mon Sep 17 00:00:00 2001 From: Tom de Bruijn Date: Thu, 7 Aug 2025 08:53:42 +0200 Subject: [PATCH 3/4] Set up a local test environment Add scripts to test the test suite on different Ruby version without having them all installed locally. --- README.md | 24 ++++++++++++++++++++++++ docker-compose.yml | 5 +++++ script/test | 20 ++++++++++++++++++++ script/test_inner | 19 +++++++++++++++++++ script/testenv | 6 ++++++ 5 files changed, 74 insertions(+) create mode 100644 docker-compose.yml create mode 100755 script/test create mode 100755 script/test_inner create mode 100755 script/testenv diff --git a/README.md b/README.md index de89c99..1188b0f 100644 --- a/README.md +++ b/README.md @@ -70,11 +70,21 @@ MongoStore::Session.where("updated_at" => { "$gt" => 2.days.ago }) ## Development +### Test environment + +Start MongoDB with this script: + +``` +script/testenv +``` + ### Testing To run the tests for a specific store. You must first set a `BUNDLE_GEMFILE` in the environment. +You can also use Docker, see the section below this one. + ```sh bundle exec rake ``` @@ -92,6 +102,20 @@ BUNDLE_GEMFILE=gemfiles/rails-6.0-mongo.gemfile bundle exec rake BUNDLE_GEMFILE=gemfiles/rails-6.0-mongoid.gemfile bundle exec rake ``` +#### Docker testing + +To run tests in a Docker container with a specific Ruby version and gemfile: + +```sh +BUNDLE_GEMFILE=gemfiles/rails-6.0-mongo.gemfile script/test +``` + +The `BUNDLE_GEMFILE` environment variable is required. Ruby version defaults to 3.4 but can be customized: + +```sh +RUBY_VERSION=2.7 BUNDLE_GEMFILE=gemfiles/rails-6.0-mongo.gemfile script/test +``` + ### Performance benchmark The repository includes a performance benchmark. It runs against all available diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..f6da842 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,5 @@ +services: + mongodb: + image: mongo:3.6 + ports: + - "27017:27017" diff --git a/script/test b/script/test new file mode 100755 index 0000000..23895eb --- /dev/null +++ b/script/test @@ -0,0 +1,20 @@ +#!/bin/bash + +set -eu + +if [ -z "${BUNDLE_GEMFILE:-}" ]; then + echo "Error: BUNDLE_GEMFILE environment variable is required" + echo "Example: BUNDLE_GEMFILE=gemfiles/rails-6.0-mongo.gemfile script/test" + exit 1 +fi + +RUBY_VERSION=${RUBY_VERSION:-3.4} + +docker run --rm -it \ + --network mongo_session_store_default \ + -e MONGODB_HOST=mongodb \ + -e BUNDLE_GEMFILE="${BUNDLE_GEMFILE}" \ + -v "$(pwd):/app" \ + -w /app \ + "ruby:${RUBY_VERSION}" \ + /app/script/test_inner diff --git a/script/test_inner b/script/test_inner new file mode 100755 index 0000000..a1c42be --- /dev/null +++ b/script/test_inner @@ -0,0 +1,19 @@ +#!/bin/bash + +set -eu + +export BUNDLE_GEMFILE +export BUNDLE_PATH="/app/tmp/bundler/$RUBY_VERSION/$BUNDLE_GEMFILE" + +ruby_version=$(ruby -e 'puts RUBY_VERSION') +major=$(echo "$ruby_version" | cut -d. -f1) +minor=$(echo "$ruby_version" | cut -d. -f2) + +if [ "$major" -lt 2 ] || ([ "$major" -eq 2 ] && [ "$minor" -le 7 ]); then + gem install bundler -v 1.17.3 +else + gem install bundler +fi + +bundle install +bundle exec rspec diff --git a/script/testenv b/script/testenv new file mode 100755 index 0000000..773773b --- /dev/null +++ b/script/testenv @@ -0,0 +1,6 @@ +#!/bin/bash + +set -e + +echo "Starting test environment..." +docker compose up From bc111ecba95d08288194b87d5f47ae632dbe883c Mon Sep 17 00:00:00 2001 From: Tom de Bruijn Date: Tue, 10 Feb 2026 22:48:10 +0100 Subject: [PATCH 4/4] Fix tests for new Ruby version Something changed since the Ruby version we're now testing with, so update the specs to match. --- spec/integrations/devise_spec.rb | 4 ++-- spec/support/apps/rails_6.0_app/config/database.yml | 12 +++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/spec/integrations/devise_spec.rb b/spec/integrations/devise_spec.rb index 609882d..2abf453 100644 --- a/spec/integrations/devise_spec.rb +++ b/spec/integrations/devise_spec.rb @@ -15,7 +15,7 @@ def prepare_request_params(params) end def create_user - post "/users", prepare_request_params( + post "/users", **prepare_request_params( "user[email]" => "person@example.com", "user[password]" => "secret", "user[password_confirmation]" => "secret" @@ -23,7 +23,7 @@ def create_user end def sign_in - post "/users/sign_in", prepare_request_params( + post "/users/sign_in", **prepare_request_params( "user[email]" => "person@example.com", "user[password]" => "secret", "user[password_confirmation]" => "secret" diff --git a/spec/support/apps/rails_6.0_app/config/database.yml b/spec/support/apps/rails_6.0_app/config/database.yml index 4a8a1b2..6dbceec 100644 --- a/spec/support/apps/rails_6.0_app/config/database.yml +++ b/spec/support/apps/rails_6.0_app/config/database.yml @@ -10,16 +10,22 @@ default: &default timeout: 5000 development: - <<: *default + adapter: sqlite3 + pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> + timeout: 5000 database: db/development.sqlite3 # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: - <<: *default + adapter: sqlite3 + pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> + timeout: 5000 database: db/test.sqlite3 production: - <<: *default + adapter: sqlite3 + pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> + timeout: 5000 database: db/production.sqlite3