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 +4 -4
- data/.circleci/config.yml +1 -1
- data/CHANGELOG.md +7 -0
- data/lib/valkyrie/persistence/custom_query_container.rb +8 -2
- data/lib/valkyrie/specs/shared_specs/queries.rb +20 -0
- data/lib/valkyrie/version.rb +1 -1
- data/lib/valkyrie.rb +7 -3
- data/valkyrie.gemspec +1 -0
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 750ec9e34bb5fdcf933600cc1cf5732b4e98eec398257d02be08ccf3b7f54d94
|
4
|
+
data.tar.gz: f4ba8f5e531df99149c91937f4057ba5cea53e0db3b3faea0bcb18db7032b31c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec513e8410606fada867265d3328cbbdec11ba3f34957f94049aef84c25f879e4c745e14157f0d7dc2c88e5e01fc73bda60ff717308ab0fa064b196c150f4d59
|
7
|
+
data.tar.gz: c9c819f1b3dc93bee6ff287617ad78af8a32c0169e9ecf3803fa0036b5c533c3595b72de44e7763564d42e7be006d45033f207b9c53087fd2ca3067b7f0cc37a
|
data/.circleci/config.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -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
|
-
|
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
|
data/lib/valkyrie/version.rb
CHANGED
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(
|
85
|
+
Valkyrie::MetadataAdapter.find(self[:metadata_adapter].to_sym)
|
82
86
|
end
|
83
87
|
|
84
88
|
def storage_adapter
|
85
|
-
Valkyrie::StorageAdapter.find(
|
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
|
-
|
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.
|
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-
|
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.
|
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
|