hyrax 4.0.0.rc1 → 4.0.0.rc3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +61 -0
  3. data/.dassie/Gemfile +1 -1
  4. data/.dassie/config/initializers/redis_config.rb +8 -1
  5. data/.github/CONTRIBUTING.md +39 -27
  6. data/.koppie/config/initializers/redis_config.rb +8 -1
  7. data/.regen +1 -1
  8. data/CONTAINERS.md +4 -4
  9. data/Dockerfile +1 -1
  10. data/README.md +2 -2
  11. data/app/actors/hyrax/actors/create_with_files_actor.rb +1 -1
  12. data/app/builders/hyrax/bootstrap_breadcrumbs_builder.rb +1 -1
  13. data/app/controllers/concerns/hyrax/controller.rb +2 -1
  14. data/app/controllers/hyrax/admin/strategies_controller.rb +2 -2
  15. data/app/forms/hyrax/forms/administrative_set_form.rb +1 -1
  16. data/app/forms/hyrax/forms/pcdm_collection_form.rb +2 -2
  17. data/app/forms/hyrax/forms/pcdm_object_form.rb +1 -1
  18. data/app/forms/hyrax/forms/permission.rb +2 -2
  19. data/app/forms/hyrax/forms/resource_form.rb +10 -10
  20. data/app/forms/hyrax/forms/work_embargo_form.rb +3 -3
  21. data/app/forms/hyrax/forms/work_lease_form.rb +3 -3
  22. data/app/helpers/hyrax/content_block_helper_behavior.rb +1 -1
  23. data/app/helpers/hyrax/iiif_helper.rb +1 -1
  24. data/app/models/collection_branding_info.rb +7 -13
  25. data/app/models/hyrax/permission_template.rb +1 -1
  26. data/app/presenters/hyrax/iiif_manifest_presenter.rb +1 -1
  27. data/app/presenters/hyrax/presenter_factory.rb +2 -2
  28. data/app/services/hyrax/custom_queries/navigators/find_files.rb +1 -4
  29. data/app/services/hyrax/lock_manager.rb +36 -6
  30. data/app/services/hyrax/solr_service.rb +2 -2
  31. data/app/services/hyrax/visibility_reader.rb +1 -1
  32. data/app/services/hyrax/visibility_writer.rb +1 -1
  33. data/app/services/hyrax/workflow/permission_query.rb +5 -5
  34. data/app/validators/hyrax/collection_membership_validator.rb +2 -2
  35. data/app/views/layouts/hyrax/dashboard.html.erb +1 -1
  36. data/app/views/layouts/hyrax.html.erb +1 -1
  37. data/config/initializers/kaminari_engine_patch.rb +16 -0
  38. data/docker-compose-koppie.yml +0 -1
  39. data/docker-compose.yml +0 -1
  40. data/documentation/legacyREADME.md +3 -3
  41. data/hyrax.gemspec +4 -6
  42. data/lib/generators/hyrax/templates/config/initializers/redis_config.rb +8 -1
  43. data/lib/hyrax/configuration.rb +18 -1
  44. data/lib/hyrax/controlled_vocabularies/resource_label_caching.rb +1 -1
  45. data/lib/hyrax/engine.rb +2 -0
  46. data/lib/hyrax/redis_event_store.rb +21 -13
  47. data/lib/hyrax/transactions/transaction.rb +3 -2
  48. data/lib/hyrax/version.rb +1 -1
  49. data/lib/hyrax.rb +0 -1
  50. data/lib/wings/valkyrie/storage.rb +4 -1
  51. data/template.rb +1 -1
  52. metadata +24 -43
@@ -4,24 +4,54 @@ module Hyrax
4
4
  class LockManager
5
5
  class UnableToAcquireLockError < StandardError; end
6
6
 
7
- attr_reader :client
8
-
7
+ ##
9
8
  # @param [Fixnum] time_to_live How long to hold the lock in milliseconds
10
9
  # @param [Fixnum] retry_count How many times to retry to acquire the lock before raising UnableToAcquireLockError
