Skip to content

Commit

Permalink
Merge pull request #3 from sportngin/CPO-2779-upgrade
Browse files Browse the repository at this point in the history
Cpo 2779 upgrade
  • Loading branch information
bfl3tch authored Aug 19, 2022
2 parents 03c8eb0 + 94808b8 commit fa075ec
Show file tree
Hide file tree
Showing 14 changed files with 156 additions and 199 deletions.
22 changes: 2 additions & 20 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,11 @@ before_install: gem install bundler -v 1.17.3
script: bundle exec rake test

rvm:
- 1.9.3-p551
- 2.0.0-p648
- 2.1.10
- 2.2.6
- 2.3.3
- 2.6.1

gemfile:
- gemfiles/rails_3_0.gemfile
- gemfiles/rails_3_1.gemfile
- gemfiles/rails_3_2.gemfile
- gemfiles/rails_4_0.gemfile
- gemfiles/rails_4_1.gemfile
- gemfiles/rails_4_2.gemfile
- gemfiles/rails_5_0.gemfile

jobs:
exclude:
- rvm: 1.9.3-p551
gemfile: gemfiles/rails_5_0.gemfile
- rvm: 2.0.0-p648
gemfile: gemfiles/rails_5_0.gemfile
- rvm: 2.1.10
gemfile: gemfiles/rails_5_0.gemfile
- rvm: 2.6.1
gemfile: gemfiles/rails_3_0.gemfile
- gemfiles/rails_5_1.gemfile
- gemfiles/rails_5_2.gemfile
38 changes: 9 additions & 29 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,34 +1,14 @@
appraise 'rails_3_0' do
gem 'activesupport', '~> 3.0.0'
gem 'actionpack', '~> 3.0.0'
end

appraise 'rails_3_1' do
gem 'activesupport', '~> 3.1.0'
gem 'actionpack', '~> 3.1.0'
end

appraise 'rails_3_2' do
gem 'activesupport', '~> 3.2.0'
gem 'actionpack', '~> 3.2.0'
end

appraise 'rails_4_0' do
gem 'activesupport', '~> 4.0.0'
gem 'actionpack', '~> 4.0.0'
end

appraise 'rails_4_1' do
gem 'activesupport', '~> 4.1.0'
gem 'actionpack', '~> 4.1.0'
appraise 'rails_5_0' do
gem 'activesupport', '~> 5.0.0'
gem 'actionpack', '~> 5.0.0'
end

appraise 'rails_4_2' do
gem 'activesupport', '~> 4.2.0'
gem 'actionpack', '~> 4.2.0'
appraise 'rails_5_1' do
gem 'activesupport', '~> 5.1.0'
gem 'actionpack', '~> 5.1.0'
end

appraise 'rails_5_0' do
gem 'activesupport', '~> 5.0.0'
gem 'actionpack', '~> 5.0.0'
appraise 'rails_5_2' do
gem 'activesupport', '~> 5.2.0'
gem 'actionpack', '~> 5.2.0'
end
4 changes: 3 additions & 1 deletion README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,6 @@ Usage:

Note that these prerequisites are not business rules. They do not examine
the content of the session or the parameters. That level of validation should
be encapsulated by your domain model or helper methods in the controller.
be encapsulated by your domain model or helper methods in the controller.

** Version 2.0.0 introduces breaking changes that remove support for Rails < 5.0 **
8 changes: 0 additions & 8 deletions gemfiles/rails_3_0.gemfile

This file was deleted.

8 changes: 0 additions & 8 deletions gemfiles/rails_3_1.gemfile

This file was deleted.

8 changes: 0 additions & 8 deletions gemfiles/rails_3_2.gemfile

This file was deleted.

8 changes: 0 additions & 8 deletions gemfiles/rails_4_0.gemfile

This file was deleted.

8 changes: 0 additions & 8 deletions gemfiles/rails_4_1.gemfile

This file was deleted.

8 changes: 0 additions & 8 deletions gemfiles/rails_4_2.gemfile

This file was deleted.

8 changes: 8 additions & 0 deletions gemfiles/rails_5_1.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activesupport", "~> 5.1.0"
gem "actionpack", "~> 5.1.0"

gemspec path: "../"
8 changes: 8 additions & 0 deletions gemfiles/rails_5_2.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activesupport", "~> 5.2.0"
gem "actionpack", "~> 5.2.0"

gemspec path: "../"
18 changes: 8 additions & 10 deletions lib/action_controller/verification.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,20 +79,15 @@ module ClassMethods
# do not apply this verification to the actions specified in the associated
# array (may also be a single value).
def verify(options={})
before_filter_or_before_action_for_options :only => options[:only], :except => options[:except] do
verify_action options
before_action_for_options(:only => options[:only], :except => options[:except]) do
verify_action(options)
end
end

private
# fix DEPRECATION WARNING:
# before_filter is deprecated and will be removed in Rails 5.1. Use before_action instead
def before_filter_or_before_action_for_options(options, &block)
if respond_to? :before_action
before_action options, &block
else
before_filter options, &block
end

def before_action_for_options(options, &block)
before_action(options, &block)
end
end

Expand Down Expand Up @@ -127,6 +122,9 @@ def verify_request_xhr_status(options) # :nodoc:
end

def apply_redirect_to(redirect_to_option) # :nodoc:
if redirect_to_option == :back
return request.env["HTTP_REFERER"]
end
(redirect_to_option.is_a?(Symbol) && redirect_to_option != :back) ? self.__send__(redirect_to_option) : redirect_to_option
end

Expand Down
Loading

0 comments on commit fa075ec

Please sign in to comment.