diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 9c3f049ff53..462358ee7d7 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-18.04 env: RUBYGEMS_VERSION: 3.2.3 - RUBY_VERSION: 2.7.4 + RUBY_VERSION: 3.0.2 steps: - uses: actions/checkout@v2 - name: Set up Docker Buildx diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7b6fd342079..a0a833e67c8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,7 @@ jobs: fail-fast: false matrix: rubygems_version: ['3.2.3', 'latest'] - ruby_version: ['2.7.4'] + ruby_version: ['3.0.2'] name: Rails tests (Ruby ${{ matrix.ruby_version }}, RubyGems ${{ matrix.rubygems_version }}) runs-on: ubuntu-18.04 env: diff --git a/.ruby-version b/.ruby-version index 74500cee168..d9c62ed9233 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.7.4 \ No newline at end of file +3.0.2 \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9fb6a64fe38..e626ada8011 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -63,7 +63,7 @@ Follow the instructions below on how to install Bundler and setup the database. #### Environment (OS X) -* Use Ruby 2.6.x (`.ruby-version` is present and can be used) +* Use R Ruby 3.0.x (`.ruby-version` is present and can be used) * Use Rubygems 3.2.3 * Install bundler: `gem install bundler` * Install Elastic Search: @@ -82,7 +82,7 @@ Follow the instructions below on how to install Bundler and setup the database. #### Environment (Linux - Debian/Ubuntu) -* Use Ruby 2.6.x `apt-get install ruby2.6` +* Use Ruby 3.0.x `apt-get install ruby3.0` * Or install via [alternate methods](https://www.ruby-lang.org/en/downloads/) * Use Rubygems 3.2.3 * Install bundler: `gem install bundler` diff --git a/Dockerfile b/Dockerfile index 228ad588dba..2fef2f84c6f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:2.7-alpine as build +FROM ruby:3.0-alpine as build ARG RUBYGEMS_VERSION @@ -36,7 +36,7 @@ RUN bundle config set --local without 'development test assets' && \ bundle clean --force -FROM ruby:2.7-alpine +FROM ruby:3.0-alpine ARG RUBYGEMS_VERSION diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index e204ae7fdaf..2a506daff64 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -23,16 +23,16 @@ def set_locale render plain: "Request is missing param '#{e.param}'", status: :bad_request end - def self.http_basic_authenticate_with(options = {}) + def self.http_basic_authenticate_with(**options) before_action(options.except(:name, :password, :realm)) do - raise "Invalid authentication options" unless http_basic_authentication_options_valid?(options) + raise "Invalid authentication options" unless http_basic_authentication_options_valid?(**options) end super end protected - def http_basic_authentication_options_valid?(options) + def http_basic_authentication_options_valid?(**options) options[:password].present? && options[:name].present? end diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb index c3067d97680..28c03b11a72 100644 --- a/config/initializers/session_store.rb +++ b/config/initializers/session_store.rb @@ -5,8 +5,7 @@ # Be sure to restart your server when you modify this file. -options = { key: '_rubygems_session' } -Rails.application.config.session_store :cookie_store, options +Rails.application.config.session_store :cookie_store, key: '_rubygems_session' # Use the database for sessions instead of the cookie-based default, # which shouldn't be used to store highly confidential information diff --git a/test/functional/api/v1/versions_controller_test.rb b/test/functional/api/v1/versions_controller_test.rb index 42996e85d65..fa021edf523 100644 --- a/test/functional/api/v1/versions_controller_test.rb +++ b/test/functional/api/v1/versions_controller_test.rb @@ -9,8 +9,8 @@ def get_latest(rubygem, format = "json") get :latest, params: { id: rubygem.name, format: format } end - def get_reverse_dependencies(rubygem, options = { format: "json" }) - get :reverse_dependencies, options.merge(params: { id: rubygem.name }) + def get_reverse_dependencies(rubygem, format: "json") + get :reverse_dependencies, params: { id: rubygem.name, format: format } end def set_cache_header