hyrax 5.0.5 → 5.1.0.pre.beta1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.dassie/Gemfile +11 -12
- data/.dassie/bin/rails +0 -5
- data/.dassie/bin/rake +0 -5
- data/.dassie/config/application.rb +2 -1
- data/.dassie/config/environments/development.rb +1 -1
- data/.dassie/config/environments/production.rb +4 -2
- data/.dassie/config/environments/test.rb +1 -1
- data/.dassie/config/initializers/riiif.rb +20 -18
- data/.dassie/db/schema.rb +109 -110
- data/.github/workflows/lint-build-test.yml +1 -1
- data/.koppie/Gemfile +10 -11
- data/.koppie/bin/rails +0 -5
- data/.koppie/bin/rake +0 -5
- data/.koppie/config/application.rb +2 -1
- data/.koppie/config/environments/development.rb +1 -1
- data/.koppie/config/environments/production.rb +4 -2
- data/.koppie/config/environments/test.rb +1 -1
- data/.koppie/config/initializers/hyrax.rb +20 -17
- data/.koppie/config/initializers/riiif.rb +21 -18
- data/Dockerfile +7 -6
- data/Gemfile +0 -1
- data/app/actors/hyrax/actors/add_to_work_actor.rb +1 -1
- data/app/actors/hyrax/actors/apply_order_actor.rb +1 -1
- data/app/assets/stylesheets/hyrax/_tinymce.scss +6 -0
- data/app/controllers/concerns/hyrax/valkyrie_downloads_controller_behavior.rb +0 -1
- data/app/controllers/concerns/hyrax/works_controller_behavior.rb +1 -0
- data/app/controllers/hyrax/admin/analytics/work_reports_controller.rb +4 -4
- data/app/controllers/hyrax/admin/permission_template_accesses_controller.rb +4 -4
- data/app/controllers/hyrax/api/zotero_controller.rb +1 -1
- data/app/jobs/migrate_files_to_valkyrie_job.rb +21 -33
- data/app/models/admin_set.rb +2 -2
- data/app/models/concerns/hyrax/permissions/writable.rb +1 -2
- data/app/models/concerns/hyrax/solr_document_behavior.rb +2 -5
- data/app/models/concerns/hyrax/valkyrie_lazy_migration.rb +1 -0
- data/app/models/hyrax/collection_type.rb +4 -4
- data/app/models/hyrax/file_metadata.rb +7 -22
- data/app/models/single_use_link.rb +1 -1
- data/app/services/hyrax/analytics/ga4/base.rb +1 -1
- data/app/services/hyrax/analytics/ga4.rb +1 -5
- data/app/services/hyrax/listeners.rb +1 -0
- data/app/services/hyrax/statistics/term_query.rb +1 -1
- data/app/services/hyrax/workflow.rb +8 -0
- data/app/services/migrate_resource_service.rb +1 -1
- data/app/validators/hyrax/has_one_title_validator.rb +1 -1
- data/app/views/hyrax/admin/analytics/collection_reports/_top_collections.html.erb +7 -3
- data/app/views/hyrax/admin/analytics/work_reports/_top_file_set_downloads.html.erb +6 -3
- data/app/views/hyrax/admin/analytics/work_reports/_top_works.html.erb +3 -2
- data/app/views/hyrax/admin/analytics/work_reports/_work_files.html.erb +6 -1
- data/chart/hyrax/Chart.yaml +1 -1
- data/config/initializers/1_healthz.rb +2 -1
- data/config/initializers/ar_test_fixture_monkey_patch.rb +8 -0
- data/config/initializers/arel_rails_7_2_monkey_patch.rb +6 -0
- data/config/initializers/indexing_adapter_initializer.rb +0 -4
- data/config/initializers/listeners.rb +4 -2
- data/config/initializers/new_framework_defaults_7_2.rb +8 -0
- data/config/metadata/core_metadata.yaml +0 -1
- data/docker-compose-dassie.yml +4 -4
- data/docker-compose-sirenia.yml +1 -1
- data/documentation/developing-your-hyrax-based-app.md +6 -6
- data/hyrax.gemspec +8 -8
- data/lib/freyja/persister.rb +4 -11
- data/lib/generators/hyrax/config_generator.rb +0 -5
- data/lib/generators/hyrax/install_generator.rb +1 -1
- data/lib/generators/hyrax/templates/config/initializers/riiif.rb +21 -19
- data/lib/hyrax/configuration.rb +8 -22
- data/lib/hyrax/controlled_vocabulary/importer/language.rb +1 -1
- data/lib/hyrax/engine.rb +15 -10
- data/lib/hyrax/transactions/steps/add_file_sets.rb +1 -2
- data/lib/hyrax/version.rb +1 -1
- data/lib/hyrax.rb +4 -1
- data/template.rb +6 -1
- metadata +40 -43
- data/.dassie/bin/spring +0 -17
- data/.dassie/config/initializers/mini_magick.rb +0 -6
- data/.dassie/config/spring.rb +0 -6
- data/.koppie/bin/spring +0 -17
- data/.koppie/config/initializers/mini_magick.rb +0 -6
- data/.koppie/config/spring.rb +0 -6
- data/app/jobs/concerns/hyrax/queued_job_behavior.rb +0 -22
- data/app/jobs/hyrax/queued_delete_job.rb +0 -11
- data/app/jobs/hyrax/queued_indexing_job.rb +0 -11
- data/app/jobs/migrate_sipity_entity_job.rb +0 -21
- data/config/initializers/reform_rails_6_1_monkey_patch.rb +0 -27
- data/lib/generators/hyrax/templates/config/initializers/mini_magick.rb +0 -6
- data/lib/valkyrie/indexing/redis_queue/indexing_adapter.rb +0 -142
data/chart/hyrax/Chart.yaml
CHANGED
@@ -2,8 +2,10 @@
|
|
2
2
|
|
3
3
|
Hyrax.publisher.subscribe(Hyrax::Listeners::ActiveFedoraACLIndexListener.new) unless Hyrax.config.disable_wings
|
4
4
|
|
5
|
-
|
6
|
-
Hyrax.publisher.
|
5
|
+
Rails.application.reloader.to_prepare do
|
6
|
+
Hyrax.publisher.default_listeners.each do |listener|
|
7
|
+
Hyrax.publisher.subscribe(listener)
|
8
|
+
end
|
7
9
|
end
|
8
10
|
|
9
11
|
# Publish events from old style Hyrax::Callbacks to trigger the listeners
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Any options set here are to override Rails 7.2 configuration defaults
|
4
|
+
|
5
|
+
# These fix a couple of issues arising from Rails 7.2 enforcement of HTML5 semantics
|
6
|
+
# by default when using certain Rails methods
|
7
|
+
Rails.application.config.action_view.button_to_generates_button_tag = false
|
8
|
+
Rails.application.config.action_view.sanitizer_vendor = Rails::HTML4::Sanitizer
|
data/docker-compose-dassie.yml
CHANGED
@@ -68,14 +68,14 @@ services:
|
|
68
68
|
chrome:
|
69
69
|
image: selenium/standalone-chromium:4
|
70
70
|
environment:
|
71
|
-
|
71
|
+
# - START_XVFB=false
|
72
72
|
- SE_NODE_SESSION_TIMEOUT=800
|
73
73
|
- SE_ENABLE_TRACING=false
|
74
74
|
- SE_ENABLE_BROWSER_LEFTOVERS_CLEANUP=true
|
75
75
|
- SE_BROWSER_ARGS_DISABLE_DSHM=--disable-dev-shm-usage
|
76
76
|
- SE_BROWSER_ARGS_HEADLESS=--headless=new
|
77
|
-
|
78
|
-
|
77
|
+
# logging:
|
78
|
+
# driver: none
|
79
79
|
volumes:
|
80
80
|
- /dev/shm:/dev/shm
|
81
81
|
shm_size: 2g
|
@@ -118,7 +118,7 @@ services:
|
|
118
118
|
memcached:
|
119
119
|
image: bitnami/memcached
|
120
120
|
ports:
|
121
|
-
-
|
121
|
+
- '11211:11211'
|
122
122
|
networks:
|
123
123
|
- hyrax
|
124
124
|
|
data/docker-compose-sirenia.yml
CHANGED
@@ -32,7 +32,7 @@ You can also try [Running Hyrax-based application in local VM](https://github.co
|
|
32
32
|
During development, running only the dependent services in a container environment may be beneficial. This avoids potential headaches concerning file permissions and eases the use of debugging tools. The application generation instructions below use [Lando](https://lando.dev) to achieve this setup.
|
33
33
|
|
34
34
|
This document contains instructions specific to setting up an app with __Hyrax
|
35
|
-
v5.0.
|
35
|
+
v5.1.0-beta1__. If you are looking for instructions on installing a different
|
36
36
|
version, be sure to select the appropriate branch or tag from the drop-down
|
37
37
|
menu above.
|
38
38
|
|
@@ -46,7 +46,7 @@ Prerequisites are required for both creating a Hyrax\-based app and contributing
|
|
46
46
|
Hyrax requires the following software to work:
|
47
47
|
|
48
48
|
1. [Solr](http://lucene.apache.org/solr/) version >= 5.x (tested up to 8.11.1, which includes the log4j library update)
|
49
|
-
1. [Fedora Commons](http://www.fedora-commons.org/) digital repository version >= 4.7.6 (if
|
49
|
+
1. [Fedora Commons](http://www.fedora-commons.org/) digital repository version >= 4.7.6 && < 5 (if using legacy ActiveFedora) or >= 6.5.1 (if using the Valkyrie Fedora adapter)
|
50
50
|
1. A SQL RDBMS ([PostgreSQL](https://www.postgresql.org) recommended)
|
51
51
|
1. [Redis](http://redis.io/), a key-value store
|
52
52
|
1. [ImageMagick](http://www.imagemagick.org/) with JPEG-2000 support
|
@@ -102,7 +102,7 @@ Once ffmpeg has been installed, enable transcoding by setting `config.enable_ffm
|
|
102
102
|
|
103
103
|
First, you'll need a working Ruby installation. You can install this via your operating system's package manager -- you are likely to get farther with OSX, Linux, or UNIX than Windows but your mileage may vary -- but we recommend using a Ruby version manager such as [RVM](https://rvm.io/) or [rbenv](https://github.com/sstephenson/rbenv).
|
104
104
|
|
105
|
-
Hyrax supports Ruby 3.
|
105
|
+
Hyrax supports Ruby 3.3. When starting a new project, we recommend using the latest Ruby 3.3 version.
|
106
106
|
|
107
107
|
## Redis
|
108
108
|
|
@@ -112,11 +112,11 @@ Starting up Redis will depend on your operating system, and may in fact already
|
|
112
112
|
|
113
113
|
## Rails
|
114
114
|
|
115
|
-
Hyrax requires Rails
|
115
|
+
Hyrax requires Rails 7. We recommend the latest Rails 7.2 release.
|
116
116
|
|
117
117
|
```
|
118
118
|
# If you don't already have Rails at your disposal...
|
119
|
-
gem install rails -v
|
119
|
+
gem install rails -v 7.2.2.1
|
120
120
|
```
|
121
121
|
|
122
122
|
### JavaScript runtime
|
@@ -148,7 +148,7 @@ Generate a new Rails application using the template.
|
|
148
148
|
**NOTE:** `HYRAX_SKIP_WINGS` is needed here to avoid loading the Wings compatibility layer during the application generation process.
|
149
149
|
|
150
150
|
```shell
|
151
|
-
HYRAX_SKIP_WINGS=true rails
|
151
|
+
HYRAX_SKIP_WINGS=true rails _7.2.2.1_ new my_app --database=postgresql -m https://raw.githubusercontent.com/samvera/hyrax/hyrax-v5.1.0-beta1/template.rb
|
152
152
|
```
|
153
153
|
|
154
154
|
Generating a new Rails application using Hyrax's template above takes cares of a number of steps for you, including:
|
data/hyrax.gemspec
CHANGED
@@ -32,9 +32,9 @@ SUMMARY
|
|
32
32
|
# NOTE: rails does not follow sem-ver conventions, it's
|
33
33
|
# minor version releases can include breaking changes; see
|
34
34
|
# http://guides.rubyonrails.org/maintenance_policy.html
|
35
|
-
spec.add_dependency 'rails', '~>
|
35
|
+
spec.add_dependency 'rails', '~> 7.2', '< 8.0'
|
36
36
|
|
37
|
-
spec.add_dependency 'active-fedora', '~>
|
37
|
+
spec.add_dependency 'active-fedora', '~> 15.0'
|
38
38
|
spec.add_dependency 'almond-rails', '~> 0.1'
|
39
39
|
spec.add_dependency 'awesome_nested_set', '~> 3.1'
|
40
40
|
spec.add_dependency 'blacklight', '~> 7.29'
|
@@ -56,22 +56,22 @@ SUMMARY
|
|
56
56
|
spec.add_dependency 'flot-rails', '~> 0.0.6'
|
57
57
|
spec.add_dependency 'font-awesome-rails', '~> 4.2'
|
58
58
|
spec.add_dependency 'google-analytics-data', '~> 0.6'
|
59
|
-
spec.add_dependency 'hydra-derivatives', '~>
|
60
|
-
spec.add_dependency 'hydra-editor', '~>
|
59
|
+
spec.add_dependency 'hydra-derivatives', '~> 4.0'
|
60
|
+
spec.add_dependency 'hydra-editor', '~> 7.0'
|
61
61
|
spec.add_dependency 'hydra-file_characterization', '~> 1.1'
|
62
|
-
spec.add_dependency 'hydra-head', '~>
|
62
|
+
spec.add_dependency 'hydra-head', '~> 13.0'
|
63
63
|
spec.add_dependency 'hydra-works', '>= 0.16'
|
64
64
|
spec.add_dependency 'iiif_manifest', '>= 0.3', '< 2.0'
|
65
65
|
spec.add_dependency 'json-schema' # for Arkivo
|
66
66
|
spec.add_dependency 'legato', '~> 0.3'
|
67
67
|
spec.add_dependency 'linkeddata' # Required for getting values from geonames
|
68
|
+
spec.add_dependency 'listen', '~> 3.9'
|
68
69
|
spec.add_dependency 'mailboxer', '~> 0.12'
|
69
70
|
spec.add_dependency 'nest', '~> 3.1'
|
70
71
|
spec.add_dependency 'noid-rails', '~> 3.0'
|
71
72
|
spec.add_dependency 'oauth'
|
72
73
|
spec.add_dependency 'oauth2', '~> 1.2'
|
73
74
|
spec.add_dependency 'openseadragon', '~> 0.9'
|
74
|
-
spec.add_dependency 'posix-spawn'
|
75
75
|
spec.add_dependency 'qa', '~> 5.5', '>= 5.5.1' # questioning_authority
|
76
76
|
spec.add_dependency 'rails_autolink', '~> 1.1'
|
77
77
|
spec.add_dependency 'rdf-rdfxml' # controlled vocabulary importer
|
@@ -92,7 +92,7 @@ SUMMARY
|
|
92
92
|
|
93
93
|
spec.add_development_dependency "capybara", '~> 3.29'
|
94
94
|
spec.add_development_dependency 'capybara-screenshot', '~> 1.0'
|
95
|
-
spec.add_development_dependency 'database_cleaner', '
|
95
|
+
spec.add_development_dependency 'database_cleaner', '>= 1.3'
|
96
96
|
spec.add_development_dependency "equivalent-xml", '~> 0.5'
|
97
97
|
spec.add_development_dependency "factory_bot", '~> 4.4'
|
98
98
|
spec.add_development_dependency 'mida', '~> 0.3'
|
@@ -100,7 +100,7 @@ SUMMARY
|
|
100
100
|
spec.add_development_dependency 'pg', '~> 1.2'
|
101
101
|
spec.add_development_dependency 'rspec-activemodel-mocks', '~> 1.0'
|
102
102
|
spec.add_development_dependency 'rspec-its', '~> 1.1'
|
103
|
-
spec.add_development_dependency 'rspec-rails', '~>
|
103
|
+
spec.add_development_dependency 'rspec-rails', '~> 7.0'
|
104
104
|
spec.add_development_dependency 'rspec_junit_formatter'
|
105
105
|
spec.add_development_dependency "selenium-webdriver", '~> 4.4'
|
106
106
|
spec.add_development_dependency 'i18n-debug'
|
data/lib/freyja/persister.rb
CHANGED
@@ -13,7 +13,6 @@ module Freyja
|
|
13
13
|
# was modified in the database between been read into memory and persisted
|
14
14
|
# rubocop:disable Lint/UnusedMethodArgument
|
15
15
|
def save(resource:, external_resource: false, perform_af_validation: false)
|
16
|
-
was_wings = resource.respond_to?(:wings?) && resource.wings?
|
17
16
|
orm_object = resource_factory.from_resource(resource: resource)
|
18
17
|
orm_object.transaction do
|
19
18
|
orm_object.save!
|
@@ -24,24 +23,18 @@ module Freyja
|
|
24
23
|
"Called from #{Gem.location_of_caller.join(':')}"
|
25
24
|
end
|
26
25
|
end
|
27
|
-
convert_and_migrate_resource(orm_object
|
26
|
+
convert_and_migrate_resource(orm_object)
|
28
27
|
|
29
28
|
rescue ActiveRecord::StaleObjectError
|
30
29
|
raise Valkyrie::Persistence::StaleObjectError, "The object #{resource.id} has been updated by another process."
|
31
30
|
end
|
32
31
|
# rubocop:enable Lint/UnusedMethodArgument
|
33
32
|
|
34
|
-
def convert_and_migrate_resource(orm_object
|
33
|
+
def convert_and_migrate_resource(orm_object)
|
35
34
|
new_resource = resource_factory.to_resource(object: orm_object)
|
36
|
-
|
37
|
-
if Hyrax.config.valkyrie_transition? && was_wings && !new_resource.wings?
|
35
|
+
if Hyrax.config.valkyrie_transition?
|
38
36
|
MigrateFilesToValkyrieJob.perform_later(new_resource) if new_resource.is_a?(Hyrax::FileSet) && new_resource.file_ids.size == 1 && new_resource.file_ids.first.id.to_s.match('/files/')
|
39
|
-
|
40
|
-
if new_resource.is_a?(Hyrax::Work)
|
41
|
-
member_ids = new_resource.member_ids.map(&:to_s)
|
42
|
-
MigrateResourcesJob.perform_later(ids: member_ids) unless member_ids.empty?
|
43
|
-
MigrateSipityEntityJob.perform_now(id: new_resource.id.to_s)
|
44
|
-
end
|
37
|
+
MigrateResourcesJob.perform_later(ids: new_resource.member_ids.map(&:to_s)) if new_resource.is_a?(Hyrax::Work)
|
45
38
|
end
|
46
39
|
new_resource
|
47
40
|
end
|
@@ -59,11 +59,6 @@ class Hyrax::ConfigGenerator < Rails::Generators::Base
|
|
59
59
|
copy_file 'config/initializers/hyrax.rb'
|
60
60
|
end
|
61
61
|
|
62
|
-
# Add mini-magick configuration
|
63
|
-
def minimagick_config
|
64
|
-
copy_file 'config/initializers/mini_magick.rb'
|
65
|
-
end
|
66
|
-
|
67
62
|
def tinymce_config
|
68
63
|
copy_file 'config/tinymce.yml'
|
69
64
|
end
|
@@ -188,7 +188,7 @@ module Hyrax
|
|
188
188
|
generate 'hyrax:riiif' unless options[:'skip-riiif']
|
189
189
|
end
|
190
190
|
|
191
|
-
def
|
191
|
+
def insert_application_config
|
192
192
|
insert_into_file 'config/application.rb', after: /config\.load_defaults [0-9.]+$/ do
|
193
193
|
"\n config.active_job.queue_adapter = ENV.fetch('HYRAX_ACTIVE_JOB_QUEUE') { 'async' }.to_sym\n"
|
194
194
|
end
|
@@ -29,35 +29,37 @@ Rails.application.reloader.to_prepare do
|
|
29
29
|
Riiif.not_found_image = Rails.root.join('app', 'assets', 'images', 'us_404.svg')
|
30
30
|
Riiif.unauthorized_image = Rails.root.join('app', 'assets', 'images', 'us_404.svg')
|
31
31
|
|
32
|
-
Riiif::Engine.config.cache_duration = 1.
|
32
|
+
Riiif::Engine.config.cache_duration = 1.day
|
33
33
|
end
|
34
34
|
|
35
35
|
module Hyrax
|
36
36
|
# Adds file locking to Riiif::File
|
37
37
|
# @see RiiifFileResolver
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
38
|
+
Rails.application.reloader.to_prepare do
|
39
|
+
class RiiifFile < Riiif::File
|
40
|
+
include ActiveSupport::Benchmarkable
|
41
|
+
|
42
|
+
attr_reader :id
|
43
|
+
def initialize(input_path, tempfile = nil, id:)
|
44
|
+
super(input_path, tempfile)
|
45
|
+
raise(ArgumentError, "must specify id") if id.blank?
|
46
|
+
@id = id
|
47
|
+
end
|
47
48
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
49
|
+
# Wrap extract in a read lock and benchmark it
|
50
|
+
def extract(transformation, image_info = nil)
|
51
|
+
Riiif::Image.file_resolver.file_locks[id].with_read_lock do
|
52
|
+
benchmark "RiiifFile extracted #{path} with #{transformation.to_params}", level: :debug do
|
53
|
+
super
|
54
|
+
end
|
53
55
|
end
|
54
56
|
end
|
55
|
-
end
|
56
57
|
|
57
|
-
|
58
|
+
private
|
58
59
|
|
59
|
-
|
60
|
-
|
60
|
+
def logger
|
61
|
+
Hyrax.logger
|
62
|
+
end
|
61
63
|
end
|
62
64
|
end
|
63
65
|
|
data/lib/hyrax/configuration.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
require 'hyrax/callbacks'
|
2
3
|
require 'hyrax/role_registry'
|
3
4
|
|
4
5
|
module Hyrax
|
@@ -132,23 +133,8 @@ module Hyrax
|
|
132
133
|
attr_writer :analytics_reporting
|
133
134
|
attr_reader :analytics_reporting
|
134
135
|
def analytics_reporting?
|
135
|
-
@analytics_reporting ||=
|
136
|
-
required_env_vars = %w[
|
137
|
-
HYRAX_ANALYTICS_REPORTING
|
138
|
-
GOOGLE_ANALYTICS_ID
|
139
|
-
GOOGLE_ANALYTICS_PROPERTY_ID
|
140
|
-
]
|
141
|
-
|
142
|
-
required_env_vars << if ENV['GOOGLE_ACCOUNT_JSON'].blank?
|
143
|
-
'GOOGLE_ACCOUNT_JSON_PATH'
|
144
|
-
else
|
145
|
-
'GOOGLE_ACCOUNT_JSON'
|
146
|
-
end
|
147
|
-
|
148
|
-
return false if required_env_vars.any? { |var| ENV.fetch(var, '').blank? }
|
149
|
-
|
136
|
+
@analytics_reporting ||=
|
150
137
|
ActiveModel::Type::Boolean.new.cast(ENV.fetch('HYRAX_ANALYTICS_REPORTING', false))
|
151
|
-
end
|
152
138
|
end
|
153
139
|
|
154
140
|
# Currently supports 'google' or 'matomo'
|
@@ -156,7 +142,7 @@ module Hyrax
|
|
156
142
|
attr_writer :analytics_provider
|
157
143
|
def analytics_provider
|
158
144
|
@analytics_provider ||=
|
159
|
-
ENV.fetch('HYRAX_ANALYTICS_PROVIDER', '
|
145
|
+
ENV.fetch('HYRAX_ANALYTICS_PROVIDER', 'google')
|
160
146
|
end
|
161
147
|
|
162
148
|
##
|
@@ -492,31 +478,31 @@ module Hyrax
|
|
492
478
|
# Path on the local file system where derivatives will be stored
|
493
479
|
attr_writer :derivatives_path
|
494
480
|
def derivatives_path
|
495
|
-
@derivatives_path ||=
|
481
|
+
@derivatives_path ||= ENV.fetch('HYRAX_DERIVATIVES_PATH', Rails.root.join('tmp', 'derivatives'))
|
496
482
|
end
|
497
483
|
|
498
484
|
# Path on the local file system where originals will be staged before being ingested into Fedora.
|
499
485
|
attr_writer :working_path
|
500
486
|
def working_path
|
501
|
-
@working_path ||=
|
487
|
+
@working_path ||= ENV.fetch('HYRAX_UPLOAD_PATH', Rails.root.join('tmp', 'uploads'))
|
502
488
|
end
|
503
489
|
|
504
490
|
# @todo do we use both upload_path and working path?
|
505
491
|
# Path on the local file system where originals will be staged before being ingested into Fedora.
|
506
492
|
attr_writer :upload_path
|
507
493
|
def upload_path
|
508
|
-
@upload_path ||= ->() {
|
494
|
+
@upload_path ||= ->() { ENV.fetch('HYRAX_UPLOAD_PATH') { Rails.root.join('tmp', 'uploads') } }
|
509
495
|
end
|
510
496
|
|
511
497
|
attr_writer :cache_path
|
512
498
|
def cache_path
|
513
|
-
@cache_path ||= ->() {
|
499
|
+
@cache_path ||= ->() { ENV.fetch('HYRAX_CACHE_PATH') { Rails.root.join('tmp', 'cache') } }
|
514
500
|
end
|
515
501
|
|
516
502
|
# Path on the local file system where where log and banners will be stored.
|
517
503
|
attr_writer :branding_path
|
518
504
|
def branding_path
|
519
|
-
@branding_path ||=
|
505
|
+
@branding_path ||= ENV.fetch('HYRAX_BRANDING_PATH', Rails.root.join('public', 'branding'))
|
520
506
|
end
|
521
507
|
|
522
508
|
# @!endgroup
|
@@ -13,7 +13,7 @@ module Hyrax
|
|
13
13
|
stdout_logger.formatter = proc do |_severity, _datetime, _progname, msg|
|
14
14
|
"#{msg}\n"
|
15
15
|
end
|
16
|
-
|
16
|
+
ActiveSupport::BroadcastLogger.new(Hyrax.logger, stdout_logger)
|
17
17
|
end
|
18
18
|
|
19
19
|
def import
|
data/lib/hyrax/engine.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
module Hyrax
|
3
|
-
class Engine < ::Rails::Engine
|
3
|
+
class Engine < ::Rails::Engine # rubocop:disable Metrics/ClassLength
|
4
4
|
isolate_namespace Hyrax
|
5
5
|
|
6
6
|
require 'almond-rails'
|
@@ -60,12 +60,15 @@ module Hyrax
|
|
60
60
|
# raises PG::ConnectionBad. There's no good common ancestor to assume. That's why this test
|
61
61
|
# is in its own tiny chunk of code – so we know that whatever the StandardError is, it's coming
|
62
62
|
# from the attempt to connect.
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
63
|
+
#
|
64
|
+
# (Some time later...) Simply accessing the connection obj is not raising PG::ConnectionBad,
|
65
|
+
# so let's call active? too.
|
66
|
+
can_connect =
|
67
|
+
begin
|
68
|
+
ActiveRecord::Base.connection.active?
|
69
|
+
rescue StandardError
|
70
|
+
false
|
71
|
+
end
|
69
72
|
|
70
73
|
can_persist = can_connect && begin
|
71
74
|
Hyrax.config.persist_registered_roles!
|
@@ -88,9 +91,11 @@ module Hyrax
|
|
88
91
|
end
|
89
92
|
|
90
93
|
initializer 'requires' do
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
+
ActiveSupport::Reloader.to_prepare do
|
95
|
+
require 'wings' unless Hyrax.config.disable_wings
|
96
|
+
require 'freyja' unless Hyrax.config.disable_freyja
|
97
|
+
require 'frigg' unless Hyrax.config.disable_frigg
|
98
|
+
end
|
94
99
|
end
|
95
100
|
|
96
101
|
initializer 'routing' do
|
@@ -20,11 +20,10 @@ module Hyrax
|
|
20
20
|
##
|
21
21
|
# @param [Hyrax::Work] obj
|
22
22
|
# @param [Enumerable<UploadedFile>] uploaded_files
|
23
|
-
# @param [Enumerable<Hash>] file_set_params
|
23
|
+
# @param [Enumerable<Hash>] file_set_params
|
24
24
|
#
|
25
25
|
# @return [Dry::Monads::Result]
|
26
26
|
def call(obj, uploaded_files: [], file_set_params: [])
|
27
|
-
return Success(obj) if uploaded_files.empty? && file_set_params.blank? # Skip if no files to attach
|
28
27
|
if @handler.new(work: obj).add(files: uploaded_files, file_set_params: file_set_params).attach
|
29
28
|
file_sets = obj.member_ids.map do |member|
|
30
29
|
Hyrax.query_service.find_by(id: member) if Hyrax.query_service.find_by(id: member).is_a? Hyrax::FileSet
|
data/lib/hyrax/version.rb
CHANGED
data/lib/hyrax.rb
CHANGED
@@ -23,7 +23,6 @@ require 'hyrax/valkyrie_can_can_adapter'
|
|
23
23
|
require 'retriable'
|
24
24
|
require 'valkyrie/indexing_adapter'
|
25
25
|
require 'valkyrie/indexing/solr/indexing_adapter'
|
26
|
-
require 'valkyrie/indexing/redis_queue/indexing_adapter'
|
27
26
|
require 'valkyrie/indexing/null_indexing_adapter'
|
28
27
|
|
29
28
|
##
|
@@ -47,6 +46,10 @@ module Hyrax
|
|
47
46
|
autoload :ResourceSync
|
48
47
|
autoload :Zotero
|
49
48
|
autoload :Listeners
|
49
|
+
autoload :Workflow
|
50
|
+
autoload :SimpleSchemaLoader
|
51
|
+
autoload :VirusScanner
|
52
|
+
autoload :DerivativeBucketedStorage
|
50
53
|
end
|
51
54
|
|
52
55
|
##
|
data/template.rb
CHANGED
@@ -1,4 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
2
|
+
|
3
|
+
insert_into_file 'config/application.rb', after: /config\.load_defaults [0-9.]+$/ do
|
4
|
+
"\n config.add_autoload_paths_to_load_path = true"
|
5
|
+
end
|
6
|
+
|
7
|
+
gem 'hyrax', '5.1.0-beta1'
|
3
8
|
run 'bundle install'
|
4
9
|
generate 'hyrax:install', '-f'
|