11
10
  # @param [Fixnum] retry_delay Maximum wait time in milliseconds before retrying. Wait time is a random value between 0 and retry_delay.
12
11
  def initialize(time_to_live, retry_count, retry_delay)
13
12
  @ttl = time_to_live
14
- @client = Redlock::Client.new([Redis.current], retry_count: retry_count, retry_delay: retry_delay)
13
+ @retry_count = retry_count
14
+ @retry_delay = retry_delay
15
15
  end
16
16
 
17
+ ##
17
18
  # Blocks until lock is acquired or timeout.
18
19
  def lock(key)
19
20
  returned_from_block = nil
20
- client.lock(key, @ttl) do |locked|
21
- raise UnableToAcquireLockError unless locked
22
- returned_from_block = yield
21
+
22
+ pool.then do |conn|
23
+ client(conn).lock(key, @ttl) do |locked|
24
+ raise UnableToAcquireLockError unless locked
25
+ returned_from_block = yield
26
+ end
23
27
  end
28
+
24
29
  returned_from_block
30
+ rescue ConnectionPool::TimeoutError => err
31
+ Hyrax.logger.error(err.message)
32
+ raise(ConnectionPool::TimeoutError,
33
+ "Failed to aquire a lock from Redlock due to a Redis connection " /
34
+ "timeout: #{err}. If you are using Redis via `ConnectionPool` " /
35
+ "you may wish to increase the pool size.")
36
+ end
37
+
38
+ private
39
+
40
+ ##
41
+ # @api_private
42
+ def client(conn)
43
+ Redlock::Client.new([conn], retry_count: @retry_count, retry_delay: @retry_delay)
44
+ end
45
+
46
+ ##
47
+ # @api private
48
+ #
49
+ # @note support both a ConnectionPool and a raw Redis client for now.
50
+ # we should drop support for `Redis.current` in 5.0.0.
51
+ # `#then` supports both options. for a ConnectionPool it will block
52
+ # until a connection is available.
53
+ def pool
54
+ Hyrax.config.redis_connection || Redis.current
25
55
  end
26
56
  end
27
57
  end
@@ -128,8 +128,8 @@ module Hyrax
128
128
 
129
129
  # Wraps ActiveFedora::Base#search_by_id(id, opts)
130
130
  # @return [Array<SolrHit>] the response docs wrapped in SolrHit objects
131
- def search_by_id(id, opts = {})
132
- result = Hyrax::SolrService.query("id:#{id}", opts.merge(rows: 1))
131
+ def search_by_id(id, **opts)
132
+ result = Hyrax::SolrService.query("id:#{id}", **opts.merge(rows: 1))
133
133
 
134
134
  raise Hyrax::ObjectNotFoundError, "Object '#{id}' not found in solr" if result.empty?
135
135
  result.first
@@ -41,7 +41,7 @@ module Hyrax
41
41
  end
42
42
 
43
43
  def visibility_map
44
- Hyrax::VisibilityMap.instance
44
+ Hyrax.config.visibility_map
45
45
  end
46
46
  end
47
47
  end
@@ -44,7 +44,7 @@ module Hyrax
44
44
  end
45
45
 
46
46
  def visibility_map
47
- Hyrax::VisibilityMap.instance
47
+ Hyrax.config.visibility_map
48
48
  end
49
49
  end
50
50
  end
@@ -55,7 +55,7 @@ module Hyrax
55
55
  workflow_actions_scope.arel_table[:id].in(
56
56
  workflow_state_actions_scope.arel_table.project(
57
57
  workflow_state_actions_scope.arel_table[:workflow_action_id]
58
- ).where(workflow_state_actions_scope.arel.constraints.reduce)
58
+ ).where(workflow_state_actions_scope.arel.constraints.reduce(:+))
59
59
  )
60
60
  )
61
61
  end
@@ -307,7 +307,7 @@ module Hyrax
307
307
 
308
308
  entity_specific_scope = scope_processing_workflow_roles_for_user_and_entity_specific(user: user, entity: entity)
