Skip to content

Commit

Permalink
Rebased against master.
Browse files Browse the repository at this point in the history
  • Loading branch information
jookyboi committed Mar 11, 2024
2 parents 72a4eee + 6b0659f commit da88078
Show file tree
Hide file tree
Showing 169 changed files with 5,788 additions and 1,802 deletions.
6 changes: 6 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
plugins:
duplication:
enabled: true
method-count:
config:
threshold: 30
20 changes: 18 additions & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

1. Create a feature branch with your changes.
2. Please add a test for your change. Only refactoring and documentation changes require no new tests. If you are adding functionality or fixing a bug, we need a test!
3. Make all the tests pass.
3. Make all the tests pass against `ActiveRecord` and `Mongoid`.
4. Issue a Pull Request.

I will grant you commit access if you send quality pull requests.
Expand All @@ -28,4 +28,20 @@ bundle exec guard

Guard will re-run each test suite when changes are made to its corresponding files.

To run **just one test**: Flavio Castelli blogged about [how to execute a single unit test (or even a single test method)](https://flavio.castelli.me/2010/05/28/rails_execute_single_test/) instead of running the complete unit test suite.
To run **just one test**: Flavio Castelli blogged about [how to execute a single unit test (or even a single test method)](https://flavio.castelli.me/2010/05/28/how-to-run-a-single-rails-unit-test/) instead of running the complete unit test suite.

To run the full **test suite** with the guard and the [appraisal](https://github.com/thoughtbot/appraisal) against `ActiveRecord`:

```shell
bundle exec appraisal rails-5-1 guard
# the same
DEVISE_TOKEN_AUTH_ORM=active_record DB=sqlite bundle exec appraisal
```

`DB` environment variable can take `sqlite`, `mysql`, and `postgresql` values.

against `Mongoid`:

```shell
DEVISE_TOKEN_AUTH_ORM=mongoid bundle exec appraisal rails-5-1-mongoid-7 guard
```
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "bundler"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 5
target-branch: "master"
156 changes: 156 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
name: Test

on:
push:
pull_request:

jobs:
test:
strategy:
fail-fast: false
matrix:
ruby:
- 2.5
- 2.6
- 2.7
- '3.0'
- 3.1
- 3.2
gemfile:
- gemfiles/rails_4_2.gemfile
- gemfiles/rails_5_0.gemfile
- gemfiles/rails_5_1.gemfile
- gemfiles/rails_5_2.gemfile
- gemfiles/rails_6_0.gemfile
- gemfiles/rails_7_0.gemfile
db:
- sqlite
- mysql
- postgresql
devise-token-auth-orm:
- active_record
include:
- ruby: 2.5
gemfile: gemfiles/rails_5_2_mongoid_6.gemfile
devise-token-auth-orm: mongoid
- ruby: 2.5
gemfile: gemfiles/rails_5_2_mongoid_7.gemfile
devise-token-auth-orm: mongoid
- ruby: 2.6
gemfile: gemfiles/rails_5_2_mongoid_7.gemfile
devise-token-auth-orm: mongoid
- ruby: 2.7
gemfile: gemfiles/rails_6_0_mongoid_7.gemfile
devise-token-auth-orm: mongoid
- ruby: 2.7
gemfile: gemfiles/rails_7_0_mongoid_7.gemfile
devise-token-auth-orm: mongoid
- ruby: 2.7
gemfile: gemfiles/rails_7_0.gemfile
- ruby: '3.0'
gemfile: gemfiles/rails_7_0.gemfile
- ruby: '3.0'
gemfile: gemfiles/rails_7_0_mongoid_7.gemfile
devise-token-auth-orm: mongoid
- ruby: 3.1
gemfile: gemfiles/rails_7_0.gemfile
- ruby: 3.1
gemfile: gemfiles/rails_7_0_mongoid_7.gemfile
devise-token-auth-orm: mongoid
- ruby: 3.2
gemfile: gemfiles/rails_7_0.gemfile
- ruby: 3.2
gemfile: gemfiles/rails_7_0_mongoid_7.gemfile
devise-token-auth-orm: mongoid
exclude:
- ruby: 2.5
gemfile: gemfiles/rails_7_0.gemfile
- ruby: 2.6
gemfile: gemfiles/rails_4_2.gemfile
- ruby: 2.6
gemfile: gemfiles/rails_7_0.gemfile
- ruby: 2.7
gemfile: gemfiles/rails_4_2.gemfile
- ruby: 2.7
gemfile: gemfiles/rails_5_0.gemfile
- ruby: 2.7
gemfile: gemfiles/rails_5_1.gemfile
- ruby: 2.7
gemfile: gemfiles/rails_5_2.gemfile
- ruby: '3.0'
gemfile: gemfiles/rails_4_2.gemfile
- ruby: '3.0'
gemfile: gemfiles/rails_5_0.gemfile
- ruby: '3.0'
gemfile: gemfiles/rails_5_1.gemfile
- ruby: '3.0'
gemfile: gemfiles/rails_5_2.gemfile
- ruby: '3.0'
gemfile: gemfiles/rails_6_0.gemfile
- ruby: 3.1
gemfile: gemfiles/rails_4_2.gemfile
- ruby: 3.1
gemfile: gemfiles/rails_5_0.gemfile
- ruby: 3.1
gemfile: gemfiles/rails_5_1.gemfile
- ruby: 3.1
gemfile: gemfiles/rails_5_2.gemfile
- ruby: 3.1
gemfile: gemfiles/rails_6_0.gemfile
- ruby: 3.2
gemfile: gemfiles/rails_4_2.gemfile
- ruby: 3.2
gemfile: gemfiles/rails_5_0.gemfile
- ruby: 3.2
gemfile: gemfiles/rails_5_1.gemfile
- ruby: 3.2
gemfile: gemfiles/rails_5_2.gemfile
- ruby: 3.2
gemfile: gemfiles/rails_6_0.gemfile

services:
mysql:
image: mysql:8
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
postgresql:
image: postgres:14
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
options: --health-cmd=pg_isready --health-interval=10s --health-timeout=5s --health-retries=3

runs-on: ubuntu-latest
env:
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
steps:
- uses: actions/checkout@v3
- name: Setup Bundler 1.x for Rails 4.x
if: ${{ matrix.gemfile == 'gemfiles/rails_4_2.gemfile' || matrix.gemfile == 'gemfiles/rails_4_2_mongoid_5.gemfile' }}
run: echo "BUNDLER_VERSION=1.17.3" >> $GITHUB_ENV
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
bundler: ${{ env.BUNDLER_VERSION || 'latest' }}
- uses: supercharge/mongodb-github-action@1.3.0
if: ${{ matrix.devise-token-auth-orm == 'mongoid' }}
- name: Setup Database
run: |
bundle exec rake db:create
bundle exec rake --trace db:migrate
env:
RAILS_ENV: test
DB: ${{ matrix.db }}
DEVISE_TOKEN_AUTH_ORM: ${{ matrix.devise-token-auth-orm }}
if: ${{ matrix.devise-token-auth-orm == 'active_record' }}
- run: bundle exec rake
env:
RAILS_ENV: test
DB: ${{ matrix.db }}
DEVISE_TOKEN_AUTH_ORM: ${{ matrix.devise-token-auth-orm }}
6 changes: 4 additions & 2 deletions .github_changelog_generator
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
bug-labels=bug,Bug,fix,Fix
enhancement-labels=enhancement,Enhancement,feat,Feat
since-tag=v0.1.42
unreleased-label=v0.1.43
since-tag=v1.1.3
unreleased-label=Unreleased
user=lynndylanhurley
project=devise_token_auth
base=CHANGELOG.md
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ test/dummy/.sass-cache
test/dummy/config/application.yml
coverage
.idea
.byebug_history
.irb_history
.ruby-version
.ruby-gemset
tags

Gemfile.lock

# appraisal
gemfiles/*.lock
40 changes: 0 additions & 40 deletions .travis.yml

This file was deleted.

34 changes: 30 additions & 4 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,20 +1,46 @@
# frozen_string_literal: true

[
{ name: '4-2', version: '4.2.10' }
{ name: '4-2', version: '4.2' }
].each do |rails|
appraise "rails-#{rails[:name]}" do
gem 'rails', "~> #{rails[:version]}"

gem 'sqlite3', '~> 1.3.6'
gem 'mysql2', '~> 0.4.10'
gem 'pg', '~> 0.21'
gem 'rails', "~> #{rails[:version]}"
end
end

[
{ name: '5-0', version: '5.0.7' },
{ name: '5-1', version: '5.1.6' }
{ name: '5-0', version: '5.0' },
{ name: '5-1', version: '5.1' },
{ name: '5-2', version: '5.2' }
].each do |rails|
appraise "rails-#{rails[:name]}" do
gem 'rails', "~> #{rails[:version]}"

gem 'sqlite3', '~> 1.3.6'
gem 'mysql2'
gem 'pg'
end
end

[
{ name: '4-2', ruby: '2.3.8', rails: '4.2', mongoid: '5.4' },
{ name: '5-1', ruby: '2.3.8', rails: '5.1', mongoid: '6.4' },
{ name: '5-1', ruby: '2.4.5', rails: '5.1', mongoid: '7.0' },
{ name: '5-2', ruby: '2.5.5', rails: '5.2', mongoid: '6.4' },
{ name: '5-2', ruby: '2.5.5', rails: '5.2', mongoid: '7.0' },
{ name: '5-2', ruby: '2.6.2', rails: '5.2', mongoid: '7.0' },
{ name: '6-0', ruby: '2.7.0', rails: '6.0', mongoid: '7.0' },
{ name: '6-0', ruby: '3.1.2', rails: '6.0', mongoid: '7.0' },
{ name: '7-0', ruby: '3.1.2', rails: '7.0', mongoid: '7.0' }
].each do |set|
appraise "rails-#{set[:name]}-mongoid-#{set[:mongoid][0]}" do
gem 'rails', "~> #{set[:rails]}"

gem 'mongoid', "~> #{set[:mongoid]}"
gem 'mongoid-locker', '~> 1.0'
end
end
Loading

0 comments on commit da88078

Please sign in to comment.