This repository has been archived by the owner on Feb 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 189
Rails 5.0+ Support (Drops Rails 4.2 Support) #192
Open
joelvh
wants to merge
44
commits into
rbCAS:master
Choose a base branch
from
identification-io:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
0a36e48
Add context argument for an authenticator to use
meanphil e618b1c
Created configurable authenticator context
joelvh 1305bab
Don't assume the context is a `Hash`
joelvh 5a99dac
Merge pull request #2 from identification-io/add_context
joelvh a724942
Added CHANGELOG.md
joelvh c946cbe
Fix deprecations and settings for Rails 4.2
joelvh ba37677
Fix test that never should have worked - failed after fixing deprecat…
joelvh 9db91d9
Add testing for Ruby 2.4.0 and 2.4.1
joelvh 47d685f
Rubocop cleanup
joelvh 30c6485
FactoryGirl is deprecated and replaced with FactoryBot (renamed)
joelvh 3a486e2
Loosen gem versioning
joelvh 1db1c00
Ran `bundle exec rake rails:update` to upgrade to Rails 4.2 settings
joelvh aae994e
Merge pull request #3 from identification-io/feature/rails42_upgrade
joelvh 75dfbe8
Version bump v4.2.0
joelvh ce179ee
Updated CHANGELOG for v4.2.0
joelvh e582de5
Implemented Appraisal tests for Rails 4.2, 5.0, and 5.1
joelvh f5b7732
Don't explicitly set this option that is not available in Rails 5.x
joelvh 32cd2ef
Reference Rails Engine path (when mounted inside one)
joelvh b78aa74
Copy migrations with a generator because `rake casino:install:migrati…
joelvh 65d2192
Simplified adding namespace to paths
joelvh 3acb52e
Rails 5.0 deprecations fixed
joelvh 5aa6f5d
Add extracted gem to fix failing tests
joelvh 875a389
Updated lambda stynax
joelvh e0f9ec8
Use `all` scope for scope chaining instead of class
joelvh 8b4ddf4
Updated RSpec version for specific Rails versions
joelvh 83c84ff
Remove version constraint to allow for Rails 5.x
joelvh 53de3b7
Add ApplicationRecord base class for models
joelvh 93ae39b
Add migration version to migrations
joelvh df6f60d
Use `data_source_exists?` to check for tables and views - gets rid of…
joelvh 7ce8f37
Set new option explicitly
joelvh 4bf1512
Fix deprecated queries for Rails 5.0
joelvh f13ea3d
Use keyword arguments in integration tests for Rails 5.0
joelvh ef11cfc
Fixing check for empty params - IntegrationTest converts `nil` params…
joelvh e748e1e
Call `super` without implicit arguments
joelvh f0c6be1
Invert logic
joelvh 7b20d83
Fix checks to look for blank values instead of `nil` to address Integ…
joelvh 45bc718
Explicitly respond with 406 status because this changed in Rails 5.0 …
joelvh 0781ba7
Drop Rails 4.2 support - mainly because of keyword arguments in RSpec…
joelvh 3cc12e8
Version bump v5.0.0 (Rails 5.0+ support)
joelvh f473af1
Merge pull request #4 from identification-io/feature/rails5_upgrade
joelvh c233077
Remove Rails 4.2 tests
joelvh 2e989ae
Allow Ruby 2.4.x failures
joelvh 01cd1b4
Consolidate logic
joelvh 723dd0d
Updated CHANGELOG
joelvh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,24 @@ | ||
# See http://help.github.com/ignore-files/ for more about ignoring files. | ||
# | ||
# If you find yourself ignoring temporary files generated by your text editor | ||
# or operating system, you probably want to add a global ignore instead: | ||
# git config --global core.excludesfile ~/.gitignore_global | ||
|
||
# Ignore bundler config | ||
/.bundle | ||
|
||
# Ignore the default SQLite database. | ||
/db/*.sqlite3 | ||
|
||
# Ignore all logfiles and tempfiles. | ||
/log/*.log | ||
/tmp | ||
*.gem | ||
*.rbc | ||
.bundle | ||
.config | ||
.yardoc | ||
.rails_generators~ | ||
|
||
/coverage | ||
|
||
/pkg | ||
|
||
# http://yehudakatz.com/2010/12/16/clarifying-the-roles-of-the-gemspec-and-gemfile/ | ||
/Gemfile.lock | ||
|
||
# Dummy application crap | ||
/spec/dummy/log/*.log | ||
/spec/dummy/tmp | ||
/spec/dummy/db/*.sqlite3 | ||
gemfiles/vendor | ||
Gemfile.lock | ||
InstalledFiles | ||
_yardoc | ||
coverage | ||
doc/ | ||
lib/bundler/man | ||
pkg | ||
rdoc | ||
spec/reports | ||
test/tmp | ||
test/version_tmp | ||
tmp | ||
*.lock | ||
.idea/ | ||
.ruby-version | ||
*.sqlite* | ||
*.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
appraise 'rails-5.0' do | ||
gem 'activerecord', '~> 5.0.0' | ||
gem 'rails-controller-testing' | ||
gem 'rspec-rails', '>= 3.5' | ||
end | ||
|
||
appraise 'rails-5.1' do | ||
gem 'activerecord', '~> 5.1.0' | ||
gem 'rails-controller-testing' | ||
gem 'rspec-rails', '>= 3.5' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# 11/15/2017 - v5.0.0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We maintain the change log for CASino using GitHub's release page. |
||
|
||
* Drop Rails 4.2 support | ||
* Add Appraisals | ||
* Fix tests to use keyword arguments | ||
* Fix bugs revealed by IntegrationTest converting `nil` to blank strings | ||
* Addressed deprecations | ||
* Upgraded dummy app | ||
|
||
# 11/14/2017 - v4.2.0 | ||
|
||
* Add Ruby 2.4.0 and 2.4.1 support | ||
* Drop Rails 4.1 support | ||
* Update tests to address deprecations | ||
* Replaced FactoryGirl with FactoryBot | ||
* Fixed test that likely never worked, but did not fail because of deprecated gems | ||
* Loosen gem versions | ||
* Rubocop cleanup | ||
|
||
# 9/26/2015 | ||
|
||
* Added ability to pass a `context` object when verifying user login, allowing to pass extra data such as HTTP request (e.g. subdomain) if needed [5a99dac8f83492d643c20719f2d911d27c933a68](https://github.com/identification-io/CASino/commit/5a99dac8f83492d643c20719f2d911d27c933a68) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,18 @@ | ||
source 'https://rubygems.org' | ||
|
||
group :test do | ||
gem 'appraisal', '>= 2.1' | ||
gem 'capybara', '>= 2.1' | ||
gem 'coveralls', '>= 0.7' | ||
gem 'factory_bot', '>= 4.1' | ||
gem 'rake', '>= 10.0' | ||
gem 'rspec-its', '>= 1.0' | ||
gem 'webmock', '>= 1.9' | ||
end | ||
|
||
# Specify your gem's dependencies in groupify.gemspec | ||
gemspec | ||
|
||
platforms :ruby do | ||
gem 'sqlite3', '>= 1.3' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class CASino::ApplicationRecord < ActiveRecord::Base | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the advantage of using this class over There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @pencil Followed the Rails 5.0+ best practice. Also could serve as a better entry point for potential monkey-patching if needed. |
||
self.abstract_class = true | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
class CASino::AuthTokenTicket < ActiveRecord::Base | ||
class CASino::AuthTokenTicket < CASino::ApplicationRecord | ||
include CASino::ModelConcern::Ticket | ||
include CASino::ModelConcern::ConsumableTicket | ||
|
||
self.ticket_prefix = 'ATT'.freeze | ||
|
||
def self.cleanup | ||
delete_all(['created_at < ?', CASino.config.auth_token_ticket[:lifetime].seconds.ago]) | ||
where(['created_at < ?', CASino.config.auth_token_ticket[:lifetime].seconds.ago]).delete_all | ||
end | ||
|
||
def expired? | ||
(Time.now - (self.created_at || Time.now)) > CASino.config.auth_token_ticket[:lifetime].seconds | ||
(Time.now - (created_at || Time.now)) > CASino.config.auth_token_ticket[:lifetime].seconds | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
class CASino::LoginTicket < ActiveRecord::Base | ||
class CASino::LoginTicket < CASino::ApplicationRecord | ||
include CASino::ModelConcern::Ticket | ||
include CASino::ModelConcern::ConsumableTicket | ||
|
||
self.ticket_prefix = 'LT'.freeze | ||
|
||
def self.cleanup | ||
delete_all(['created_at < ?', CASino.config.login_ticket[:lifetime].seconds.ago]) | ||
where(['created_at < ?', CASino.config.login_ticket[:lifetime].seconds.ago]).delete_all | ||
end | ||
|
||
def expired? | ||
(Time.now - (self.created_at || Time.now)) > CASino.config.login_ticket[:lifetime].seconds | ||
(Time.now - (created_at || Time.now)) > CASino.config.login_ticket[:lifetime].seconds | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are there failures on 2.4.0 and 2.4.1? Seems slightly concerning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pencil something is causing the
appraisal
gem to not load properly on Travis to be able to run the tests - started looking into it, but not conclusive yet