309
309
  Sipity::WorkflowRole.where(
310
- workflow_scope.arel.constraints.reduce.or(entity_specific_scope.arel.constraints.reduce)
310
+ workflow_scope.arel.constraints.reduce(:+).or(entity_specific_scope.arel.constraints.reduce(:+))
311
311
  )
312
312
  end
313
313
 
@@ -358,7 +358,7 @@ module Hyrax
358
358
  agent_scope.arel_table.project(
359
359
  agent_scope.arel_table[:id]
360
360
  ).where(
361
- agent_scope.arel.constraints.reduce.and(entity_responsibilities[:entity_id].eq(entity.id))
361
+ agent_scope.arel.constraints.reduce(:+).and(entity_responsibilities[:entity_id].eq(entity.id))
362
362
  )
363
363
  )
364
364
  )
@@ -399,7 +399,7 @@ module Hyrax
399
399
  ).where(
400
400
  permissions.arel_table[:workflow_role_id].in(
401
401
  role_scope.arel_table.project(role_scope.arel_table[:id]).where(
402
- role_scope.arel.constraints.reduce
402
+ role_scope.arel.constraints.reduce(:+)
403
403
  )
404
404
  )
405
405
  )
@@ -441,7 +441,7 @@ module Hyrax
441
441
  # @return [ActiveRecord::Relation<Sipity::WorkflowAction>]
442
442
  def scope_workflow_actions_available_for_current_state(entity:)
443
443
  workflow_actions_for_current_state = scope_workflow_actions_for_current_state(entity: entity)
444
- Sipity::WorkflowAction.where(workflow_actions_for_current_state.arel.constraints.reduce)
444
+ Sipity::WorkflowAction.where(workflow_actions_for_current_state.arel.constraints.reduce(:+))
445
445
  end
446
446
  end
447
447
  end
@@ -5,8 +5,8 @@ module Hyrax
5
5
  class CollectionMembershipValidator < ActiveModel::Validator
6
6
  ##
7
7
  # @param multiple_membership_checker
8
- def initialize(multiple_membership_checker: Hyrax::MultipleMembershipChecker, **options)
9
- @multiple_membership_checker = multiple_membership_checker
8
+ def initialize(options = {})
9
+ @multiple_membership_checker = options[:multiple_membership_checker] || Hyrax::MultipleMembershipChecker
10
10
  super(options)
11
11
  end
12
12
 
@@ -16,7 +16,7 @@
16
16
  <%= render 'hyrax/dashboard/sidebar' %>
17
17
  </div>
18
18
  <div class="main-content maximized<%= " admin-stats" if request.fullpath.include? '/admin/stats' %>">
19
- <%= render_breadcrumbs builder: Hyrax::BootstrapBreadcrumbsBuilder %>
19
+ <%= render_breadcrumbs builder: Hyrax.config.breadcrumb_builder %>
20
20
  <%= render '/flash_msg' %>
21
21
  <% if content_for?(:page_header) %>
22
22
  <div class="row">
@@ -15,7 +15,7 @@
15
15
  <div id="content-wrapper" class="container" role="main">
16
16
  <%= content_for(:container_header) %>
17
17
  <%= render '/flash_msg' %>
18
- <%= render_breadcrumbs builder: Hyrax::BootstrapBreadcrumbsBuilder %>
18
+ <%= render_breadcrumbs builder: Hyrax.config.breadcrumb_builder %>
19
19
  <% if content_for?(:page_header) %>
20
20
  <div class="row">
21
21
  <div class="col-12 main-header">
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Add support for engine routes to kaminari
4
+ Rails.application.config.to_prepare do
5
+ Kaminari::Helpers::Tag.class_eval do
6
+ def page_url_for(page)
7
+ params = params_for(page)
8
+ params[:only_path] = true
9
+ if @options[:route_set]
10
+ @options[:route_set].url_for params
11
+ else
12
+ @template.url_for params
13
+ end
14
+ end
15
+ end
16
+ end
@@ -104,7 +104,6 @@ services:
104
104
 
105
105
  postgres:
106
106
  image: postgres:latest
107
- restart: always
108
107
  env_file:
109
108
  - .koppie/.env
