diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml new file mode 100644 index 0000000..0831ba3 --- /dev/null +++ b/.github/workflows/ruby.yml @@ -0,0 +1,19 @@ +name: Ruby testing workflow +on: [push, pull_request] +jobs: + test: + strategy: + fail-fast: false + matrix: + ruby: ['3.2', '3.3', '3.4'] + gemfile: [rails72, rails80] + runs-on: ubuntu-latest + env: + BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile + steps: + - uses: actions/checkout@v5 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + - run: bundle exec rake diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index cdf4f14..0000000 --- a/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -language: ruby -rvm: - - 2.3.4 - - 2.4.0 -gemfile: - - gemfiles/rails42.gemfile - - gemfiles/rails50.gemfile - - gemfiles/rails51.gemfile -cache: - directories: - - $HOME/bin - - $HOME/.bundle -install: - - gem install bundler:1.16.0 - - export BUNDLE_PATH=$HOME/.bundle - - bundle install -install: - - gem install bundler:1.16.0 - - bundle --version - - bundle install -script: - - bundle exec rake test diff --git a/Appraisals b/Appraisals index e85f55e..c6a4177 100644 --- a/Appraisals +++ b/Appraisals @@ -1,16 +1,15 @@ # We use git repos so we get test directories and their support. -appraise 'rails42' do - gem 'rails', git: 'git://github.com/rails/rails.git', branch: '4-2-stable' - gem 'mocha' -end - -appraise 'rails50' do - gem 'rails', git: 'git://github.com/rails/rails.git', branch: '5-0-stable' +appraise 'rails72' do + gem 'capybara' + gem 'puma' + gem 'selenium-webdriver' + gem 'rails', git: 'https://github.com/rails/rails.git', branch: '7-2-stable' end -appraise 'rails51' do +appraise 'rails80' do gem 'capybara' + gem 'selenium-webdriver' gem 'puma' - gem 'rails', git: 'git://github.com/rails/rails.git', branch: '5-1-stable' + gem 'rails', git: 'https://github.com/rails/rails.git', branch: '8-0-stable' end diff --git a/Gemfile b/Gemfile index 1175c46..f96d304 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,4 @@ source 'https://rubygems.org' gemspec -gem 'rails', git: 'git://github.com/rails/rails.git', branch: '5-1-stable' +gem 'rails', git: 'https://github.com/rails/rails.git', branch: '5-1-stable' diff --git a/README.md b/README.md index 89a8eb2..0888019 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,7 @@ - # Actionpack::Cloudfront -[![Build Status](https://travis-ci.org/customink/actionpack-cloudfront.svg?branch=master)](https://travis-ci.org/customink/actionpack-cloudfront) - Configure Rails' [ActionDispatch::RemoteIp](http://api.rubyonrails.org/classes/ActionDispatch/RemoteIp.html) to use Amazon CloudFront's IP ranges as trusted proxies. - ## Installation & Usage Add this line to your Rails application's Gemfile. No other configuration is needed. @@ -46,15 +42,13 @@ $ bundle exec appraisal rake test If you want to run the tests for a specific appraisal, use one of the names found in our `Appraisal` file. For example, the following will run our tests suite for Rails 4.2 only. ```shell -$ bundle exec appraisal rails42 rake test +$ bundle exec appraisal rails72 rake test ``` ## Alternatives * [cloudfront-rails](https://github.com/dinks/cloudfront-rails) - Leverages cached HTTP requests to Cloudfront to extend Rails' trusted proxies list thru method patching vs assigning to ActionDispatch's trusted proxies config. - ## License The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT). - diff --git a/gemfiles/rails42.gemfile b/gemfiles/rails42.gemfile deleted file mode 100644 index 116df02..0000000 --- a/gemfiles/rails42.gemfile +++ /dev/null @@ -1,8 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "rails", git: "git://github.com/rails/rails.git", branch: "4-2-stable" -gem "mocha" - -gemspec path: "../" diff --git a/gemfiles/rails42.gemfile.lock b/gemfiles/rails42.gemfile.lock deleted file mode 100644 index e5c8a8f..0000000 --- a/gemfiles/rails42.gemfile.lock +++ /dev/null @@ -1,134 +0,0 @@ -GIT - remote: git://github.com/rails/rails.git - revision: 718d7398bc1c718b81880a3850541d98a310c9ec - branch: 4-2-stable - specs: - actionmailer (4.2.10) - actionpack (= 4.2.10) - actionview (= 4.2.10) - activejob (= 4.2.10) - mail (~> 2.5, >= 2.5.4) - rails-dom-testing (~> 1.0, >= 1.0.5) - actionpack (4.2.10) - actionview (= 4.2.10) - activesupport (= 4.2.10) - rack (~> 1.6) - rack-test (~> 0.6.2) - rails-dom-testing (~> 1.0, >= 1.0.5) - rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (4.2.10) - activesupport (= 4.2.10) - builder (~> 3.1) - erubis (~> 2.7.0) - rails-dom-testing (~> 1.0, >= 1.0.5) - rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (4.2.10) - activesupport (= 4.2.10) - globalid (>= 0.3.0) - activemodel (4.2.10) - activesupport (= 4.2.10) - builder (~> 3.1) - activerecord (4.2.10) - activemodel (= 4.2.10) - activesupport (= 4.2.10) - arel (~> 6.0) - activesupport (4.2.10) - i18n (~> 0.7) - minitest (~> 5.1) - thread_safe (~> 0.3, >= 0.3.4) - tzinfo (~> 1.1) - rails (4.2.10) - actionmailer (= 4.2.10) - actionpack (= 4.2.10) - actionview (= 4.2.10) - activejob (= 4.2.10) - activemodel (= 4.2.10) - activerecord (= 4.2.10) - activesupport (= 4.2.10) - bundler (>= 1.3.0, < 2.0) - railties (= 4.2.10) - sprockets-rails - railties (4.2.10) - actionpack (= 4.2.10) - activesupport (= 4.2.10) - rake (>= 0.8.7) - thor (>= 0.18.1, < 2.0) - -PATH - remote: .. - specs: - actionpack-cloudfront (1.0.0) - rails (>= 4.2) - -GEM - remote: https://rubygems.org/ - specs: - appraisal (2.2.0) - bundler - rake - thor (>= 0.14.0) - arel (6.0.4) - builder (3.2.3) - coderay (1.1.2) - concurrent-ruby (1.0.5) - crass (1.0.3) - erubis (2.7.0) - globalid (0.4.1) - activesupport (>= 4.2.0) - i18n (0.9.1) - concurrent-ruby (~> 1.0) - loofah (2.1.1) - crass (~> 1.0.2) - nokogiri (>= 1.5.9) - mail (2.7.0) - mini_mime (>= 0.1.1) - metaclass (0.0.4) - method_source (0.9.0) - mini_mime (1.0.0) - mini_portile2 (2.3.0) - minitest (5.10.3) - mocha (1.3.0) - metaclass (~> 0.0.1) - nokogiri (1.8.1) - mini_portile2 (~> 2.3.0) - pry (0.11.3) - coderay (~> 1.1.0) - method_source (~> 0.9.0) - rack (1.6.8) - rack-test (0.6.3) - rack (>= 1.0) - rails-deprecated_sanitizer (1.0.3) - activesupport (>= 4.2.0.alpha) - rails-dom-testing (1.0.8) - activesupport (>= 4.2.0.beta, < 5.0) - nokogiri (~> 1.6) - rails-deprecated_sanitizer (>= 1.0.1) - rails-html-sanitizer (1.0.3) - loofah (~> 2.0) - rake (12.3.0) - sprockets (3.7.1) - concurrent-ruby (~> 1.0) - rack (> 1, < 3) - sprockets-rails (3.2.1) - actionpack (>= 4.0) - activesupport (>= 4.0) - sprockets (>= 3.0.0) - thor (0.20.0) - thread_safe (0.3.6) - tzinfo (1.2.4) - thread_safe (~> 0.1) - -PLATFORMS - ruby - -DEPENDENCIES - actionpack-cloudfront! - appraisal - bundler - mocha - pry - rails! - rake - -BUNDLED WITH - 1.16.0 diff --git a/gemfiles/rails50.gemfile b/gemfiles/rails50.gemfile deleted file mode 100644 index 426886e..0000000 --- a/gemfiles/rails50.gemfile +++ /dev/null @@ -1,7 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "rails", git: "git://github.com/rails/rails.git", branch: "5-0-stable" - -gemspec path: "../" diff --git a/gemfiles/rails50.gemfile.lock b/gemfiles/rails50.gemfile.lock deleted file mode 100644 index df035dc..0000000 --- a/gemfiles/rails50.gemfile.lock +++ /dev/null @@ -1,136 +0,0 @@ -GIT - remote: git://github.com/rails/rails.git - revision: dfb49730ab289d6bf3372bbaf78ed837cf6a0505 - branch: 5-0-stable - specs: - actioncable (5.0.6) - actionpack (= 5.0.6) - nio4r (>= 1.2, < 3.0) - websocket-driver (~> 0.6.1) - actionmailer (5.0.6) - actionpack (= 5.0.6) - actionview (= 5.0.6) - activejob (= 5.0.6) - mail (~> 2.5, >= 2.5.4) - rails-dom-testing (~> 2.0) - actionpack (5.0.6) - actionview (= 5.0.6) - activesupport (= 5.0.6) - rack (~> 2.0) - rack-test (~> 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.0.6) - activesupport (= 5.0.6) - builder (~> 3.1) - erubis (~> 2.7.0) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (5.0.6) - activesupport (= 5.0.6) - globalid (>= 0.3.6) - activemodel (5.0.6) - activesupport (= 5.0.6) - activerecord (5.0.6) - activemodel (= 5.0.6) - activesupport (= 5.0.6) - arel (~> 7.0) - activesupport (5.0.6) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (~> 0.7) - minitest (~> 5.1) - tzinfo (~> 1.1) - rails (5.0.6) - actioncable (= 5.0.6) - actionmailer (= 5.0.6) - actionpack (= 5.0.6) - actionview (= 5.0.6) - activejob (= 5.0.6) - activemodel (= 5.0.6) - activerecord (= 5.0.6) - activesupport (= 5.0.6) - bundler (>= 1.3.0) - railties (= 5.0.6) - sprockets-rails (>= 2.0.0) - railties (5.0.6) - actionpack (= 5.0.6) - activesupport (= 5.0.6) - method_source - rake (>= 0.8.7) - thor (>= 0.18.1, < 2.0) - -PATH - remote: .. - specs: - actionpack-cloudfront (1.0.0) - rails (>= 4.2) - -GEM - remote: https://rubygems.org/ - specs: - appraisal (2.2.0) - bundler - rake - thor (>= 0.14.0) - arel (7.1.4) - builder (3.2.3) - coderay (1.1.2) - concurrent-ruby (1.0.5) - crass (1.0.3) - erubis (2.7.0) - globalid (0.4.1) - activesupport (>= 4.2.0) - i18n (0.9.1) - concurrent-ruby (~> 1.0) - loofah (2.1.1) - crass (~> 1.0.2) - nokogiri (>= 1.5.9) - mail (2.7.0) - mini_mime (>= 0.1.1) - method_source (0.9.0) - mini_mime (1.0.0) - mini_portile2 (2.3.0) - minitest (5.10.3) - nio4r (2.1.0) - nokogiri (1.8.1) - mini_portile2 (~> 2.3.0) - pry (0.11.3) - coderay (~> 1.1.0) - method_source (~> 0.9.0) - rack (2.0.3) - rack-test (0.6.3) - rack (>= 1.0) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) - nokogiri (>= 1.6) - rails-html-sanitizer (1.0.3) - loofah (~> 2.0) - rake (12.3.0) - sprockets (3.7.1) - concurrent-ruby (~> 1.0) - rack (> 1, < 3) - sprockets-rails (3.2.1) - actionpack (>= 4.0) - activesupport (>= 4.0) - sprockets (>= 3.0.0) - thor (0.20.0) - thread_safe (0.3.6) - tzinfo (1.2.4) - thread_safe (~> 0.1) - websocket-driver (0.6.5) - websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.3) - -PLATFORMS - ruby - -DEPENDENCIES - actionpack-cloudfront! - appraisal - bundler - pry - rails! - rake - -BUNDLED WITH - 1.16.0 diff --git a/gemfiles/rails51.gemfile.lock b/gemfiles/rails51.gemfile.lock deleted file mode 100644 index 81a09b4..0000000 --- a/gemfiles/rails51.gemfile.lock +++ /dev/null @@ -1,151 +0,0 @@ -GIT - remote: git://github.com/rails/rails.git - revision: 350f789021b3453945a61c254986c06fb270901c - branch: 5-1-stable - specs: - actioncable (5.1.4) - actionpack (= 5.1.4) - nio4r (~> 2.0) - websocket-driver (~> 0.6.1) - actionmailer (5.1.4) - actionpack (= 5.1.4) - actionview (= 5.1.4) - activejob (= 5.1.4) - mail (~> 2.5, >= 2.5.4) - rails-dom-testing (~> 2.0) - actionpack (5.1.4) - actionview (= 5.1.4) - activesupport (= 5.1.4) - rack (~> 2.0) - rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.1.4) - activesupport (= 5.1.4) - builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (5.1.4) - activesupport (= 5.1.4) - globalid (>= 0.3.6) - activemodel (5.1.4) - activesupport (= 5.1.4) - activerecord (5.1.4) - activemodel (= 5.1.4) - activesupport (= 5.1.4) - arel (~> 8.0) - activesupport (5.1.4) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (~> 0.7) - minitest (~> 5.1) - tzinfo (~> 1.1) - rails (5.1.4) - actioncable (= 5.1.4) - actionmailer (= 5.1.4) - actionpack (= 5.1.4) - actionview (= 5.1.4) - activejob (= 5.1.4) - activemodel (= 5.1.4) - activerecord (= 5.1.4) - activesupport (= 5.1.4) - bundler (>= 1.3.0) - railties (= 5.1.4) - sprockets-rails (>= 2.0.0) - railties (5.1.4) - actionpack (= 5.1.4) - activesupport (= 5.1.4) - method_source - rake (>= 0.8.7) - thor (>= 0.18.1, < 2.0) - -PATH - remote: .. - specs: - actionpack-cloudfront (1.0.0) - rails (>= 4.2) - -GEM - remote: https://rubygems.org/ - specs: - addressable (2.5.2) - public_suffix (>= 2.0.2, < 4.0) - appraisal (2.2.0) - bundler - rake - thor (>= 0.14.0) - arel (8.0.0) - builder (3.2.3) - capybara (2.16.1) - addressable - mini_mime (>= 0.1.3) - nokogiri (>= 1.3.3) - rack (>= 1.0.0) - rack-test (>= 0.5.4) - xpath (~> 2.0) - coderay (1.1.2) - concurrent-ruby (1.0.5) - crass (1.0.3) - erubi (1.7.0) - globalid (0.4.1) - activesupport (>= 4.2.0) - i18n (0.9.1) - concurrent-ruby (~> 1.0) - loofah (2.1.1) - crass (~> 1.0.2) - nokogiri (>= 1.5.9) - mail (2.7.0) - mini_mime (>= 0.1.1) - method_source (0.9.0) - mini_mime (1.0.0) - mini_portile2 (2.3.0) - minitest (5.10.3) - nio4r (2.1.0) - nokogiri (1.8.1) - mini_portile2 (~> 2.3.0) - pry (0.11.3) - coderay (~> 1.1.0) - method_source (~> 0.9.0) - public_suffix (3.0.1) - puma (3.11.0) - rack (2.0.3) - rack-test (0.8.2) - rack (>= 1.0, < 3) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) - nokogiri (>= 1.6) - rails-html-sanitizer (1.0.3) - loofah (~> 2.0) - rake (12.3.0) - sprockets (3.7.1) - concurrent-ruby (~> 1.0) - rack (> 1, < 3) - sprockets-rails (3.2.1) - actionpack (>= 4.0) - activesupport (>= 4.0) - sprockets (>= 3.0.0) - thor (0.20.0) - thread_safe (0.3.6) - tzinfo (1.2.4) - thread_safe (~> 0.1) - websocket-driver (0.6.5) - websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.3) - xpath (2.1.0) - nokogiri (~> 1.3) - -PLATFORMS - ruby - -DEPENDENCIES - actionpack-cloudfront! - appraisal - bundler - capybara - pry - puma - rails! - rake - -BUNDLED WITH - 1.16.0 diff --git a/gemfiles/rails51.gemfile b/gemfiles/rails72.gemfile similarity index 53% rename from gemfiles/rails51.gemfile rename to gemfiles/rails72.gemfile index 1cef44c..4fe21c1 100644 --- a/gemfiles/rails51.gemfile +++ b/gemfiles/rails72.gemfile @@ -2,8 +2,9 @@ source "https://rubygems.org" -gem "rails", git: "git://github.com/rails/rails.git", branch: "5-1-stable" +gem "rails", git: "https://github.com/rails/rails.git", branch: "7-2-stable" gem "capybara" gem "puma" +gem "selenium-webdriver" gemspec path: "../" diff --git a/gemfiles/rails72.gemfile.lock b/gemfiles/rails72.gemfile.lock new file mode 100644 index 0000000..c4aa243 --- /dev/null +++ b/gemfiles/rails72.gemfile.lock @@ -0,0 +1,275 @@ +GIT + remote: https://github.com/rails/rails.git + revision: 3690a3ab882476c5229c04c5ae993ba6fb469fc4 + branch: 7-2-stable + specs: + actioncable (7.2.2.2) + actionpack (= 7.2.2.2) + activesupport (= 7.2.2.2) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + zeitwerk (~> 2.6) + actionmailbox (7.2.2.2) + actionpack (= 7.2.2.2) + activejob (= 7.2.2.2) + activerecord (= 7.2.2.2) + activestorage (= 7.2.2.2) + activesupport (= 7.2.2.2) + mail (>= 2.8.0) + actionmailer (7.2.2.2) + actionpack (= 7.2.2.2) + actionview (= 7.2.2.2) + activejob (= 7.2.2.2) + activesupport (= 7.2.2.2) + mail (>= 2.8.0) + rails-dom-testing (~> 2.2) + actionpack (7.2.2.2) + actionview (= 7.2.2.2) + activesupport (= 7.2.2.2) + cgi + nokogiri (>= 1.8.5) + racc + rack (>= 2.2.4, < 3.3) + rack-session (>= 1.0.1) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + useragent (~> 0.16) + actiontext (7.2.2.2) + actionpack (= 7.2.2.2) + activerecord (= 7.2.2.2) + activestorage (= 7.2.2.2) + activesupport (= 7.2.2.2) + globalid (>= 0.6.0) + nokogiri (>= 1.8.5) + actionview (7.2.2.2) + activesupport (= 7.2.2.2) + builder (~> 3.1) + cgi + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (7.2.2.2) + activesupport (= 7.2.2.2) + globalid (>= 0.3.6) + activemodel (7.2.2.2) + activesupport (= 7.2.2.2) + activerecord (7.2.2.2) + activemodel (= 7.2.2.2) + activesupport (= 7.2.2.2) + timeout (>= 0.4.0) + activestorage (7.2.2.2) + actionpack (= 7.2.2.2) + activejob (= 7.2.2.2) + activerecord (= 7.2.2.2) + activesupport (= 7.2.2.2) + marcel (~> 1.0) + activesupport (7.2.2.2) + base64 + benchmark (>= 0.3) + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + logger (>= 1.4.2) + minitest (>= 5.1) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + rails (7.2.2.2) + actioncable (= 7.2.2.2) + actionmailbox (= 7.2.2.2) + actionmailer (= 7.2.2.2) + actionpack (= 7.2.2.2) + actiontext (= 7.2.2.2) + actionview (= 7.2.2.2) + activejob (= 7.2.2.2) + activemodel (= 7.2.2.2) + activerecord (= 7.2.2.2) + activestorage (= 7.2.2.2) + activesupport (= 7.2.2.2) + bundler (>= 1.15.0) + railties (= 7.2.2.2) + railties (7.2.2.2) + actionpack (= 7.2.2.2) + activesupport (= 7.2.2.2) + cgi + irb (~> 1.13) + rackup (>= 1.0.0) + rake (>= 12.2) + thor (~> 1.0, >= 1.2.2) + tsort (>= 0.2) + zeitwerk (~> 2.6) + +PATH + remote: .. + specs: + actionpack-cloudfront (1.2.10) + actionpack (>= 4.2) + railties (>= 4.2) + +GEM + remote: https://rubygems.org/ + specs: + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) + appraisal (2.5.0) + bundler + rake + thor (>= 0.14.0) + base64 (0.3.0) + benchmark (0.5.0) + bigdecimal (3.3.1) + builder (3.3.0) + capybara (3.40.0) + addressable + matrix + mini_mime (>= 0.1.3) + nokogiri (~> 1.11) + rack (>= 1.6.0) + rack-test (>= 0.6.3) + regexp_parser (>= 1.5, < 3.0) + xpath (~> 3.2) + cgi (0.5.0) + coderay (1.1.3) + concurrent-ruby (1.3.5) + connection_pool (2.5.4) + crass (1.0.6) + date (3.4.1) + drb (2.2.3) + erb (5.1.1) + erubi (1.13.1) + globalid (1.3.0) + activesupport (>= 6.1) + i18n (1.14.7) + concurrent-ruby (~> 1.0) + io-console (0.8.1) + irb (1.15.2) + pp (>= 0.6.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) + logger (1.7.0) + loofah (2.24.1) + crass (~> 1.0.2) + nokogiri (>= 1.12.0) + mail (2.9.0) + logger + mini_mime (>= 0.1.1) + net-imap + net-pop + net-smtp + marcel (1.1.0) + matrix (0.4.3) + method_source (1.1.0) + mini_mime (1.1.5) + minitest (5.26.0) + net-imap (0.5.12) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.2) + timeout + net-smtp (0.5.1) + net-protocol + nio4r (2.7.4) + nokogiri (1.18.10-aarch64-linux-gnu) + racc (~> 1.4) + nokogiri (1.18.10-aarch64-linux-musl) + racc (~> 1.4) + nokogiri (1.18.10-arm-linux-gnu) + racc (~> 1.4) + nokogiri (1.18.10-arm-linux-musl) + racc (~> 1.4) + nokogiri (1.18.10-arm64-darwin) + racc (~> 1.4) + nokogiri (1.18.10-x86_64-darwin) + racc (~> 1.4) + nokogiri (1.18.10-x86_64-linux-gnu) + racc (~> 1.4) + nokogiri (1.18.10-x86_64-linux-musl) + racc (~> 1.4) + pp (0.6.3) + prettyprint + prettyprint (0.2.0) + pry (0.15.2) + coderay (~> 1.1) + method_source (~> 1.0) + psych (5.2.6) + date + stringio + public_suffix (6.0.2) + puma (7.1.0) + nio4r (~> 2.0) + racc (1.8.1) + rack (3.2.3) + rack-session (2.1.1) + base64 (>= 0.1.0) + rack (>= 3.0.0) + rack-test (2.2.0) + rack (>= 1.3) + rackup (2.2.1) + rack (>= 3) + rails-dom-testing (2.3.0) + activesupport (>= 5.0.0) + minitest + nokogiri (>= 1.6) + rails-html-sanitizer (1.6.2) + loofah (~> 2.21) + nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) + rake (13.3.0) + rdoc (6.15.0) + erb + psych (>= 4.0.0) + tsort + regexp_parser (2.11.3) + reline (0.6.2) + io-console (~> 0.5) + rexml (3.4.4) + rubyzip (3.2.0) + securerandom (0.4.1) + selenium-webdriver (4.37.0) + base64 (~> 0.2) + logger (~> 1.4) + rexml (~> 3.2, >= 3.2.5) + rubyzip (>= 1.2.2, < 4.0) + websocket (~> 1.0) + stringio (3.1.7) + thor (1.4.0) + timeout (0.4.3) + tsort (0.2.0) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + useragent (0.16.11) + websocket (1.2.11) + websocket-driver (0.8.0) + base64 + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) + xpath (3.2.0) + nokogiri (~> 1.8) + zeitwerk (2.7.3) + +PLATFORMS + aarch64-linux-gnu + aarch64-linux-musl + arm-linux-gnu + arm-linux-musl + arm64-darwin + x86_64-darwin + x86_64-linux-gnu + x86_64-linux-musl + +DEPENDENCIES + actionpack-cloudfront! + appraisal + bundler + capybara + pry + puma + rails! + rake + selenium-webdriver + +BUNDLED WITH + 2.5.22 diff --git a/gemfiles/rails80.gemfile b/gemfiles/rails80.gemfile new file mode 100644 index 0000000..45cf686 --- /dev/null +++ b/gemfiles/rails80.gemfile @@ -0,0 +1,10 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "rails", git: "https://github.com/rails/rails.git", branch: "8-0-stable" +gem "capybara" +gem "selenium-webdriver" +gem "puma" + +gemspec path: "../" diff --git a/gemfiles/rails80.gemfile.lock b/gemfiles/rails80.gemfile.lock new file mode 100644 index 0000000..0f7184a --- /dev/null +++ b/gemfiles/rails80.gemfile.lock @@ -0,0 +1,272 @@ +GIT + remote: https://github.com/rails/rails.git + revision: 6981fd2fbeadc8bc7db6547604cf2df13cb18a40 + branch: 8-0-stable + specs: + actioncable (8.0.3) + actionpack (= 8.0.3) + activesupport (= 8.0.3) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + zeitwerk (~> 2.6) + actionmailbox (8.0.3) + actionpack (= 8.0.3) + activejob (= 8.0.3) + activerecord (= 8.0.3) + activestorage (= 8.0.3) + activesupport (= 8.0.3) + mail (>= 2.8.0) + actionmailer (8.0.3) + actionpack (= 8.0.3) + actionview (= 8.0.3) + activejob (= 8.0.3) + activesupport (= 8.0.3) + mail (>= 2.8.0) + rails-dom-testing (~> 2.2) + actionpack (8.0.3) + actionview (= 8.0.3) + activesupport (= 8.0.3) + nokogiri (>= 1.8.5) + rack (>= 2.2.4) + rack-session (>= 1.0.1) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + useragent (~> 0.16) + actiontext (8.0.3) + actionpack (= 8.0.3) + activerecord (= 8.0.3) + activestorage (= 8.0.3) + activesupport (= 8.0.3) + globalid (>= 0.6.0) + nokogiri (>= 1.8.5) + actionview (8.0.3) + activesupport (= 8.0.3) + builder (~> 3.1) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (8.0.3) + activesupport (= 8.0.3) + globalid (>= 0.3.6) + activemodel (8.0.3) + activesupport (= 8.0.3) + activerecord (8.0.3) + activemodel (= 8.0.3) + activesupport (= 8.0.3) + timeout (>= 0.4.0) + activestorage (8.0.3) + actionpack (= 8.0.3) + activejob (= 8.0.3) + activerecord (= 8.0.3) + activesupport (= 8.0.3) + marcel (~> 1.0) + activesupport (8.0.3) + base64 + benchmark (>= 0.3) + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + logger (>= 1.4.2) + minitest (>= 5.1) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + uri (>= 0.13.1) + rails (8.0.3) + actioncable (= 8.0.3) + actionmailbox (= 8.0.3) + actionmailer (= 8.0.3) + actionpack (= 8.0.3) + actiontext (= 8.0.3) + actionview (= 8.0.3) + activejob (= 8.0.3) + activemodel (= 8.0.3) + activerecord (= 8.0.3) + activestorage (= 8.0.3) + activesupport (= 8.0.3) + bundler (>= 1.15.0) + railties (= 8.0.3) + railties (8.0.3) + actionpack (= 8.0.3) + activesupport (= 8.0.3) + irb (~> 1.13) + rackup (>= 1.0.0) + rake (>= 12.2) + thor (~> 1.0, >= 1.2.2) + tsort (>= 0.2) + zeitwerk (~> 2.6) + +PATH + remote: .. + specs: + actionpack-cloudfront (1.2.10) + actionpack (>= 4.2) + railties (>= 4.2) + +GEM + remote: https://rubygems.org/ + specs: + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) + appraisal (2.5.0) + bundler + rake + thor (>= 0.14.0) + base64 (0.3.0) + benchmark (0.5.0) + bigdecimal (3.3.1) + builder (3.3.0) + capybara (3.40.0) + addressable + matrix + mini_mime (>= 0.1.3) + nokogiri (~> 1.11) + rack (>= 1.6.0) + rack-test (>= 0.6.3) + regexp_parser (>= 1.5, < 3.0) + xpath (~> 3.2) + coderay (1.1.3) + concurrent-ruby (1.3.5) + connection_pool (2.5.4) + crass (1.0.6) + date (3.4.1) + drb (2.2.3) + erb (5.1.1) + erubi (1.13.1) + globalid (1.3.0) + activesupport (>= 6.1) + i18n (1.14.7) + concurrent-ruby (~> 1.0) + io-console (0.8.1) + irb (1.15.2) + pp (>= 0.6.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) + logger (1.7.0) + loofah (2.24.1) + crass (~> 1.0.2) + nokogiri (>= 1.12.0) + mail (2.9.0) + logger + mini_mime (>= 0.1.1) + net-imap + net-pop + net-smtp + marcel (1.1.0) + matrix (0.4.3) + method_source (1.1.0) + mini_mime (1.1.5) + minitest (5.26.0) + net-imap (0.5.12) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.2) + timeout + net-smtp (0.5.1) + net-protocol + nio4r (2.7.4) + nokogiri (1.18.10-aarch64-linux-gnu) + racc (~> 1.4) + nokogiri (1.18.10-aarch64-linux-musl) + racc (~> 1.4) + nokogiri (1.18.10-arm-linux-gnu) + racc (~> 1.4) + nokogiri (1.18.10-arm-linux-musl) + racc (~> 1.4) + nokogiri (1.18.10-arm64-darwin) + racc (~> 1.4) + nokogiri (1.18.10-x86_64-darwin) + racc (~> 1.4) + nokogiri (1.18.10-x86_64-linux-gnu) + racc (~> 1.4) + nokogiri (1.18.10-x86_64-linux-musl) + racc (~> 1.4) + pp (0.6.3) + prettyprint + prettyprint (0.2.0) + pry (0.15.2) + coderay (~> 1.1) + method_source (~> 1.0) + psych (5.2.6) + date + stringio + public_suffix (6.0.2) + puma (7.1.0) + nio4r (~> 2.0) + racc (1.8.1) + rack (3.2.3) + rack-session (2.1.1) + base64 (>= 0.1.0) + rack (>= 3.0.0) + rack-test (2.2.0) + rack (>= 1.3) + rackup (2.2.1) + rack (>= 3) + rails-dom-testing (2.3.0) + activesupport (>= 5.0.0) + minitest + nokogiri (>= 1.6) + rails-html-sanitizer (1.6.2) + loofah (~> 2.21) + nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) + rake (13.3.0) + rdoc (6.15.0) + erb + psych (>= 4.0.0) + tsort + regexp_parser (2.11.3) + reline (0.6.2) + io-console (~> 0.5) + rexml (3.4.4) + rubyzip (3.2.0) + securerandom (0.4.1) + selenium-webdriver (4.37.0) + base64 (~> 0.2) + logger (~> 1.4) + rexml (~> 3.2, >= 3.2.5) + rubyzip (>= 1.2.2, < 4.0) + websocket (~> 1.0) + stringio (3.1.7) + thor (1.4.0) + timeout (0.4.3) + tsort (0.2.0) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + uri (1.0.4) + useragent (0.16.11) + websocket (1.2.11) + websocket-driver (0.8.0) + base64 + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) + xpath (3.2.0) + nokogiri (~> 1.8) + zeitwerk (2.7.3) + +PLATFORMS + aarch64-linux-gnu + aarch64-linux-musl + arm-linux-gnu + arm-linux-musl + arm64-darwin + x86_64-darwin + x86_64-linux-gnu + x86_64-linux-musl + +DEPENDENCIES + actionpack-cloudfront! + appraisal + bundler + capybara + pry + puma + rails! + rake + selenium-webdriver + +BUNDLED WITH + 2.5.22 diff --git a/lib/action_pack/cloudfront/location_headers.rb b/lib/action_pack/cloudfront/location_headers.rb index 177aa40..6fac111 100644 --- a/lib/action_pack/cloudfront/location_headers.rb +++ b/lib/action_pack/cloudfront/location_headers.rb @@ -9,7 +9,9 @@ module LocationHeaders |RS|SK|SI|ES|SE|CH|UA|GB|VA|RS)$/ix included do - helper_method :request_eu? + if respond_to?(:helper_method) + helper_method :request_eu? + end end private diff --git a/lib/action_pack/cloudfront/railtie.rb b/lib/action_pack/cloudfront/railtie.rb index bba276b..878915c 100644 --- a/lib/action_pack/cloudfront/railtie.rb +++ b/lib/action_pack/cloudfront/railtie.rb @@ -19,7 +19,6 @@ class Railtie < ::Rails::Railtie config.to_prepare do ::ApplicationController.send :include, ActionPack::Cloudfront::LocationHeaders end - end end end diff --git a/test/actionpack/cloudfront/location_headers_test.rb b/test/actionpack/cloudfront/location_headers_test.rb new file mode 100644 index 0000000..1b47328 --- /dev/null +++ b/test/actionpack/cloudfront/location_headers_test.rb @@ -0,0 +1,16 @@ +require 'test_helper' + +class LocationHeadersTest < ActiveSupport::TestCase + class ApplicationController < ActionController::Base + include ActionPack::Cloudfront::LocationHeaders + end + + class ApiController < ActionController::API + include ActionPack::Cloudfront::LocationHeaders + end + + test '#request_eu? - includes when has helper method' do + assert_includes ApplicationController._helper_methods, :request_eu? + assert_nil ApiController.try(:_helper_methods) + end +end