valkyrie 3.0.0.pre.beta.2 → 3.0.0.pre.beta.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 92a63ed951bdc096d910ffcc3b357f5723607c7014dabe1e7e9e1fd83e33c6aa
4
- data.tar.gz: 065703d34ed3cc701d72f83fe23a73f56ae504e1f4448db9b35c62c831246049
3
+ metadata.gz: 750ec9e34bb5fdcf933600cc1cf5732b4e98eec398257d02be08ccf3b7f54d94
4
+ data.tar.gz: f4ba8f5e531df99149c91937f4057ba5cea53e0db3b3faea0bcb18db7032b31c
5
5
  SHA512:
6
- metadata.gz: 673a3dd11538cccf8c99de59d303a58ae225bfd672dec42e19c1eb436e5a1112924b49319b72127d1f6cc8c0c555ebb748b2029f3cafb9f81dd5925ac6a3f6b8
7
- data.tar.gz: 0b3ecfd44279c35865cd42e50ff7d40cc8d983f87cffccc09573f7c8ded1148e19e3855089bb9bdea72708efa528bb91bdd0f877f4c3b9abd33a7dc52f6c8251
6
+ metadata.gz: ec513e8410606fada867265d3328cbbdec11ba3f34957f94049aef84c25f879e4c745e14157f0d7dc2c88e5e01fc73bda60ff717308ab0fa064b196c150f4d59
7
+ data.tar.gz: c9c819f1b3dc93bee6ff287617ad78af8a32c0169e9ecf3803fa0036b5c533c3595b72de44e7763564d42e7be006d45033f207b9c53087fd2ca3067b7f0cc37a
data/.circleci/config.yml CHANGED
@@ -12,7 +12,7 @@ jobs:
12
12
  default: "2.6.5"
13
13
  type: "string"
14
14
  docker:
15
- - image: circleci/ruby:<< parameters.ruby >>-node-browsers
15
+ - image: cimg/ruby:<< parameters.ruby >>
16
16
  environment:
17
17
  RAILS_ENV: test
18
18
  - image: postgres:10.6-alpine
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # v3.0.0.beta3 2022-08-09
2
+
3
+ ## Changes since last release
4
+
5
+ * Fix Ruby 3.0 support issues
6
+ [marrus-sh](https://github.com/marrus-sh)
7
+
1
8
  # v3.0.0.beta2 2022-06-15
2
9
 
3
10
  ## Changes since last release
@@ -46,8 +46,14 @@ module Valkyrie::Persistence
46
46
  query_handler.queries.each do |query|
47
47
  handler = query_handler.new(query_service: query_service)
48
48
  query_handlers[query.to_sym] = handler
49
- define_singleton_method query do |*args, &block|
50
- query_handlers[query.to_sym].__send__(query, *args, &block)
49
+ define_singleton_method query do |*args, **kwargs, &block|
50
+ if kwargs.empty?
51
+ # This case needs to be specially handled in Ruby 2.6, or else an
52
+ # empty hash will be passed as the final argument.
53
+ query_handlers[query.to_sym].__send__(query, *args, &block)
54
+ else
55
+ query_handlers[query.to_sym].__send__(query, *args, **kwargs, &block)
56
+ end
51
57
  end
52
58
  end
53
59
  end
@@ -495,6 +495,26 @@ RSpec.shared_examples 'a Valkyrie query provider' do
495
495
  expect(query_service.custom_queries).to respond_to :find_by_user_id
496
496
  expect(query_service.custom_queries.find_by_user_id).to eq 1
497
497
  end
498
+
499
+ it "can register a query handler which takes keyword arguments" do
500
+ class QueryHandler
501
+ def self.queries
502
+ [:identity]
503
+ end
504
+
505
+ attr_reader :query_service
506
+ def initialize(query_service:)
507
+ @query_service = query_service
508
+ end
509
+
510
+ def identity(term:)
511
+ term
512
+ end
513
+ end
514
+ query_service.custom_queries.register_query_handler(QueryHandler)
515
+ expect(query_service.custom_queries).to respond_to :identity
516
+ expect(query_service.custom_queries.identity(term: :x)).to eq :x
517
+ end
498
518
  end
499
519
 
500
520
  context "optimistic locking" do
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Valkyrie
3
- VERSION = "3.0.0-beta.2"
3
+ VERSION = "3.0.0-beta.3"
4
4
  end
data/lib/valkyrie.rb CHANGED
@@ -73,16 +73,20 @@ module Valkyrie
73
73
  end
74
74
 
75
75
  class Config < OpenStruct
76
+ # Method lookup with OpenStruct appears to have issues in Ruby 3, so we
77
+ # unfortunately can’t just call +super+ when accessing values in the
78
+ # following methods. Using brackets works fine, though.
79
+
76
80
  def initialize(hsh = {})
77
81
  super(defaults.merge(hsh))
78
82
  end
79
83
 
80
84
  def metadata_adapter
81
- Valkyrie::MetadataAdapter.find(super.to_sym)
85
+ Valkyrie::MetadataAdapter.find(self[:metadata_adapter].to_sym)
82
86
  end
83
87
 
84
88
  def storage_adapter
85
- Valkyrie::StorageAdapter.find(super.to_sym)
89
+ Valkyrie::StorageAdapter.find(self[:storage_adapter].to_sym)
86
90
  end
87
91
 
88
92
  # @api public
@@ -96,7 +100,7 @@ module Valkyrie
96
100
  #
97
101
  # @see #default_resource_class_resolver for full interface
98
102
  def resource_class_resolver
99
- super
103
+ self[:resource_class_resolver]
100
104
  end
101
105
 
102
106
  # @!attribute [w] resource_class_resolver=
data/valkyrie.gemspec CHANGED
@@ -12,6 +12,7 @@ Gem::Specification.new do |spec|
12
12
 
13
13
  spec.summary = 'An ORM using the Data Mapper pattern, specifically built to solve Digital Repository use cases.'
14
14
  spec.homepage = "https://github.com/samvera/valkyrie"
15
+ spec.metadata = { "rubygems_mfa_required" => "true" }
15
16
 
16
17
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
17
18
  f.match(%r{^(test|spec|features)/})
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: valkyrie
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0.pre.beta.2
4
+ version: 3.0.0.pre.beta.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Trey Pendragon
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-06-15 00:00:00.000000000 Z
11
+ date: 2022-08-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-struct
@@ -562,7 +562,8 @@ files:
562
562
  - valkyrie_logo.png
563
563
  homepage: https://github.com/samvera/valkyrie
564
564
  licenses: []
565
- metadata: {}
565
+ metadata:
566
+ rubygems_mfa_required: 'true'
566
567
  post_install_message:
567
568
  rdoc_options: []
568
569
  require_paths:
@@ -578,7 +579,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
578
579
  - !ruby/object:Gem::Version
579
580
  version: 1.3.1
580
581
  requirements: []
581
- rubygems_version: 3.1.6
582
+ rubygems_version: 3.3.15
582
583
  signing_key:
583
584
  specification_version: 4
584
585
  summary: An ORM using the Data Mapper pattern, specifically built to solve Digital