110
109
  ports:
data/docker-compose.yml CHANGED
@@ -99,7 +99,6 @@ services:
99
99
 
100
100
  postgres:
101
101
  image: postgres:latest
102
- restart: always
103
102
  environment:
104
103
  - POSTGRES_USER=hyrax_user
105
104
  - POSTGRES_PASSWORD=hyrax_password
@@ -50,7 +50,7 @@ The Samvera community is here to help. Please see our [support guide](../.github
50
50
  # Getting started
51
51
 
52
52
  This document contains instructions specific to setting up an app with __Hyrax
53
- v4.0.0.rc1__. If you are looking for instructions on installing a different
53
+ v4.0.0.rc3__. If you are looking for instructions on installing a different
54
54
  version, be sure to select the appropriate branch or tag from the drop-down
55
55
  menu above.
56
56
 
@@ -129,7 +129,7 @@ Note here that the following commands assume you're setting up Hyrax in a develo
129
129
 
130
130
  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).
131
131
 
132
- Hyrax supports Ruby 2.5, 2.6, and 2.7. When starting a new project, we recommend using the latest Ruby 2.7 version.
132
+ Hyrax supports Ruby 2.7, 3.0, 3.1 and 3.2. When starting a new project, we recommend using the latest Ruby 3.2 version.
133
133
 
134
134
  ## Redis
135
135
 
@@ -159,7 +159,7 @@ NOTE: The steps need to be done in order to create a new Hyrax based app.
159
159
  Generate a new Rails application using the template.
160
160
 
161
161
  ```
162
- rails _6.1.7.3_ new my_app -m https://raw.githubusercontent.com/samvera/hyrax/hyrax-v4.0.0.rc1/template.rb
162
+ rails _6.1.7.3_ new my_app -m https://raw.githubusercontent.com/samvera/hyrax/hyrax-v4.0.0.rc3/template.rb
163
163
  ```
164
164
 
165
165
  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,7 +32,7 @@ SUMMARY
32
32
  # http://guides.rubyonrails.org/maintenance_policy.html
33
33
  spec.add_dependency 'rails', '~> 6.0'
34
34
 
35
- spec.add_dependency 'active-fedora', '~> 13.1', '>= 13.1.2'
35
+ spec.add_dependency 'active-fedora', '~> 14.0'
36
36
  spec.add_dependency 'almond-rails', '~> 0.1'
37
37
  spec.add_dependency 'awesome_nested_set', '~> 3.1'
38
38
  spec.add_dependency 'blacklight', '~> 7.29'
@@ -41,6 +41,7 @@ SUMMARY
41
41
  spec.add_dependency 'browse-everything', '>= 0.16', '< 2.0'
42
42
  spec.add_dependency 'carrierwave', '~> 1.0'
43
43
  spec.add_dependency 'clipboard-rails', '~> 1.5'
44
+ spec.add_dependency 'connection_pool', '~> 2.4'
44
45
  spec.add_dependency 'draper', '~> 4.0'
45
46
  spec.add_dependency 'dry-events', '~> 0.2.0'
46
47
  spec.add_dependency 'dry-equalizer', '~> 0.2'
@@ -53,18 +54,16 @@ SUMMARY
53
54
  spec.add_dependency 'font-awesome-rails', '~> 4.2'
54
55
  spec.add_dependency 'hydra-derivatives', '~> 3.3'
55
56
  spec.add_dependency 'hydra-editor', '~> 6.0'
56
- spec.add_dependency 'hydra-file_characterization', '~> 1.1.2'
57
+ spec.add_dependency 'hydra-file_characterization', '~> 1.1'
57
58
  spec.add_dependency 'hydra-head', '~> 12.0'
58
59
  spec.add_dependency 'hydra-works', '>= 0.16'
59
60
  spec.add_dependency 'iiif_manifest', '>= 0.3', '< 2.0'
60
61
  spec.add_dependency 'json-schema' # for Arkivo
61
- # Pin more tightly because 0.x gems are potentially unstable
62
- spec.add_dependency 'kaminari_route_prefix', '~> 0.1.1'
63
62
  spec.add_dependency 'legato', '~> 0.3'
