From 6175994d1b8c30df8310063da864159a97b08634 Mon Sep 17 00:00:00 2001 From: Mike Korcynski Date: Mon, 26 Jun 2023 11:59:57 -0400 Subject: [PATCH 1/5] loosen hyrax requirements to allow hyrax 3 --- tufts-curation.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tufts-curation.gemspec b/tufts-curation.gemspec index bd7157d..a453933 100644 --- a/tufts-curation.gemspec +++ b/tufts-curation.gemspec @@ -21,7 +21,7 @@ Gem::Specification.new do |gem| gem.add_dependency 'activerecord' gem.add_dependency 'activesupport' gem.add_dependency 'active-fedora', '>= 11.5', '<= 12.99' - gem.add_dependency 'hyrax', '>= 2.1.0', '<= 2.9.9' + gem.add_dependency 'hyrax', '>= 2.1.0', '< 4444' gem.add_dependency 'chronic' gem.add_development_dependency 'yard', '~> 0.9' gem.add_development_dependency 'bixby', '~> 1.0' From e583ad7cb6115941c6aa5ae6164d627b1cf1ca59 Mon Sep 17 00:00:00 2001 From: Mike Korcynski Date: Mon, 26 Jun 2023 12:19:41 -0400 Subject: [PATCH 2/5] test against ruby 3 expermentally --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7ebc83b..2f3f101 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,10 +36,10 @@ jobs: strategy: fail-fast: false matrix: - ruby-version: ['2.6'] + ruby-version: ['2.7'] experimental: [false] include: - - ruby-version: 2.7 + - ruby-version: 3.0 experimental: true steps: From e1a881ffb423d54ebea18a1fd64d6e398dafa22e Mon Sep 17 00:00:00 2001 From: Mike Korcynski Date: Tue, 27 Jun 2023 10:06:27 -0400 Subject: [PATCH 3/5] allow ruby 3 --- tufts-curation.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tufts-curation.gemspec b/tufts-curation.gemspec index a453933..8b2d9c0 100644 --- a/tufts-curation.gemspec +++ b/tufts-curation.gemspec @@ -16,7 +16,7 @@ Gem::Specification.new do |gem| Dir.glob('lib/**/*.rb') gem.require_paths = %w[lib] - gem.required_ruby_version = '>= 2.3.4' + gem.required_ruby_version = '>= 2.3.4', '< 4.0' gem.add_dependency 'activerecord' gem.add_dependency 'activesupport' From 95951996ae2814f330eada8850acf95e1a0014fa Mon Sep 17 00:00:00 2001 From: Mike Korcynski Date: Tue, 27 Jun 2023 10:11:45 -0400 Subject: [PATCH 4/5] more restrictive hyrax --- tufts-curation.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tufts-curation.gemspec b/tufts-curation.gemspec index 8b2d9c0..9630c81 100644 --- a/tufts-curation.gemspec +++ b/tufts-curation.gemspec @@ -21,7 +21,7 @@ Gem::Specification.new do |gem| gem.add_dependency 'activerecord' gem.add_dependency 'activesupport' gem.add_dependency 'active-fedora', '>= 11.5', '<= 12.99' - gem.add_dependency 'hyrax', '>= 2.1.0', '< 4444' + gem.add_dependency 'hyrax', '>= 2.1.0', '< 4' gem.add_dependency 'chronic' gem.add_development_dependency 'yard', '~> 0.9' gem.add_development_dependency 'bixby', '~> 1.0' From a2ac3be602d006b1a635f659e1c4744f3b7fea9c Mon Sep 17 00:00:00 2001 From: Mike Korcynski Date: Thu, 24 Oct 2024 09:44:46 -0400 Subject: [PATCH 5/5] Indexing identifier (#19) Allow the indexer to record the indexing application --- lib/tufts/curation/indexer.rb | 4 ++++ lib/tufts/curation/indexing_identifier.rb | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 lib/tufts/curation/indexing_identifier.rb diff --git a/lib/tufts/curation/indexer.rb b/lib/tufts/curation/indexer.rb index 082d2aa..b4173a9 100644 --- a/lib/tufts/curation/indexer.rb +++ b/lib/tufts/curation/indexer.rb @@ -37,6 +37,10 @@ class Indexer < Hyrax::WorkIndexer def generate_solr_document super.tap do |solr_doc| + # record the indexing app name so we know who indexed this object + identifier = Tufts::Curation::IndexerIdentifier.new + solr_doc['indexing_app_tesim'] = identifier.identify + solr_doc['pub_date_facet_isim'] = date_facet index_sort_fields solr_doc create_facets solr_doc diff --git a/lib/tufts/curation/indexing_identifier.rb b/lib/tufts/curation/indexing_identifier.rb new file mode 100644 index 0000000..34d9eec --- /dev/null +++ b/lib/tufts/curation/indexing_identifier.rb @@ -0,0 +1,21 @@ +module Tufts + module Curation + class IndexerIdentifier + # Allow for global configuration + class << self + attr_accessor :configured_app_name + end + + attr_accessor :app_name + + def initialize(app_name = nil) + # Use the provided name, or fall back to the configured name, or the default + @app_name = app_name || self.class.configured_app_name || 'default_app' + end + + def identify + @app_name + end + end + end +end