From 9409806826bf7940a86f2a1c24096892b1eb8c24 Mon Sep 17 00:00:00 2001 From: Jeremy Friesen Date: Wed, 4 Oct 2023 15:00:10 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20Appease=20Rubocop?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Related to: - https://github.com/scientist-softserv/adventist-dl/issues/538 --- Gemfile | 2 ++ app/forms/hyrax/form_terms_decorator.rb | 2 +- .../hyrax/collection_presenter_decorator.rb | 2 +- .../hyrax/generic_work_presenter_decorator.rb | 11 ++++++++++- lib/tasks/assets.rake | 2 +- spec/factories/works.rb | 1 + 6 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index 19da7320..43c274d0 100644 --- a/Gemfile +++ b/Gemfile @@ -12,5 +12,7 @@ gemspec gemfile_path = File.expand_path("hyrax-webapp/Gemfile", __dir__) if File.exist?(gemfile_path) gemfile = File.read(gemfile_path).split("\n").reject { |l| l.match('knapsack') } + # rubocop:disable Security/Eval eval(gemfile.join("\n"), binding) + # rubocop:enable Security/Eval end diff --git a/app/forms/hyrax/form_terms_decorator.rb b/app/forms/hyrax/form_terms_decorator.rb index fc39455a..fe324dc6 100644 --- a/app/forms/hyrax/form_terms_decorator.rb +++ b/app/forms/hyrax/form_terms_decorator.rb @@ -11,6 +11,6 @@ def primary_terms Hyrax::FormTerms.prepend(Hyrax::FormTermsDecorator) # Explicitly prepending to GenericWorkForm and ImageForm since -# .prepend didn’t affect classes that include Hyrax::FormTerms +# .prepend didn't affect classes that include Hyrax::FormTerms Hyrax::GenericWorkForm.prepend(Hyrax::FormTermsDecorator) Hyrax::ImageForm.prepend(Hyrax::FormTermsDecorator) diff --git a/app/presenters/hyrax/collection_presenter_decorator.rb b/app/presenters/hyrax/collection_presenter_decorator.rb index 161b9084..3ed349ca 100644 --- a/app/presenters/hyrax/collection_presenter_decorator.rb +++ b/app/presenters/hyrax/collection_presenter_decorator.rb @@ -17,7 +17,7 @@ def terms_with_values # OVERRIDE HYRAX 3.5.0 to hide identifier line terms = self.class.terms - [:identifier] terms.select { |t| self[t].present? } - end + end end end diff --git a/app/presenters/hyrax/generic_work_presenter_decorator.rb b/app/presenters/hyrax/generic_work_presenter_decorator.rb index 5f84ab84..7484e507 100644 --- a/app/presenters/hyrax/generic_work_presenter_decorator.rb +++ b/app/presenters/hyrax/generic_work_presenter_decorator.rb @@ -8,4 +8,13 @@ # end # end -Hyrax::GenericWorkPresenter.delegate :aark_id, :abstract, :date_issued, :alt, :part_of, :place_of_publication, :remote_url, to: :solr_document +Hyrax::GenericWorkPresenter.delegate( + :aark_id, + :abstract, + :alt, + :date_issued, + :part_of, + :place_of_publication, + :remote_url, + to: :solr_document +) diff --git a/lib/tasks/assets.rake b/lib/tasks/assets.rake index ad917973..16848b17 100644 --- a/lib/tasks/assets.rake +++ b/lib/tasks/assets.rake @@ -9,7 +9,7 @@ namespace :hyku_knapsack do Dir.glob(File.join(HykuKnapsack::Engine.root, 'public', '**')).each do |asset| # skip directories next unless File.file?(asset) - dest_file = File.join(Rails.root, 'public', File.basename(asset)) + dest_file = Rails.root.join('public', File.basename(asset)).to_s FileUtils.copy_file asset, dest_file, true end end diff --git a/spec/factories/works.rb b/spec/factories/works.rb index 7d3b4ac0..285a291e 100755 --- a/spec/factories/works.rb +++ b/spec/factories/works.rb @@ -101,6 +101,7 @@ rights_description { ['some additional stuff about rights'] } source { ['tomato'] } subject { ['Official Heading for Woe'] } + awarding_institution { ['Awarding Institution'] } based_near { ['Sheffield'] } end