64
63
  spec.add_dependency 'linkeddata' # Required for getting values from geonames
65
64
  spec.add_dependency 'mailboxer', '~> 0.12'
66
65
  spec.add_dependency 'nest', '~> 3.1'
67
- spec.add_dependency 'noid-rails', '~> 3.0.0'
66
+ spec.add_dependency 'noid-rails', '~> 3.0'
68
67
  spec.add_dependency 'oauth'
69
68
  spec.add_dependency 'oauth2', '~> 1.2'
70
69
  spec.add_dependency 'openseadragon'
@@ -79,7 +78,6 @@ SUMMARY
79
78
  spec.add_dependency 'reform', '~> 2.3'
80
79
  spec.add_dependency 'reform-rails', '~> 0.2.0'
81
80
  spec.add_dependency 'retriable', '>= 2.9', '< 4.0'
82
- spec.add_dependency 'samvera-nesting_indexer', '~> 2.0'
83
81
  spec.add_dependency 'signet'
84
82
  spec.add_dependency 'tinymce-rails', '~> 5.10'
85
83
  spec.add_dependency 'valkyrie', '~> 3.0.1'
@@ -1,4 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
  require 'redis'
3
+ require 'connection_pool'
3
4
  config = YAML.safe_load(ERB.new(IO.read(Rails.root.join('config', 'redis.yml'))).result)[Rails.env].with_indifferent_access
4
- Redis.current = Redis.new(config.merge(thread_safe: true))
5
+ config[:thread_safe] = true
6
+
7
+ size = ENV.fetch("HYRAX_REDIS_POOL_SIZE", 5)
8
+ timeout = ENV.fetch("HYRAX_REDIS_TIMEOUT", 5)
9
+
10
+ Hyrax.config.redis_connection =
11
+ ConnectionPool::Wrapper.new(size: size, timeout: timeout) { Redis.new(config) }
@@ -393,6 +393,11 @@ module Hyrax
393
393
  @banner_image ||= 'https://user-images.githubusercontent.com/101482/29949206-ffa60d2c-8e67-11e7-988d-4910b8787d56.jpg'
394
394
  end
395
395
 
396
+ attr_writer :breadcrumb_builder
397
+ def breadcrumb_builder
398
+ @breadcrumb_builder ||= Hyrax::BootstrapBreadcrumbsBuilder
399
+ end
400
+
396
401
  ##
397
402
  # @return [Boolean]
398
403
  def disable_wings
@@ -611,9 +616,10 @@ module Hyrax
611
616
  @persistent_hostpath ||= "http://localhost/files/"
612
617
  end
613
618
 
619
+ attr_accessor :redis_connection
614
620
  attr_writer :redis_namespace
615
621
  def redis_namespace
616
- @redis_namespace ||= "hyrax"
622
+ @redis_namespace ||= ENV.fetch("HYRAX_REDIS_NAMESPACE", "hyrax")
617
623
  end
618
624
 
619
625
  attr_writer :libreoffice_path
@@ -880,6 +886,17 @@ module Hyrax
880
886
  @derivative_services ||= [Hyrax::FileSetDerivativesService]
881
887
  end
882
888
 
889
+ attr_writer :visibility_map
890
+ # A mapping from visibility string values to permissions; the default and
891
+ # reference implementation is provided by {Hyrax::VisibilityMap}.
892
+ #
893
+ # @return [Hyrax::VisibilityMap]
894
+ # @see Hyrax::VisibilityReader
895
+ # @see Hyrax::VisibilityWriter
896
+ def visibility_map
897
+ @visibility_map ||= Hyrax::VisibilityMap.instance
898
+ end
899
+
883
900
  private
884
901
 
885
902
  # @param [Symbol, #to_s] model_name - symbol representing the model
@@ -27,7 +27,7 @@ module Hyrax
27
27
  # @note adds behavior to clear the cache whenever a manual fetch of data
28
28
  # is performed.
29
29
  # @see ActiveTriples::Resource#fetch
