diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 1a986169e..4ff7d7e6f 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -17,7 +17,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-18.04] - ruby: [ 2.7 ] + ruby: [ 2.7, 3.0 ] runs-on: ${{ matrix.os }} continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'debug' }} steps: @@ -85,6 +85,10 @@ jobs: path: coverage/codeclimate.${{ matrix.ruby }}.json upload_coverage: + strategy: + fail-fast: false + matrix: + ruby: [ 2.7, 3.0 ] runs-on: ubuntu-18.04 env: @@ -102,7 +106,7 @@ jobs: - uses: actions/download-artifact@v2.0.10 with: - name: coverage-2.7 + name: coverage-${{ matrix.ruby }} path: coverage - name: Aggregate & upload results to Code Climate diff --git a/Dockerfile b/Dockerfile index 97b0452e1..9c46182a3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM internetee/ruby:2.7-buster +FROM internetee/ruby:3.0-buster RUN mkdir -p /opt/webapps/app/tmp/pids WORKDIR /opt/webapps/app diff --git a/app/controllers/repp/v1/base_controller.rb b/app/controllers/repp/v1/base_controller.rb index 37d4b95be..c29f2137f 100644 --- a/app/controllers/repp/v1/base_controller.rb +++ b/app/controllers/repp/v1/base_controller.rb @@ -74,7 +74,7 @@ module Repp render_epp_error end - def render_epp_error(status = :bad_request, data = {}) + def render_epp_error(status = :bad_request, **data) @epp_errors ||= ActiveModel::Errors.new(self) @epp_errors.add(:epp_errors, msg: 'Command failed', code: '2304') if data != {} diff --git a/app/controllers/repp/v1/contacts_controller.rb b/app/controllers/repp/v1/contacts_controller.rb index 92f89a160..cc4dc7561 100644 --- a/app/controllers/repp/v1/contacts_controller.rb +++ b/app/controllers/repp/v1/contacts_controller.rb @@ -43,7 +43,7 @@ module Repp return end - render_success(create_update_success_body) + render_success(**create_update_success_body) end api :PUT, '/repp/v1/contacts/:contact_code' @@ -58,7 +58,7 @@ module Repp return end - render_success(create_update_success_body) + render_success(**create_update_success_body) end api :DELETE, '/repp/v1/contacts/:contact_code' diff --git a/app/interactions/domains/bulk_renew/single_domain_renew.rb b/app/interactions/domains/bulk_renew/single_domain_renew.rb index 5ae3826cd..a0df129b6 100644 --- a/app/interactions/domains/bulk_renew/single_domain_renew.rb +++ b/app/interactions/domains/bulk_renew/single_domain_renew.rb @@ -11,9 +11,7 @@ module Domains renewed_expire_time = prepare_renewed_expire_time in_transaction_with_retries do check_balance - success = domain.renew(renewed_expire_time: renewed_expire_time, - period: period, - unit: unit) + success = domain.renew(renewed_expire_time, period, unit) if success check_balance reduce_balance diff --git a/app/jobs/domain_expire_email_job.rb b/app/jobs/domain_expire_email_job.rb index 1aad4aed9..11bd41047 100644 --- a/app/jobs/domain_expire_email_job.rb +++ b/app/jobs/domain_expire_email_job.rb @@ -12,9 +12,9 @@ class DomainExpireEmailJob < ApplicationJob } if domain.force_delete_scheduled? - DomainExpireMailer.expired_soft(attrs).deliver_now + DomainExpireMailer.expired_soft(**attrs).deliver_now else - DomainExpireMailer.expired(attrs).deliver_now + DomainExpireMailer.expired(**attrs).deliver_now end end end diff --git a/app/models/concerns/epp_errors.rb b/app/models/concerns/epp_errors.rb index 90d742609..dc5a4d452 100644 --- a/app/models/concerns/epp_errors.rb +++ b/app/models/concerns/epp_errors.rb @@ -121,7 +121,7 @@ module EppErrors err = { code: code, msg: t } val = check_for_status(code, obj, val) err[:value] = { val: val, obj: obj } if val.present? - self.errors.add(:epp_errors, err) + self.errors.add(:epp_errors, **err) end def check_for_status(code, obj, val) diff --git a/app/models/epp/domain.rb b/app/models/epp/domain.rb index 0b3f1ad7f..ad4e3c34e 100644 --- a/app/models/epp/domain.rb +++ b/app/models/epp/domain.rb @@ -173,7 +173,7 @@ class Epp::Domain < Domain ### RENEW ### - def renew(renewed_expire_time:, period:, unit:) + def renew(renewed_expire_time, period, unit) @is_renewal = true add_renew_epp_errors unless renewable? diff --git a/app/validators/domain_nameserver_validator.rb b/app/validators/domain_nameserver_validator.rb index 55ceb1c96..9603b924e 100644 --- a/app/validators/domain_nameserver_validator.rb +++ b/app/validators/domain_nameserver_validator.rb @@ -7,6 +7,6 @@ class DomainNameserverValidator < ActiveModel::EachValidator return if values.size.between?(min, max) association = options[:association] || attribute - record.errors.add(association, :out_of_range, { min: min, max: max }) + record.errors.add(association, :out_of_range, **{ min: min, max: max }) end end diff --git a/app/validators/object_count_validator.rb b/app/validators/object_count_validator.rb index d2d880fea..01d6a55f8 100644 --- a/app/validators/object_count_validator.rb +++ b/app/validators/object_count_validator.rb @@ -5,6 +5,6 @@ class ObjectCountValidator < ActiveModel::EachValidator return if values.size.between?(min, max) association = options[:association] || attribute - record.errors.add(association, :out_of_range, { min: min, max: max }) + record.errors.add(association, :out_of_range, **{ min: min, max: max }) end end diff --git a/lib/gem_monkey_patches/i18n.rb b/lib/gem_monkey_patches/i18n.rb index 7d0613247..194a11733 100644 --- a/lib/gem_monkey_patches/i18n.rb +++ b/lib/gem_monkey_patches/i18n.rb @@ -6,7 +6,7 @@ module I18n def localize(object, options = {}) options.merge!({ default: '-' }) - object.present? ? original_localize(object, options) : '' + object.present? ? original_localize(object, **options) : '' end end end diff --git a/test/system/admin_area/bank_statement_test.rb b/test/system/admin_area/bank_statement_test.rb index 8630049dc..1405081e2 100644 --- a/test/system/admin_area/bank_statement_test.rb +++ b/test/system/admin_area/bank_statement_test.rb @@ -10,7 +10,7 @@ class AdminAreaBankStatementTest < ApplicationSystemTestCase def test_update_bank_statement visit admin_bank_statement_path(id: @invoice.id) - + click_link_or_button 'Add' fill_in 'Description', with: 'Invoice with id 123' @@ -55,7 +55,7 @@ class AdminAreaBankStatementTest < ApplicationSystemTestCase def test_can_bind_statement_transactions registrar = registrars(:bestnames) - registrar.issue_prepayment_invoice(amount: 500) + registrar.issue_prepayment_invoice(500) invoice = registrar.invoices.last create_bank_statement