From cf00247709a27d2000f7f942419e1ece618d0c57 Mon Sep 17 00:00:00 2001 From: Justin Coyne Date: Mon, 29 Apr 2024 10:59:47 -0500 Subject: [PATCH 1/2] Set target ruby version to 3.2 and autocorrect --- .rubocop.yml | 42 +++++++++---------- Gemfile.lock | 4 ++ .../search_across_blacklight_overrides.rb | 10 ++--- .../spotlight/exhibits_controller.rb | 4 +- app/helpers/application_helper.rb | 12 +++--- app/helpers/catalog_helper.rb | 2 +- ...d_publish_state_change_notification_job.rb | 2 +- app/models/bibliography.rb | 2 +- app/models/concerns/exhibit_extension.rb | 2 +- app/models/dor_harvester.rb | 2 +- app/models/exhibit_bot.rb | 2 +- app/models/iiif_canvas_indexer.rb | 2 +- .../bibliography_resources_controller_spec.rb | 2 +- .../dor_harvester_controller_spec.rb | 2 +- .../search_across_controller_spec.rb | 2 +- .../spotlight/catalog_controller_spec.rb | 2 +- spec/features/adding_items_spec.rb | 12 +++--- .../bibliography_display_manuscript_spec.rb | 2 +- spec/features/bibliography_indexing_spec.rb | 2 +- .../bibliography_resource_integration_spec.rb | 2 +- spec/features/canvas_display_spec.rb | 2 +- .../canvas_resource_integration_spec.rb | 2 +- spec/features/embed_block_spec.rb | 2 +- spec/features/full_text_highlight_spec.rb | 4 +- spec/features/indexing_integration_spec.rb | 2 +- .../manuscript_display_bibliography_spec.rb | 2 +- spec/features/range_limit_spec.rb | 2 +- spec/features/search_histories_spec.rb | 2 +- spec/features/theme_switching_spec.rb | 2 +- spec/features/viewers_spec.rb | 6 +-- spec/helpers/catalog_helper_spec.rb | 12 +++--- spec/helpers/search_across_helper_spec.rb | 10 ++--- spec/jobs/index_exhibit_metadata_job_spec.rb | 4 +- spec/jobs/index_related_content_job_spec.rb | 2 +- spec/jobs/record_index_status_job_spec.rb | 2 +- ...lish_state_change_notification_job_spec.rb | 2 +- spec/models/dor_harvester_spec.rb | 8 ++-- spec/models/exhibit_indexer_spec.rb | 2 +- spec/models/full_text_parser_spec.rb | 6 +-- spec/models/iiif_canvas_indexer_spec.rb | 2 +- spec/models/search_builder_spec.rb | 6 +-- spec/models/spotlight/exhibit_spec.rb | 6 +-- .../spotlight/resources/iiif_manifest_spec.rb | 4 +- .../models/spotlight/resources/upload_spec.rb | 2 +- spec/requests/index_statuses_requests_spec.rb | 8 ++-- spec/requests/viewers_spec.rb | 4 +- .../search_across_search_builder_spec.rb | 6 +-- spec/spec_helper.rb | 2 +- spec/support/etl_helper.rb | 4 +- .../_embedded_mirador3.html.erb_spec.rb | 2 +- ...s_document_header_default.html.erb_spec.rb | 2 +- .../_metadata_button_default.html.erb_spec.rb | 2 +- .../dor_harvester/_status.html.erb_spec.rb | 8 ++-- 53 files changed, 124 insertions(+), 120 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 47cbe1f9e..572d2acc1 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -6,14 +6,14 @@ require: - rubocop-rails AllCops: - TargetRubyVersion: 2.7 + TargetRubyVersion: 3.2 DisplayCopNames: true Exclude: - - 'bin/**/*' - - 'db/**/*' - - 'config/**/*' - - 'vendor/**/*' - - 'spec/fixtures/**/*' + - "bin/**/*" + - "db/**/*" + - "config/**/*" + - "vendor/**/*" + - "spec/fixtures/**/*" Rails: Enabled: true @@ -21,17 +21,17 @@ Rails: Layout/LineLength: Max: 120 Exclude: - - 'app/controllers/concerns/search_across_blacklight_overrides.rb' - - 'app/models/spotlight/dor/indexer.rb' - - 'lib/traject/dor_config.rb' - - 'spec/features/indexing_integration_spec.rb' - - 'spec/models/spotlight/dor/indexer_spec.rb' - - 'spec/features/bibliography_formatting_spec.rb' + - "app/controllers/concerns/search_across_blacklight_overrides.rb" + - "app/models/spotlight/dor/indexer.rb" + - "lib/traject/dor_config.rb" + - "spec/features/indexing_integration_spec.rb" + - "spec/models/spotlight/dor/indexer_spec.rb" + - "spec/features/bibliography_formatting_spec.rb" Style/PercentLiteralDelimiters: PreferredDelimiters: - '%i': '()' - '%w': '()' + "%i": "()" + "%w": "()" Style/StringLiterals: Enabled: true @@ -51,7 +51,7 @@ Style/HashTransformValues: Metrics/ClassLength: Exclude: - - 'app/controllers/catalog_controller.rb' + - "app/controllers/catalog_controller.rb" RSpec/Capybara: Enabled: false @@ -68,21 +68,21 @@ Bundler/OrderedGems: RSpec/ExampleLength: Max: 10 Exclude: - - 'spec/features/indexing_integration_spec.rb' + - "spec/features/indexing_integration_spec.rb" RSpec/MultipleMemoizedHelpers: Enabled: false Metrics/BlockLength: Exclude: - - 'app/controllers/catalog_controller.rb' - - 'app/controllers/search_across_controller.rb' - - 'app/models/spotlight/dor/indexer.rb' - - 'spec/**/*' + - "app/controllers/catalog_controller.rb" + - "app/controllers/search_across_controller.rb" + - "app/models/spotlight/dor/indexer.rb" + - "spec/**/*" Performance/RedundantBlockCall: Exclude: - - 'lib/traject/macros/**/*' + - "lib/traject/macros/**/*" Layout/EmptyLinesAroundAttributeAccessor: Enabled: true Layout/SpaceAroundMethodCallOperator: diff --git a/Gemfile.lock b/Gemfile.lock index 1f7777f92..5e005bc75 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -463,6 +463,8 @@ GEM net-ssh (7.2.3) newrelic_rpm (9.8.0) nio4r (2.7.1) + nokogiri (1.16.4-arm64-darwin) + racc (~> 1.4) nokogiri (1.16.4-x86_64-darwin) racc (~> 1.4) nokogiri (1.16.4-x86_64-linux) @@ -710,6 +712,7 @@ GEM actionpack (>= 5.2) activesupport (>= 5.2) sprockets (>= 3.0.0) + sqlite3 (1.7.3-arm64-darwin) sqlite3 (1.7.3-x86_64-darwin) sqlite3 (1.7.3-x86_64-linux) sshkit (1.22.1) @@ -795,6 +798,7 @@ GEM zeitwerk (2.6.13) PLATFORMS + arm64-darwin-23 x86_64-darwin-19 x86_64-darwin-20 x86_64-darwin-21 diff --git a/app/controllers/concerns/search_across_blacklight_overrides.rb b/app/controllers/concerns/search_across_blacklight_overrides.rb index b1916fe4a..75b7630e4 100644 --- a/app/controllers/concerns/search_across_blacklight_overrides.rb +++ b/app/controllers/concerns/search_across_blacklight_overrides.rb @@ -64,8 +64,8 @@ def render_grouped_document_index(response = @response) view_context.render_document_index(exhibits) end - def opensearch_catalog_url(*args) - view_context.spotlight.opensearch_search_across_url(*args) + def opensearch_catalog_url(*) + view_context.spotlight.opensearch_search_across_url(*) end def start_over_path(*_args) @@ -107,11 +107,11 @@ def page_entries_info(collection, entry_name: nil) case collection.total_count when 0 - t('search_across.pagination_info.no_items_found', entry_name: entry_name).html_safe + t('search_across.pagination_info.no_items_found', entry_name:).html_safe when 1 - t('search_across.pagination_info.single_item_found', entry_name: entry_name).html_safe + t('search_across.pagination_info.single_item_found', entry_name:).html_safe else - t('search_across.pagination_info.pages', entry_name: entry_name, + t('search_across.pagination_info.pages', entry_name:, current_page: collection.current_page, num_pages: collection.total_pages, start_num: view_context.number_with_delimiter(collection.offset_value + 1), diff --git a/app/controllers/spotlight/exhibits_controller.rb b/app/controllers/spotlight/exhibits_controller.rb index ebf4bd676..75167c2a5 100644 --- a/app/controllers/spotlight/exhibits_controller.rb +++ b/app/controllers/spotlight/exhibits_controller.rb @@ -7,8 +7,8 @@ module Spotlight # Override the upstream HomePagesController in order to inject range limit behaviors class ExhibitsController - def search_action_url(*args) - main_app.search_search_across_url(*args) + def search_action_url(*) + main_app.search_search_across_url(*) end def blacklight_config diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 8ae1c05f3..91749a867 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -19,9 +19,9 @@ def document_leaflet_map(document:, **) ## # @param [String] manifest def iiif_drag_n_drop(manifest, width: '40') - link_url = format Settings.iiif_dnd_base_url, query: { manifest: manifest }.to_query + link_url = format Settings.iiif_dnd_base_url, query: { manifest: }.to_query link_to link_url, class: 'iiif-dnd float-right', data: { turbolinks: false } do - image_tag 'iiif-drag-n-drop.svg', width: width, alt: 'IIIF Drag-n-drop' + image_tag 'iiif-drag-n-drop.svg', width:, alt: 'IIIF Drag-n-drop' end end @@ -36,10 +36,10 @@ def render_viewer_in_context(document, block) canvas = choose_canvas_id(block) if params[:controller] == 'spotlight/catalog' render partial: current_exhibit.required_viewer.to_partial_path, - locals: { document: document, block: block, canvas: canvas } + locals: { document:, block:, canvas: } else render partial: current_exhibit.required_viewer.default_viewer_path, - locals: { document: document, block: block, canvas: canvas } + locals: { document:, block:, canvas: } end end @@ -52,8 +52,8 @@ def custom_render_oembed_tag_async(document, canvas_id, block) content_tag :div, '', data: { embed_url: blacklight_oembed_engine.embed_url( - url: url, - canvas_id: canvas_id, + url:, + canvas_id:, search: params[:search], maxheight: block&.maxheight.presence || '600', suggested_search: (current_search_session&.query_params || {})[:q] diff --git a/app/helpers/catalog_helper.rb b/app/helpers/catalog_helper.rb index 2b12c8164..ac4394a0a 100644 --- a/app/helpers/catalog_helper.rb +++ b/app/helpers/catalog_helper.rb @@ -67,7 +67,7 @@ def table_of_contents_separator(options = {}) contents = safe_join(contents.map { |v| "
  • #{v}
  • ".html_safe }) # rubocop:disable Rails/OutputSafety id = options[:document].id - render partial: 'catalog/table_of_contents', locals: { contents: contents, collapse_id: "collapseToc-#{id}" } + render partial: 'catalog/table_of_contents', locals: { contents:, collapse_id: "collapseToc-#{id}" } end def manuscript_link(options = {}) diff --git a/app/jobs/send_publish_state_change_notification_job.rb b/app/jobs/send_publish_state_change_notification_job.rb index c0f601201..19c94aac9 100644 --- a/app/jobs/send_publish_state_change_notification_job.rb +++ b/app/jobs/send_publish_state_change_notification_job.rb @@ -4,7 +4,7 @@ # A background job to send notifications via the ExhibitBot about the published state of an exhibit changing class SendPublishStateChangeNotificationJob < ApplicationJob def perform(exhibit:, published:) - ExhibitBot.message(text: message_text(exhibit: exhibit, published: published)) + ExhibitBot.message(text: message_text(exhibit:, published:)) end private diff --git a/app/models/bibliography.rb b/app/models/bibliography.rb index 9a741c503..4d00a015a 100644 --- a/app/models/bibliography.rb +++ b/app/models/bibliography.rb @@ -30,7 +30,7 @@ def to_html # Renders a *sorted* bibliography def render(format = 'html') - cp = CiteProc::Processor.new style: 'chicago-author-date', format: format + cp = CiteProc::Processor.new(style: 'chicago-author-date', format:) cp.import bibliography.to_citeproc cp.bibliography.join end diff --git a/app/models/concerns/exhibit_extension.rb b/app/models/concerns/exhibit_extension.rb index 6b5eefc76..e107fc9f8 100644 --- a/app/models/concerns/exhibit_extension.rb +++ b/app/models/concerns/exhibit_extension.rb @@ -29,7 +29,7 @@ def required_viewer def send_publish_state_change_notification return unless saved_changes.key?('published') - SendPublishStateChangeNotificationJob.perform_later(exhibit: self, published: published) + SendPublishStateChangeNotificationJob.perform_later(exhibit: self, published:) end def index_exhibit_metadata diff --git a/app/models/dor_harvester.rb b/app/models/dor_harvester.rb index f7287d5d7..56d795b99 100644 --- a/app/models/dor_harvester.rb +++ b/app/models/dor_harvester.rb @@ -103,7 +103,7 @@ def on_error(resource, exception_or_message) else exception_or_message.to_s end.truncate(1.megabyte) - RecordIndexStatusJob.perform_later(self, resource.bare_druid, ok: false, message: message) + RecordIndexStatusJob.perform_later(self, resource.bare_druid, ok: false, message:) end def trigger_update_resource_metadata diff --git a/app/models/exhibit_bot.rb b/app/models/exhibit_bot.rb index 2fe68407a..bbe615d67 100644 --- a/app/models/exhibit_bot.rb +++ b/app/models/exhibit_bot.rb @@ -10,7 +10,7 @@ class << self end def message(channel: default_channel, as_user: true, text:) - client.chat_postMessage(channel: channel, as_user: as_user, text: text) + client.chat_postMessage(channel:, as_user:, text:) end private diff --git a/app/models/iiif_canvas_indexer.rb b/app/models/iiif_canvas_indexer.rb index 02372bce3..ae8bfc7bd 100644 --- a/app/models/iiif_canvas_indexer.rb +++ b/app/models/iiif_canvas_indexer.rb @@ -21,7 +21,7 @@ def index_canvases # Don't bother to index unless there is an annotationList content to do so. next unless other_content['@type'] == ANNOTATION_LIST - canvas_resource = CanvasResource.find_or_initialize_by(url: other_content['@id'], exhibit: exhibit) + canvas_resource = CanvasResource.find_or_initialize_by(url: other_content['@id'], exhibit:) # We need to pass some more information to the canvas indexer, and we # so we do this by enhancing the stored Hash with needed fields. enhanced_canvas = JSON.parse(canvas.to_json) diff --git a/spec/controllers/bibliography_resources_controller_spec.rb b/spec/controllers/bibliography_resources_controller_spec.rb index 3f18a8588..dbdf45321 100644 --- a/spec/controllers/bibliography_resources_controller_spec.rb +++ b/spec/controllers/bibliography_resources_controller_spec.rb @@ -5,7 +5,7 @@ RSpec.describe BibliographyResourcesController, type: :controller do let(:resource) { double } let(:exhibit) { create(:exhibit) } - let(:user) { create(:exhibit_admin, exhibit: exhibit) } + let(:user) { create(:exhibit_admin, exhibit:) } let(:fixture_file) { fixture_file_upload('spec/fixtures/bibliography/article.bib') } let(:attributes) { { bibtex_file: fixture_file } } diff --git a/spec/controllers/dor_harvester_controller_spec.rb b/spec/controllers/dor_harvester_controller_spec.rb index e02c9969f..2c56bf31c 100644 --- a/spec/controllers/dor_harvester_controller_spec.rb +++ b/spec/controllers/dor_harvester_controller_spec.rb @@ -5,7 +5,7 @@ RSpec.describe DorHarvesterController, type: :controller do let(:resource) { double } let(:exhibit) { create(:exhibit) } - let(:user) { create(:exhibit_admin, exhibit: exhibit) } + let(:user) { create(:exhibit_admin, exhibit:) } let(:attributes) { { druid_list: '' } } before do diff --git a/spec/controllers/search_across_controller_spec.rb b/spec/controllers/search_across_controller_spec.rb index a62cd9518..4a9658405 100644 --- a/spec/controllers/search_across_controller_spec.rb +++ b/spec/controllers/search_across_controller_spec.rb @@ -136,7 +136,7 @@ let(:exhibit) do create(:exhibit, slug: 'mine', published: true, tag_list: ['bar']) end - let(:user) { create(:exhibit_admin, exhibit: exhibit) } + let(:user) { create(:exhibit_admin, exhibit:) } before do sign_in user diff --git a/spec/controllers/spotlight/catalog_controller_spec.rb b/spec/controllers/spotlight/catalog_controller_spec.rb index ac43b1923..5a82f9c69 100644 --- a/spec/controllers/spotlight/catalog_controller_spec.rb +++ b/spec/controllers/spotlight/catalog_controller_spec.rb @@ -7,7 +7,7 @@ routes { Spotlight::Engine.routes } let(:exhibit) { create(:exhibit) } - let(:user) { create(:exhibit_admin, exhibit: exhibit) } + let(:user) { create(:exhibit_admin, exhibit:) } before do sign_in user diff --git a/spec/features/adding_items_spec.rb b/spec/features/adding_items_spec.rb index d976df8ad..114e73fe3 100644 --- a/spec/features/adding_items_spec.rb +++ b/spec/features/adding_items_spec.rb @@ -4,17 +4,17 @@ RSpec.feature 'Adding items to an exhibit', type: :feature do let(:exhibit) { create(:exhibit) } - let(:user) { create(:exhibit_admin, exhibit: exhibit) } + let(:user) { create(:exhibit_admin, exhibit:) } let(:number_of_resources) { 5 } - let(:resource) { DorHarvester.create(exhibit: exhibit) } + let(:resource) { DorHarvester.create(exhibit:) } before do sign_in user number_of_resources.times do |i| Spotlight::SolrDocumentSidecar.create( - exhibit: exhibit, - resource: resource, + exhibit:, + resource:, document: SolrDocument.new(id: "abc#{i}"), index_status: { ok: true } ) @@ -62,8 +62,8 @@ context 'when an indexing error occurs' do before do Spotlight::SolrDocumentSidecar.create( - exhibit: exhibit, - resource: resource, + exhibit:, + resource:, document: SolrDocument.new(id: 'xyz'), index_status: { ok: false, message: 'There was a problem indexing' } ) diff --git a/spec/features/bibliography_display_manuscript_spec.rb b/spec/features/bibliography_display_manuscript_spec.rb index 38eefdf0a..a7a4f9765 100644 --- a/spec/features/bibliography_display_manuscript_spec.rb +++ b/spec/features/bibliography_display_manuscript_spec.rb @@ -15,7 +15,7 @@ end.join("\n") # we index some bibliography records that have links to our resource - bib = BibliographyResource.new(bibtex_file: bibtex_data, exhibit: exhibit) + bib = BibliographyResource.new(bibtex_file: bibtex_data, exhibit:) bib.save_and_index # render the resource show page diff --git a/spec/features/bibliography_indexing_spec.rb b/spec/features/bibliography_indexing_spec.rb index c3b682974..7c26db762 100644 --- a/spec/features/bibliography_indexing_spec.rb +++ b/spec/features/bibliography_indexing_spec.rb @@ -4,7 +4,7 @@ RSpec.feature 'Bibliography indexing', type: :feature do let(:exhibit) { create(:exhibit) } - let(:curator) { create(:exhibit_admin, exhibit: exhibit) } + let(:curator) { create(:exhibit_admin, exhibit:) } before do sign_in curator diff --git a/spec/features/bibliography_resource_integration_spec.rb b/spec/features/bibliography_resource_integration_spec.rb index a2989277d..3f42a029c 100644 --- a/spec/features/bibliography_resource_integration_spec.rb +++ b/spec/features/bibliography_resource_integration_spec.rb @@ -7,7 +7,7 @@ let(:bibliography_resource) do BibliographyResource.new( - bibtex_file: File.open(file).read, exhibit: exhibit + bibtex_file: File.open(file).read, exhibit: ) end diff --git a/spec/features/canvas_display_spec.rb b/spec/features/canvas_display_spec.rb index ed5b99b1a..b4bdd4ae7 100644 --- a/spec/features/canvas_display_spec.rb +++ b/spec/features/canvas_display_spec.rb @@ -19,7 +19,7 @@ instance_double(Faraday::Response, body: annolist_file) ) - canvas = CanvasResource.new(data: canvas_data, exhibit: exhibit) + canvas = CanvasResource.new(data: canvas_data, exhibit:) canvas.save_and_index visit spotlight.exhibit_solr_document_path(exhibit_id: exhibit.slug, id: document_id) diff --git a/spec/features/canvas_resource_integration_spec.rb b/spec/features/canvas_resource_integration_spec.rb index 34bc1e8c1..ff77cf4f0 100644 --- a/spec/features/canvas_resource_integration_spec.rb +++ b/spec/features/canvas_resource_integration_spec.rb @@ -9,7 +9,7 @@ let(:enhanced_canvas) do raw_canvas.merge(manifest_label: 'Awesome sauce!', range_labels: %w(Label1 Label2)) end - let(:resource) { CanvasResource.new(exhibit: exhibit, data: enhanced_canvas) } + let(:resource) { CanvasResource.new(exhibit:, data: enhanced_canvas) } let(:file) { 'spec/fixtures/iiif/fh878gz0315-canvas-521.json' } let(:exhibit) { create(:exhibit) } let(:to_solr_hash) { indexed_documents(resource).first } diff --git a/spec/features/embed_block_spec.rb b/spec/features/embed_block_spec.rb index ee6d6f31d..892ec2167 100644 --- a/spec/features/embed_block_spec.rb +++ b/spec/features/embed_block_spec.rb @@ -8,7 +8,7 @@ include Spotlight::TestFeaturesHelpers let(:exhibit) { create(:exhibit) } - let(:curator) { create(:exhibit_admin, exhibit: exhibit) } + let(:curator) { create(:exhibit_admin, exhibit:) } before do allow(Spotlight::Engine.config).to receive(:filter_resources_by_exhibit).and_return(false) diff --git a/spec/features/full_text_highlight_spec.rb b/spec/features/full_text_highlight_spec.rb index 47dcd336b..b83a90487 100644 --- a/spec/features/full_text_highlight_spec.rb +++ b/spec/features/full_text_highlight_spec.rb @@ -4,8 +4,8 @@ RSpec.feature 'Full text highlighting' do let(:exhibit) { create(:exhibit) } - let(:dor_harvester) { DorHarvester.new(druid_list: druid, exhibit: exhibit) } - let(:user) { create(:exhibit_admin, exhibit: exhibit) } + let(:dor_harvester) { DorHarvester.new(druid_list: druid, exhibit:) } + let(:user) { create(:exhibit_admin, exhibit:) } before do allow(Spotlight::Engine.config).to receive(:filter_resources_by_exhibit).and_return(false) diff --git a/spec/features/indexing_integration_spec.rb b/spec/features/indexing_integration_spec.rb index 28be34449..c0cfa0157 100644 --- a/spec/features/indexing_integration_spec.rb +++ b/spec/features/indexing_integration_spec.rb @@ -3,7 +3,7 @@ require 'rails_helper' RSpec.describe 'indexing integration test', type: :feature, vcr: true do - subject(:dor_harvester) { DorHarvester.new(druid_list: druid, exhibit: exhibit) } + subject(:dor_harvester) { DorHarvester.new(druid_list: druid, exhibit:) } let(:exhibit) { FactoryBot.create(:exhibit) } let(:rsolr) { instance_double(RSolr) } diff --git a/spec/features/manuscript_display_bibliography_spec.rb b/spec/features/manuscript_display_bibliography_spec.rb index 40d2b41a2..22ec12788 100644 --- a/spec/features/manuscript_display_bibliography_spec.rb +++ b/spec/features/manuscript_display_bibliography_spec.rb @@ -16,7 +16,7 @@ ActiveJob::Base.queue_adapter = :inline # block until indexing has committed # we index some bibliography records that have links to our resource - bib = BibliographyResource.new(bibtex_file: bibtex_data, exhibit: exhibit) + bib = BibliographyResource.new(bibtex_file: bibtex_data, exhibit:) bib.save_and_index # render the resource show page diff --git a/spec/features/range_limit_spec.rb b/spec/features/range_limit_spec.rb index f71713d42..0ecfd9d16 100644 --- a/spec/features/range_limit_spec.rb +++ b/spec/features/range_limit_spec.rb @@ -6,7 +6,7 @@ let(:exhibit) do create(:exhibit, published: true, slug: 'test-exhibit') end - let(:admin) { create(:exhibit_admin, exhibit: exhibit) } + let(:admin) { create(:exhibit_admin, exhibit:) } before do login_as admin diff --git a/spec/features/search_histories_spec.rb b/spec/features/search_histories_spec.rb index fcab9d5f5..abbc121ce 100644 --- a/spec/features/search_histories_spec.rb +++ b/spec/features/search_histories_spec.rb @@ -14,7 +14,7 @@ # do a JSON or non-JSON query to see whether it's also added to the history visit spotlight.search_exhibit_catalog_path(exhibit_id: exhibit.slug, q: 'book', - format: format) + format:) end context 'when format is JSON' do diff --git a/spec/features/theme_switching_spec.rb b/spec/features/theme_switching_spec.rb index 46e616104..f7ff96cd5 100644 --- a/spec/features/theme_switching_spec.rb +++ b/spec/features/theme_switching_spec.rb @@ -4,7 +4,7 @@ describe 'Theme switching', type: :feature do let(:exhibit) { create(:exhibit) } - let(:user) { create(:exhibit_admin, exhibit: exhibit) } + let(:user) { create(:exhibit_admin, exhibit:) } before { sign_in user } diff --git a/spec/features/viewers_spec.rb b/spec/features/viewers_spec.rb index c409b1593..74802a0db 100644 --- a/spec/features/viewers_spec.rb +++ b/spec/features/viewers_spec.rb @@ -12,7 +12,7 @@ end context 'an authorized user' do - let(:user) { create(:exhibit_admin, exhibit: exhibit) } + let(:user) { create(:exhibit_admin, exhibit:) } it 'sees the default configuration' do visit spotlight.exhibit_dashboard_path(exhibit) @@ -74,8 +74,8 @@ end describe 'rendered viewer' do - let(:feature_page) { FactoryBot.create(:feature_page, exhibit: exhibit) } - let(:admin) { FactoryBot.create(:exhibit_admin, exhibit: exhibit) } + let(:feature_page) { FactoryBot.create(:feature_page, exhibit:) } + let(:admin) { FactoryBot.create(:exhibit_admin, exhibit:) } before do exhibit.required_viewer.viewer_type = 'mirador3' diff --git a/spec/helpers/catalog_helper_spec.rb b/spec/helpers/catalog_helper_spec.rb index 509cd82fa..88f7e9fd9 100644 --- a/spec/helpers/catalog_helper_spec.rb +++ b/spec/helpers/catalog_helper_spec.rb @@ -61,7 +61,7 @@ end describe '#paragraph_joined_content' do - subject(:content) { helper.paragraph_joined_content(value: value) } + subject(:content) { helper.paragraph_joined_content(value:) } context 'single description' do let(:value) { %w(

    stuff

    ) } @@ -116,7 +116,7 @@ describe '#manuscript_link' do let(:druid) { 'bg021sq9590' } - let(:input) { { value: [druid], document: document } } + let(:input) { { value: [druid], document: } } let(:show_page) { "/test-flag-exhibit-slug/catalog/#{druid}" } before do @@ -169,7 +169,7 @@ def current_exhibit end it 'wraps each highlight value in a paragraph tag' do - ps = helper.render_fulltext_highlight(document: document) + ps = helper.render_fulltext_highlight(document:) expect(ps).to eq '

    The first Value1

    The Value2 second

    ' end end @@ -180,7 +180,7 @@ def current_exhibit end it 'only renders the configured amount of snippets' do - ps = helper.render_fulltext_highlight(document: document) + ps = helper.render_fulltext_highlight(document:) expect(ps.scan('

    ').count).to eq Settings.full_text_highlight.snippet_count end end @@ -193,7 +193,7 @@ def current_exhibit it 'offers a link to go the record view w/ a search initiated' do expect(helper).to receive_messages(current_exhibit: {}, params: { q: 'The search term' }) - link = Capybara.string(helper.render_fulltext_highlight(document: document)).find('a') + link = Capybara.string(helper.render_fulltext_highlight(document:)).find('a') expect(link.text).to eq('Search for "The search term" in document text') expect(link['href']).to match(/abc123\?search=The\+search\+term/) end @@ -203,7 +203,7 @@ def current_exhibit let(:highlights) { [] } it 'is nil' do - ps = helper.render_fulltext_highlight(document: document) + ps = helper.render_fulltext_highlight(document:) expect(ps).to be_blank end end diff --git a/spec/helpers/search_across_helper_spec.rb b/spec/helpers/search_across_helper_spec.rb index 66b2252d3..784230ebe 100644 --- a/spec/helpers/search_across_helper_spec.rb +++ b/spec/helpers/search_across_helper_spec.rb @@ -13,7 +13,7 @@ it 'removes the group key/value' do expect(helper).to receive_messages( - search_state: search_state + search_state: ) expect(helper.search_without_group).to eq({}) end @@ -29,7 +29,7 @@ it 'removes the group key/value' do expect(helper).to receive_messages( - search_state: search_state + search_state: ) expect(helper.search_with_group).to eq group: true end @@ -89,7 +89,7 @@ let(:current_ability) { Ability.new(User.new) } before do - assign(:response, Blacklight::Solr::Response.new(response, nil, blacklight_config: blacklight_config)) + assign(:response, Blacklight::Solr::Response.new(response, nil, blacklight_config:)) allow(helper).to receive(:current_ability).and_return(current_ability) create(:exhibit, slug: 'abc', title: 'Alphabet') @@ -136,7 +136,7 @@ let(:current_ability) { Ability.new(User.new) } before do - assign(:response, Blacklight::Solr::Response.new(response, nil, blacklight_config: blacklight_config)) + assign(:response, Blacklight::Solr::Response.new(response, nil, blacklight_config:)) allow(helper).to receive(:current_ability).and_return(current_ability) create(:exhibit, slug: 'a', title: 'Alphabet') @@ -168,7 +168,7 @@ let(:current_ability) { Ability.new(User.new) } before do - assign(:response, Blacklight::Solr::Response.new(response, nil, blacklight_config: blacklight_config)) + assign(:response, Blacklight::Solr::Response.new(response, nil, blacklight_config:)) create(:exhibit, slug: 'abc') create(:exhibit, slug: 'xyz') create(:exhibit, slug: 'private', published: false) diff --git a/spec/jobs/index_exhibit_metadata_job_spec.rb b/spec/jobs/index_exhibit_metadata_job_spec.rb index 2d4009013..3505add2d 100644 --- a/spec/jobs/index_exhibit_metadata_job_spec.rb +++ b/spec/jobs/index_exhibit_metadata_job_spec.rb @@ -12,7 +12,7 @@ context 'when the action is add' do it 'sends the add message to the ExhibitIndexer' do - subject.perform(exhibit: exhibit, action: 'add') + subject.perform(exhibit:, action: 'add') expect(indexer).to have_received(:add) end @@ -20,7 +20,7 @@ context 'when the action is delete' do it 'sends the delete message to the ExhibitIndexer' do - subject.perform(exhibit: exhibit, action: 'delete') + subject.perform(exhibit:, action: 'delete') expect(indexer).to have_received(:delete) end diff --git a/spec/jobs/index_related_content_job_spec.rb b/spec/jobs/index_related_content_job_spec.rb index 05a3d9d33..83b67b3a6 100644 --- a/spec/jobs/index_related_content_job_spec.rb +++ b/spec/jobs/index_related_content_job_spec.rb @@ -5,7 +5,7 @@ RSpec.describe IndexRelatedContentJob do describe '#perform' do let(:exhibit) { create(:exhibit) } - let(:harvester) { DorHarvester.new(exhibit: exhibit) } + let(:harvester) { DorHarvester.new(exhibit:) } let(:enqueuer) { instance_double(IiifCanvasIndexer, index_canvases: []) } it do diff --git a/spec/jobs/record_index_status_job_spec.rb b/spec/jobs/record_index_status_job_spec.rb index d909fe562..e4620c342 100644 --- a/spec/jobs/record_index_status_job_spec.rb +++ b/spec/jobs/record_index_status_job_spec.rb @@ -5,7 +5,7 @@ RSpec.describe RecordIndexStatusJob do describe '#perform' do let(:exhibit) { create(:exhibit) } - let(:harvester) { DorHarvester.new(exhibit: exhibit) } + let(:harvester) { DorHarvester.new(exhibit:) } it 'creates a new sidecar with a status entry' do expect do diff --git a/spec/jobs/send_publish_state_change_notification_job_spec.rb b/spec/jobs/send_publish_state_change_notification_job_spec.rb index a592215ed..81f7531b0 100644 --- a/spec/jobs/send_publish_state_change_notification_job_spec.rb +++ b/spec/jobs/send_publish_state_change_notification_job_spec.rb @@ -3,7 +3,7 @@ require 'rails_helper' describe SendPublishStateChangeNotificationJob do - let(:job) { described_class.perform_now(exhibit: exhibit, published: published) } + let(:job) { described_class.perform_now(exhibit:, published:) } let(:exhibit) { FactoryBot.create(:exhibit) } context 'when publishing' do diff --git a/spec/models/dor_harvester_spec.rb b/spec/models/dor_harvester_spec.rb index 94d4125e5..5d9f0ea11 100644 --- a/spec/models/dor_harvester_spec.rb +++ b/spec/models/dor_harvester_spec.rb @@ -3,7 +3,7 @@ require 'rails_helper' describe DorHarvester do - subject(:harvester) { described_class.create druid_list: druid, exhibit: exhibit } + subject(:harvester) { described_class.create druid_list: druid, exhibit: } let(:exhibit) { create(:exhibit) } let(:druid) { 'xf680rd3068' } @@ -65,7 +65,7 @@ end context 'when index_related_content is enabled for an exhibit' do - subject(:harvester) { described_class.create druid_list: druid, exhibit: exhibit } + subject(:harvester) { described_class.create druid_list: druid, exhibit: } let(:exhibit) { create(:exhibit, slug: 'test-flag-exhibit-slug') } @@ -132,7 +132,7 @@ def sidecar let(:items) { [] } let(:resource) do - instance_double(Purl, exists?: true, bare_druid: druid, items: items) + instance_double(Purl, exists?: true, bare_druid: druid, items:) end before do @@ -148,7 +148,7 @@ def sidecar context 'with a collection' do let(:items) { [child].each } # `#each` converts the array to an enumerable - let(:child) { instance_double(PurlFetcher::Client::PublicXmlRecord, druid: druid) } + let(:child) { instance_double(PurlFetcher::Client::PublicXmlRecord, druid:) } it 'includes child resources' do expect(subject.size).to eq 2 diff --git a/spec/models/exhibit_indexer_spec.rb b/spec/models/exhibit_indexer_spec.rb index 44328bf2b..b9a925795 100644 --- a/spec/models/exhibit_indexer_spec.rb +++ b/spec/models/exhibit_indexer_spec.rb @@ -9,7 +9,7 @@ let(:exhibit) { FactoryBot.create(:exhibit) } before do - allow(described_class).to receive_messages(solr_connection: solr_connection) + allow(described_class).to receive_messages(solr_connection:) end describe '#add' do diff --git a/spec/models/full_text_parser_spec.rb b/spec/models/full_text_parser_spec.rb index 08c08cd58..9dbbe7e34 100644 --- a/spec/models/full_text_parser_spec.rb +++ b/spec/models/full_text_parser_spec.rb @@ -5,7 +5,7 @@ describe FullTextParser do subject(:parser) { described_class.new(purl_object) } - let(:purl_object) { instance_double('PurlObject', bare_druid: 'cc842mn9348', public_xml: public_xml) } + let(:purl_object) { instance_double('PurlObject', bare_druid: 'cc842mn9348', public_xml:) } let(:public_xml) { Nokogiri::XML.parse(File.read(File.join(FIXTURES_PATH, 'cc842mn9348.xml'))) } describe '#ocr_files' do @@ -35,7 +35,7 @@ end context 'with an hOCR transcription' do - let(:purl_object) { instance_double('PurlObject', bare_druid: 'hocrexample', public_xml: public_xml) } + let(:purl_object) { instance_double('PurlObject', bare_druid: 'hocrexample', public_xml:) } let(:public_xml) { Nokogiri::XML.parse(File.read(File.join(FIXTURES_PATH, 'hocrexample.xml'))) } let(:text) do <<-FIXTURE @@ -64,7 +64,7 @@ end context 'with a plain-text transcription' do - let(:purl_object) { instance_double('PurlObject', bare_druid: 'xt162pg0437', public_xml: public_xml) } + let(:purl_object) { instance_double('PurlObject', bare_druid: 'xt162pg0437', public_xml:) } let(:public_xml) { Nokogiri::XML.parse(File.read(File.join(FIXTURES_PATH, 'xt162pg0437.xml'))) } before do diff --git a/spec/models/iiif_canvas_indexer_spec.rb b/spec/models/iiif_canvas_indexer_spec.rb index 049d59896..5e7603660 100644 --- a/spec/models/iiif_canvas_indexer_spec.rb +++ b/spec/models/iiif_canvas_indexer_spec.rb @@ -12,7 +12,7 @@ custom_manifest_pattern: 'http://example.org/iiif/{id}/manifest' ) end - let(:exhibit) { create(:exhibit, viewer: viewer) } + let(:exhibit) { create(:exhibit, viewer:) } let(:druid) { 'book1' } let(:document) do SolrDocument.new( diff --git a/spec/models/search_builder_spec.rb b/spec/models/search_builder_spec.rb index bf61d51bb..a8b71bcf2 100644 --- a/spec/models/search_builder_spec.rb +++ b/spec/models/search_builder_spec.rb @@ -7,13 +7,13 @@ let(:exhibit) { create(:exhibit) } let(:scope) do - instance_double('scope', blacklight_config: blacklight_config, current_exhibit: exhibit, search_state_class: nil) + instance_double('scope', blacklight_config:, current_exhibit: exhibit, search_state_class: nil) end let(:rows) { 999 } let(:blacklight_params) do { format: 'json', - rows: rows + rows: }.with_indifferent_access end let(:blacklight_config) do @@ -74,7 +74,7 @@ end context 'non-JSON API is over limit' do - let(:blacklight_params) { { q: 'my query', rows: rows }.with_indifferent_access } # omit format + let(:blacklight_params) { { q: 'my query', rows: }.with_indifferent_access } # omit format it 'cannot exceed config.max_per_page' do expect(builder.to_hash).to include(rows: 100) diff --git a/spec/models/spotlight/exhibit_spec.rb b/spec/models/spotlight/exhibit_spec.rb index bed5ea49e..93bd8bbfa 100644 --- a/spec/models/spotlight/exhibit_spec.rb +++ b/spec/models/spotlight/exhibit_spec.rb @@ -73,7 +73,7 @@ expect do exhibit.save - end.to have_enqueued_job(IndexExhibitMetadataJob).with(exhibit: exhibit, action: 'add') + end.to have_enqueued_job(IndexExhibitMetadataJob).with(exhibit:, action: 'add') end end @@ -83,7 +83,7 @@ it 'enqueues the IndexExhibitMetadataJob for adding a document' do expect do exhibit.save - end.to have_enqueued_job(IndexExhibitMetadataJob).with(exhibit: exhibit, action: 'add') + end.to have_enqueued_job(IndexExhibitMetadataJob).with(exhibit:, action: 'add') end end @@ -95,7 +95,7 @@ expect do exhibit.save - end.to have_enqueued_job(IndexExhibitMetadataJob).with(exhibit: exhibit, action: 'delete') + end.to have_enqueued_job(IndexExhibitMetadataJob).with(exhibit:, action: 'delete') end end diff --git a/spec/models/spotlight/resources/iiif_manifest_spec.rb b/spec/models/spotlight/resources/iiif_manifest_spec.rb index 6f342cd2c..3e23ebf1a 100644 --- a/spec/models/spotlight/resources/iiif_manifest_spec.rb +++ b/spec/models/spotlight/resources/iiif_manifest_spec.rb @@ -21,7 +21,7 @@ it 'adds in the exhibits custom field thumbnail_square_url_ssm' do expect(iiif_manifest_resource).to receive_messages( thumbnail_field: 'thumbnail_field', - manifest: manifest + manifest: ) iiif_manifest_resource.add_thumbnail_url @@ -62,7 +62,7 @@ it 'uses the first canvas as a thumbnail' do expect(iiif_manifest_resource).to receive_messages( thumbnail_field: 'thumbnail_field', - manifest: manifest + manifest: ) iiif_manifest_resource.add_thumbnail_url diff --git a/spec/models/spotlight/resources/upload_spec.rb b/spec/models/spotlight/resources/upload_spec.rb index fa4d4463b..7e9a7eed0 100644 --- a/spec/models/spotlight/resources/upload_spec.rb +++ b/spec/models/spotlight/resources/upload_spec.rb @@ -3,7 +3,7 @@ require 'rails_helper' describe Spotlight::Resources::Upload do - subject(:resource) { described_class.create! exhibit: exhibit, upload: upload } + subject(:resource) { described_class.create! exhibit:, upload: } let(:exhibit) { create(:exhibit) } let(:upload_id) { 123 } diff --git a/spec/requests/index_statuses_requests_spec.rb b/spec/requests/index_statuses_requests_spec.rb index 7ae4ebf54..dde458c3e 100644 --- a/spec/requests/index_statuses_requests_spec.rb +++ b/spec/requests/index_statuses_requests_spec.rb @@ -5,15 +5,15 @@ describe 'Index Statuses', type: :request do let(:exhibit) { create(:exhibit) } let(:user) { nil } - let(:resource) { DorHarvester.create(exhibit: exhibit) } + let(:resource) { DorHarvester.create(exhibit:) } before do sign_in user 5.times do |i| Spotlight::SolrDocumentSidecar.create( - exhibit: exhibit, - resource: resource, + exhibit:, + resource:, document: SolrDocument.new(id: "abc#{i}"), index_status: { ok: true } ) @@ -21,7 +21,7 @@ end context 'for an exhibit admin' do - let(:user) { create(:exhibit_admin, exhibit: exhibit) } + let(:user) { create(:exhibit_admin, exhibit:) } describe '#show' do it "renders json including details about the item's indexing status" do diff --git a/spec/requests/viewers_spec.rb b/spec/requests/viewers_spec.rb index 5c0a09147..59a89f2bf 100644 --- a/spec/requests/viewers_spec.rb +++ b/spec/requests/viewers_spec.rb @@ -32,7 +32,7 @@ end context 'an exhibit admin' do - let(:user) { create(:exhibit_admin, exhibit: exhibit) } + let(:user) { create(:exhibit_admin, exhibit:) } it 'is allowed' do get "/#{exhibit.slug}/viewers/edit" @@ -52,7 +52,7 @@ end context 'an exhibit admin' do - let(:user) { create(:exhibit_admin, exhibit: exhibit) } + let(:user) { create(:exhibit_admin, exhibit:) } let(:viewer_params) { { viewer_type: 'mirador' } } before do diff --git a/spec/services/search_across_search_builder_spec.rb b/spec/services/search_across_search_builder_spec.rb index 035830d97..8ad9db58e 100644 --- a/spec/services/search_across_search_builder_spec.rb +++ b/spec/services/search_across_search_builder_spec.rb @@ -7,11 +7,11 @@ let(:scope) do instance_double(Blacklight::SearchService, - blacklight_config: blacklight_config, - context: context, + blacklight_config:, + context:, search_state_class: nil) end - let(:context) { { current_ability: current_ability } } + let(:context) { { current_ability: } } let(:blacklight_config) { SearchAcrossController.blacklight_config.deep_copy } let(:user_params) { {} } let(:user) { create(:curator) } diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 16507cd52..3103ed1f1 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration -Dir['./spec/support/**/*.rb'].sort.each { |f| require f } +Dir['./spec/support/**/*.rb'].each { |f| require f } require 'webmock/rspec' allowed_sites = [ 'chromedriver.storage.googleapis.com', diff --git a/spec/support/etl_helper.rb b/spec/support/etl_helper.rb index 89c82747c..37e468b04 100644 --- a/spec/support/etl_helper.rb +++ b/spec/support/etl_helper.rb @@ -4,9 +4,9 @@ module EtlHelper # Helper method to get indexed documents for a resource def indexed_documents(resource, throw_as: :skip, on_error: :exception) - return to_enum(:indexed_documents, resource, throw_as: throw_as, on_error: :exception) unless block_given? + return to_enum(:indexed_documents, resource, throw_as:, on_error: :exception) unless block_given? - resource.reindex(on_error: on_error) do |data| + resource.reindex(on_error:) do |data| yield data throw throw_as if throw_as end diff --git a/spec/views/catalog/_embedded_mirador3.html.erb_spec.rb b/spec/views/catalog/_embedded_mirador3.html.erb_spec.rb index ec8ca99fc..88c2ad2db 100644 --- a/spec/views/catalog/_embedded_mirador3.html.erb_spec.rb +++ b/spec/views/catalog/_embedded_mirador3.html.erb_spec.rb @@ -9,7 +9,7 @@ before do without_partial_double_verification do allow(view).to receive_messages( - document: document + document: ) end end diff --git a/spec/views/catalog/_exhibits_document_header_default.html.erb_spec.rb b/spec/views/catalog/_exhibits_document_header_default.html.erb_spec.rb index 58a0ec439..e7d1925d6 100644 --- a/spec/views/catalog/_exhibits_document_header_default.html.erb_spec.rb +++ b/spec/views/catalog/_exhibits_document_header_default.html.erb_spec.rb @@ -9,7 +9,7 @@ before do expect(view).to receive_messages( current_exhibit: exhibit, - document: document, + document:, document_counter: 0, render_document_partial: -> {} ) diff --git a/spec/views/catalog/_metadata_button_default.html.erb_spec.rb b/spec/views/catalog/_metadata_button_default.html.erb_spec.rb index f510e9a4a..7c4f7f63f 100644 --- a/spec/views/catalog/_metadata_button_default.html.erb_spec.rb +++ b/spec/views/catalog/_metadata_button_default.html.erb_spec.rb @@ -12,7 +12,7 @@ context 'when modsxml is available' do it do - expect(view).to receive_messages(current_exhibit: current_exhibit) + expect(view).to receive_messages(current_exhibit:) render expect(rendered).to have_css 'a', text: 'More details ยป' end diff --git a/spec/views/dor_harvester/_status.html.erb_spec.rb b/spec/views/dor_harvester/_status.html.erb_spec.rb index 93244fdcf..ce48f9fb8 100644 --- a/spec/views/dor_harvester/_status.html.erb_spec.rb +++ b/spec/views/dor_harvester/_status.html.erb_spec.rb @@ -4,7 +4,7 @@ RSpec.describe 'dor_harvester/_status.html.erb', type: :view do let(:exhibit) { create(:exhibit) } - let(:harvester) { DorHarvester.new(druid_list: '', exhibit: exhibit) } + let(:harvester) { DorHarvester.new(druid_list: '', exhibit:) } context 'with status information' do before do @@ -14,14 +14,14 @@ end it 'displays the object status' do - render partial: 'dor_harvester/status', locals: { harvester: harvester } + render partial: 'dor_harvester/status', locals: { harvester: } expect(rendered).to have_content('Object druids') expect(rendered).to have_content(/okdruid\s+Published/) expect(rendered).to have_selector '.danger', text: /baddruid\s+broken/ end it 'displays the collection status' do - render partial: 'dor_harvester/status', locals: { harvester: harvester } + render partial: 'dor_harvester/status', locals: { harvester: } expect(rendered).to have_content('Collection druids') expect(rendered).to have_content(/collectiondruid\s+52/) end @@ -29,7 +29,7 @@ context 'without status information' do it 'displays an empty status' do - render partial: 'dor_harvester/status', locals: { harvester: harvester } + render partial: 'dor_harvester/status', locals: { harvester: } expect(rendered).not_to have_selector '#sdr-status-inner-items' expect(rendered).not_to have_selector '#sdr-status-inner-collections' end From 0d9c607b14df005debcf20e3a33a76630d96d66f Mon Sep 17 00:00:00 2001 From: Justin Coyne Date: Mon, 29 Apr 2024 11:05:41 -0500 Subject: [PATCH 2/2] Drop ruby 3.1 and add 3.3 We are running prod on 3.2 --- .github/workflows/ruby.yml | 48 +++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 4787862f5..0ac97531d 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -2,35 +2,35 @@ name: CI on: push: - branches: [ master ] + branches: [master] pull_request: - branches: [ master ] + branches: [master] jobs: tests: runs-on: ubuntu-latest strategy: matrix: - ruby: ['3.1', '3.2'] + ruby: ["3.2", "3.3"] steps: - - uses: actions/checkout@v3 - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby }} - - uses: actions/cache@v3 - with: - path: vendor/bundle - key: ${{ runner.os }}-gems-202103-${{ hashFiles('**/Gemfile.lock') }} - restore-keys: | - ${{ runner.os }}-gems-202103 - - name: Bundle install - run: bundle config path vendor/bundle - - name: Use sidekiq pro - env: - BUNDLE_GEMS__CONTRIBSYS__COM: ${{ secrets.BUNDLE_GEMS__CONTRIBSYS__COM }} - run: bundle config --local gems.contribsys.com ${BUNDLE_GEMS__CONTRIBSYS__COM} - - name: Install dependencies - run: bin/setup && bin/rails db:test:prepare - - name: Run tests - run: bundle exec rake + - uses: actions/checkout@v3 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + - uses: actions/cache@v3 + with: + path: vendor/bundle + key: ${{ runner.os }}-gems-202103-${{ hashFiles('**/Gemfile.lock') }} + restore-keys: | + ${{ runner.os }}-gems-202103 + - name: Bundle install + run: bundle config path vendor/bundle + - name: Use sidekiq pro + env: + BUNDLE_GEMS__CONTRIBSYS__COM: ${{ secrets.BUNDLE_GEMS__CONTRIBSYS__COM }} + run: bundle config --local gems.contribsys.com ${BUNDLE_GEMS__CONTRIBSYS__COM} + - name: Install dependencies + run: bin/setup && bin/rails db:test:prepare + - name: Run tests + run: bundle exec rake