30
- def fetch(*)
30
+ def fetch(*, **)
31
31
  Rails.cache.delete(cache_key)
32
32
  super
33
33
  end
data/lib/hyrax/engine.rb CHANGED
@@ -107,6 +107,8 @@ module Hyrax
107
107
 
108
108
  ActiveFedora::Base.translate_uri_to_id = c.translate_uri_to_id
109
109
  ActiveFedora::Base.translate_id_to_uri = c.translate_id_to_uri
110
+ ActiveFedora::File.translate_uri_to_id = c.translate_uri_to_id
111
+ ActiveFedora::File.translate_id_to_uri = c.translate_id_to_uri
110
112
 
111
113
  ::Noid::Rails.config.template = c.noid_template
112
114
  ::Noid::Rails.config.minter_class = c.noid_minter_class
@@ -7,9 +7,11 @@ module Hyrax
7
7
  class << self
8
8
  # @return [Fixnum, nil] the id of the event, or `nil` on failure(?!)
9
9
  def create(action, timestamp)
10
- event_id = instance.incr("events:latest_id")
11
- instance.hmset("events:#{event_id}", "action", action, "timestamp", timestamp)
12
- event_id
10
+ instance.then do |redis|
11
+ event_id = redis.incr("events:latest_id")
12
+ redis.hmset("events:#{event_id}", "action", action, "timestamp", timestamp)
13
+ event_id
14
+ end
13
15
  rescue Redis::CommandError => e
14
16
  logger.error("unable to create event: #{e}")
15
17
  nil
@@ -23,12 +25,16 @@ module Hyrax
23
25
  #
24
26
  # @return [Redis]
25
27
  def instance
26
- if Redis.current.is_a? Redis::Namespace
27
- Redis.current.namespace = namespace
28
+ connection = Hyrax.config.redis_connection || Redis.current
29
+
30
+ if connection.is_a? Redis::Namespace
31
+ connection.namespace = namespace
32
+ connection
33
+ elsif connection == Redis.current
34
+ Redis.current = Redis::Namespace.new(namespace, redis: connection)
28
35
  else
29
- Redis.current = Redis::Namespace.new(namespace, redis: Redis.current)
36
+ connection
30
37
  end
31
- Redis.current
32
38
  end
33
39
 
34
40
  ##
@@ -44,11 +50,13 @@ module Hyrax
44
50
  #
45
51
  # @return [Enumerable<Hash<Symbol, String>>]
46
52
  def fetch(size)
47
- RedisEventStore.instance.lrange(@key, 0, size).map do |event_id|
48
- {
49
- action: RedisEventStore.instance.hget("events:#{event_id}", "action"),
50
- timestamp: RedisEventStore.instance.hget("events:#{event_id}", "timestamp")
51
- }
53
+ Hyrax::RedisEventStore.instance.then do |redis|
54
+ redis.lrange(@key, 0, size).map do |event_id|
55
+ {
56
+ action: redis.hget("events:#{event_id}", "action"),
57
+ timestamp: redis.hget("events:#{event_id}", "timestamp")
58
+ }
59
+ end
52
60
  end
53
61
  rescue Redis::CommandError, Redis::CannotConnectError
54
62
  RedisEventStore.logger.error("unable to fetch event: #{@key}")
@@ -62,7 +70,7 @@ module Hyrax
62
70
  #
63
71
  # @return [Integer, nil] the value successfully pushed; or `nil` on failure(!?)
64
72
  def push(value)
65
- RedisEventStore.instance.lpush(@key, value)
73
+ Hyrax::RedisEventStore.instance.then { |r| r.lpush(@key, value) }
66
74
  rescue Redis::CommandError, Redis::CannotConnectError
67
75
  RedisEventStore.logger.error("unable to push event: #{@key}")
68
76
  nil
@@ -95,7 +95,8 @@ module Hyrax
95
95
  def call(value)
96
96
  Success(
97
97
  steps.inject(value) do |val, step_name|
98
- yield container[step_name].call(val, *step_arguments_for(step_name))
98
+ args = step_arguments_for(step_name)
99
+ yield container[step_name].call(val, *args[0..-2], **Hash(args[-1]))
99
100
  end
100
101
  )
101
102
  end
@@ -119,7 +120,7 @@ module Hyrax
119
120
  # tx = Hyrax::Transactions::Transaction.new(steps: [:first_step, :second_step])
120
121
  # result = tx.with_step_args(second_step: {named_parameter: :param_value}).call(:value)
121
122
  #
122
- def with_step_args(args)
123
+ def with_step_args(**args)
123
124
  raise(ArgumentError, key_err_msg(args.keys)) if
124
125
  args.keys.any? { |key| !step?(key) }
125
126
 
data/lib/hyrax/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Hyrax
3
- VERSION = '4.0.0.rc1'
3
+ VERSION = '4.0.0.rc3'
4
4
  end
data/lib/hyrax.rb CHANGED
@@ -20,7 +20,6 @@ require 'hyrax/version'
20
20
  require 'hyrax/inflections'
21
21
  require 'hyrax/name'
22
22
  require 'hyrax/valkyrie_can_can_adapter'
23
- require 'kaminari_route_prefix'
24
23
  require 'valkyrie/indexing_adapter'
25
24
  require 'valkyrie/indexing/solr/indexing_adapter'
26
25
  require 'valkyrie/indexing/null_indexing_adapter'
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'faraday/multipart'
4
+
3
5
  module Wings
4
6
  module Valkyrie
5
7
  ##
@@ -67,8 +69,9 @@ module Wings
67
69
 
68
70
  reader = RDF::Reader.for(content_type: response.headers['content-type'])
69
71
  version_graph = RDF::Graph.new << reader.new(response.body)
72
+ query = { predicate: RDF::Vocab::Fcrepo4.hasVersion }
70
73
 
71
- version_graph.query(predicate: RDF::Vocab::Fcrepo4.hasVersion).objects.map do |uri|
74
+ version_graph.query(query).objects.map do |uri|
72
75
  timestamp =
73
76
  version_graph.query([uri, RDF::Vocab::Fcrepo4.created, :created])
74
77
  .first_object
data/template.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  # Hack for https://github.com/rails/rails/issues/35153
3
3
  gsub_file 'Gemfile', /^gem ["']sqlite3["']$/, 'gem "sqlite3", "~> 1.3.0"'
4
- gem 'hyrax', '4.0.0.rc1'
4
+ gem 'hyrax', '4.0.0.rc3'
5
5
  run 'bundle install'
6
6
  generate 'hyrax:install', '-f'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hyrax
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0.rc1
4
+ version: 4.0.0.rc3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
@@ -14,7 +14,7 @@ authors:
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2023-03-31 00:00:00.000000000 Z
17
+ date: 2023-05-15 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: rails
@@ -36,20 +36,14 @@ dependencies:
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '13.1'
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- version: 13.1.2
39
+ version: '14.0'
43
40
  type: :runtime
44
41
  prerelease: false
45
42
  version_requirements: !ruby/object:Gem::Requirement
46
43
  requirements:
47
44
  - - "~>"
48
45
  - !ruby/object:Gem::Version
49
- version: '13.1'
50
- - - ">="
51
- - !ruby/object:Gem::Version
52
- version: 13.1.2
46
+ version: '14.0'
53
47
  - !ruby/object:Gem::Dependency
54
48
  name: almond-rails
55
49
  requirement: !ruby/object:Gem::Requirement
@@ -168,6 +162,20 @@ dependencies:
168
162
  - - "~>"
169
163
  - !ruby/object:Gem::Version
170
164
  version: '1.5'
165
+ - !ruby/object:Gem::Dependency
166
+ name: connection_pool
167
+ requirement: !ruby/object:Gem::Requirement
168
+ requirements:
169
+ - - "~>"
170
+ - !ruby/object:Gem::Version
171
+ version: '2.4'
172
+ type: :runtime
173
+ prerelease: false
174
+ version_requirements: !ruby/object:Gem::Requirement
175
+ requirements:
176
+ - - "~>"
177
+ - !ruby/object:Gem::Version
178
+ version: '2.4'
171
179
  - !ruby/object:Gem::Dependency
172
180
  name: draper
173
181
  requirement: !ruby/object:Gem::Requirement
@@ -328,14 +336,14 @@ dependencies:
328
336
  requirements:
329
337
  - - "~>"
330
338
  - !ruby/object:Gem::Version
331
- version: 1.1.2
339
+ version: '1.1'
332
340
  type: :runtime
333
341
  prerelease: false
334
342
  version_requirements: !ruby/object:Gem::Requirement
335
343
  requirements:
336
344
  - - "~>"
337
345
  - !ruby/object:Gem::Version
338
- version: 1.1.2
346
+ version: '1.1'
339
347
  - !ruby/object:Gem::Dependency
340
348
  name: hydra-head
341
349
  requirement: !ruby/object:Gem::Requirement
@@ -398,20 +406,6 @@ dependencies:
398
406
  - - ">="
399
407
  - !ruby/object:Gem::Version
400
408
  version: '0'
401
- - !ruby/object:Gem::Dependency
402
- name: kaminari_route_prefix
403
- requirement: !ruby/object:Gem::Requirement
404
- requirements:
405
- - - "~>"
406
- - !ruby/object:Gem::Version
407
- version: 0.1.1
408
- type: :runtime
409
- prerelease: false
410
- version_requirements: !ruby/object:Gem::Requirement
411
- requirements:
412
- - - "~>"
413
- - !ruby/object:Gem::Version
414
- version: 0.1.1
415
409
  - !ruby/object:Gem::Dependency
416
410
  name: legato
417
411
  requirement: !ruby/object:Gem::Requirement
@@ -474,14 +468,14 @@ dependencies:
474
468
  requirements:
475
469
  - - "~>"
476
470
  - !ruby/object:Gem::Version
477
- version: 3.0.0
471
+ version: '3.0'
478
472
  type: :runtime
479
473
  prerelease: false
480
474
  version_requirements: !ruby/object:Gem::Requirement
481
475
  requirements:
482
476
  - - "~>"
483
477
  - !ruby/object:Gem::Version
484
- version: 3.0.0
478
+ version: '3.0'
485
479
  - !ruby/object:Gem::Dependency
486
480
  name: oauth
487
481
  requirement: !ruby/object:Gem::Requirement
@@ -696,20 +690,6 @@ dependencies:
696
690
  - - "<"
697
691
  - !ruby/object:Gem::Version
698
692
  version: '4.0'
699
- - !ruby/object:Gem::Dependency
700
- name: samvera-nesting_indexer
701
- requirement: !ruby/object:Gem::Requirement
702
- requirements:
703
- - - "~>"
704
- - !ruby/object:Gem::Version
705
- version: '2.0'
706
- type: :runtime
707
- prerelease: false
708
- version_requirements: !ruby/object:Gem::Requirement
709
- requirements:
710
- - - "~>"
711
- - !ruby/object:Gem::Version
712
- version: '2.0'
713
693
  - !ruby/object:Gem::Dependency
714
694
  name: signet
715
695
  requirement: !ruby/object:Gem::Requirement
@@ -2962,6 +2942,7 @@ files:
2962
2942
  - config/i18n-tasks.yml
2963
2943
  - config/initializers/1_healthz.rb
2964
2944
  - config/initializers/indexing_adapter_initializer.rb
2945
+ - config/initializers/kaminari_engine_patch.rb
2965
2946
  - config/initializers/listeners.rb
2966
2947
  - config/initializers/reform_rails_6_1_monkey_patch.rb
2967
2948
  - config/initializers/simple_form.rb
@@ -3329,7 +3310,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
3329
3310
  - !ruby/object:Gem::Version
3330
3311
  version: 1.3.1
3331
3312
  requirements: []
3332
- rubygems_version: 3.4.10
3313
+ rubygems_version: 3.4.12
3333
3314
  signing_key:
3334
3315
  specification_version: 4
3335
3316
  summary: Hyrax is a front-end based on the robust Samvera framework, providing a user