valkyrie 3.0.0.pre.beta.1 → 3.0.0.pre.beta.2
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 +20 -0
- data/.rubocop.yml +3 -0
- data/.tool-versions +1 -1
- data/Appraisals +15 -0
- data/CHANGELOG.md +21 -0
- data/README.md +1 -16
- data/Rakefile +1 -1
- data/db/config.yml +1 -1
- data/gemfiles/activerecord_5_2.gemfile +0 -1
- data/gemfiles/activerecord_6_0.gemfile +0 -1
- data/gemfiles/activerecord_7_0.gemfile +11 -0
- data/gemfiles/faraday_0.gemfile +12 -0
- data/gemfiles/faraday_1.gemfile +12 -0
- data/lib/valkyrie/persistence/fedora/ordered_list.rb +4 -6
- data/lib/valkyrie/persistence/postgres/metadata_adapter.rb +11 -1
- data/lib/valkyrie/persistence.rb +2 -0
- data/lib/valkyrie/rdf_patches.rb +1 -0
- data/lib/valkyrie/specs/shared_specs/change_set_persister.rb +1 -0
- data/lib/valkyrie/specs/shared_specs/persister.rb +1 -1
- data/lib/valkyrie/specs/shared_specs/queries.rb +4 -0
- data/lib/valkyrie/storage/disk.rb +1 -1
- data/lib/valkyrie/version.rb +1 -1
- data/lib/valkyrie/vocab/pcdm_use.rb +2 -1
- data/lib/valkyrie.rb +0 -1
- data/valkyrie.gemspec +2 -1
- metadata +34 -9
- data/lib/config/database_connection.rb +0 -15
- data/lib/generators/valkyrie/resource_generator.rb +0 -27
- data/lib/generators/valkyrie/templates/resource.rb.erb +0 -8
- data/lib/generators/valkyrie/templates/resource_spec.rb.erb +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92a63ed951bdc096d910ffcc3b357f5723607c7014dabe1e7e9e1fd83e33c6aa
|
4
|
+
data.tar.gz: 065703d34ed3cc701d72f83fe23a73f56ae504e1f4448db9b35c62c831246049
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 673a3dd11538cccf8c99de59d303a58ae225bfd672dec42e19c1eb436e5a1112924b49319b72127d1f6cc8c0c555ebb748b2029f3cafb9f81dd5925ac6a3f6b8
|
7
|
+
data.tar.gz: 0b3ecfd44279c35865cd42e50ff7d40cc8d983f87cffccc09573f7c8ded1148e19e3855089bb9bdea72708efa528bb91bdd0f877f4c3b9abd33a7dc52f6c8251
|
data/.circleci/config.yml
CHANGED
@@ -98,6 +98,18 @@ workflows:
|
|
98
98
|
gemfile: "gemfiles/activerecord_6_0.gemfile"
|
99
99
|
ruby: 2.7.0
|
100
100
|
name: "Ruby2-7_Rails6-0"
|
101
|
+
- build:
|
102
|
+
gemfile: "gemfiles/activerecord_7_0.gemfile"
|
103
|
+
ruby: 2.7.5
|
104
|
+
name: "Ruby2-7_rails7-0"
|
105
|
+
- build:
|
106
|
+
gemfile: "gemfiles/faraday_1.gemfile"
|
107
|
+
ruby: 2.7.0
|
108
|
+
name: "Faraday1"
|
109
|
+
- build:
|
110
|
+
gemfile: "gemfiles/faraday_0.gemfile"
|
111
|
+
ruby: 2.7.0
|
112
|
+
name: "Faraday0"
|
101
113
|
- build:
|
102
114
|
gemfile: "gemfiles/activerecord_6_0.gemfile"
|
103
115
|
ruby: 2.6.5
|
@@ -127,6 +139,14 @@ workflows:
|
|
127
139
|
gemfile: "gemfiles/activerecord_6_0.gemfile"
|
128
140
|
ruby: 2.7.0
|
129
141
|
name: "Ruby2-7_Rails6-0"
|
142
|
+
- build:
|
143
|
+
gemfile: "gemfiles/faraday_1.gemfile"
|
144
|
+
ruby: 2.7.0
|
145
|
+
name: "Faraday1"
|
146
|
+
- build:
|
147
|
+
gemfile: "gemfiles/faraday_0.gemfile"
|
148
|
+
ruby: 2.7.0
|
149
|
+
name: "Faraday0"
|
130
150
|
- build:
|
131
151
|
gemfile: "gemfiles/activerecord_6_0.gemfile"
|
132
152
|
ruby: 2.6.5
|
data/.rubocop.yml
CHANGED
data/.tool-versions
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby 2.
|
1
|
+
ruby 2.7.5
|
data/Appraisals
CHANGED
@@ -1,4 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
3
|
+
appraise "activerecord-7-0" do
|
4
|
+
gem "activerecord", "~> 7.0.0"
|
5
|
+
end
|
6
|
+
|
2
7
|
appraise "activerecord-6-0" do
|
3
8
|
gem "activerecord", "~> 6.0.0"
|
4
9
|
end
|
@@ -6,3 +11,13 @@ end
|
|
6
11
|
appraise "activerecord-5-2" do
|
7
12
|
gem "activerecord", "~> 5.2.0"
|
8
13
|
end
|
14
|
+
|
15
|
+
appraise "faraday-0" do
|
16
|
+
gem "faraday", "< 1"
|
17
|
+
gem "activerecord", "~> 6.0.0"
|
18
|
+
end
|
19
|
+
|
20
|
+
appraise "faraday-1" do
|
21
|
+
gem "faraday", "~> 1.0"
|
22
|
+
gem "activerecord", "~> 6.0.0"
|
23
|
+
end
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,24 @@
|
|
1
|
+
# v3.0.0.beta2 2022-06-15
|
2
|
+
|
3
|
+
## Changes since last release
|
4
|
+
|
5
|
+
* Update pcdm_use warning
|
6
|
+
[dchandekstark](https://github.com/dchandekstark)
|
7
|
+
* Add support for Faraday 2
|
8
|
+
[tpendragon](https://github.com/tpendragon)
|
9
|
+
* Rails 7 Support
|
10
|
+
[cgalarza](https://github.com/cgalarza)
|
11
|
+
[tpendragon](https://github.com/tpendragon)
|
12
|
+
* Support discovery of multiple disk adapters on different paths.
|
13
|
+
[no-reply](https://github.com/tpendragon)
|
14
|
+
* New Product Owner: Alexandra Dunn!
|
15
|
+
[dunn](https://github.com/dunn)
|
16
|
+
|
17
|
+
Additional thanks to the following for code review and issue reports leading to
|
18
|
+
this release:
|
19
|
+
|
20
|
+
[cjcolvar](https://github.com/cjcolvar)
|
21
|
+
|
1
22
|
# v3.0.0.beta1 2021-10-18
|
2
23
|
|
3
24
|
## Changes since last release
|
data/README.md
CHANGED
@@ -17,7 +17,7 @@ Jump in: [![Slack Status](http://slack.samvera.org/badge.svg)](http://slack.samv
|
|
17
17
|
## Primary Contacts
|
18
18
|
|
19
19
|
### Product Owner
|
20
|
-
[
|
20
|
+
[Alexandra Dunn](https://github.com/dunn)
|
21
21
|
|
22
22
|
### Technical Lead
|
23
23
|
[Trey Pendragon](https://github.com/tpendragon)
|
@@ -180,21 +180,6 @@ attribute :authors, Valkyrie::Types::Array.meta(ordered: true)
|
|
180
180
|
Defining resource attributes is explained in greater detail on the [Using Types Wiki
|
181
181
|
page](https://github.com/samvera/valkyrie/wiki/Using-Types).
|
182
182
|
|
183
|
-
#### Work Types Generator
|
184
|
-
|
185
|
-
To create a custom Valkyrie model in your application, you can use the Rails generator. For example, to
|
186
|
-
generate a model named `FooBar` with an unordered `title` field and an ordered `member_ids` field:
|
187
|
-
|
188
|
-
```
|
189
|
-
rails generate valkyrie:resource FooBar title member_ids:array
|
190
|
-
```
|
191
|
-
|
192
|
-
You can namespace your model class by including a slash in the model name:
|
193
|
-
|
194
|
-
```
|
195
|
-
rails generate valkyrie:resource Foo/Bar title member_ids:array
|
196
|
-
```
|
197
|
-
|
198
183
|
### Read and Write Data
|
199
184
|
```
|
200
185
|
# initialize a metadata adapter
|
data/Rakefile
CHANGED
data/db/config.yml
CHANGED
@@ -33,12 +33,10 @@ module Valkyrie::Persistence::Fedora
|
|
33
33
|
# empty, tail.prev is the first element.
|
34
34
|
def tail
|
35
35
|
@tail ||=
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
head.next
|
41
|
-
end
|
36
|
+
if tail_subject
|
37
|
+
TailSentinel.new(self, prev_node: build_node(tail_subject))
|
38
|
+
else
|
39
|
+
head.next
|
42
40
|
end
|
43
41
|
end
|
44
42
|
|
@@ -31,9 +31,19 @@ module Valkyrie::Persistence::Postgres
|
|
31
31
|
# @return [Valkyrie::ID]
|
32
32
|
def id
|
33
33
|
@id ||= begin
|
34
|
-
to_hash = "#{
|
34
|
+
to_hash = "#{connection_configuration[:host]}:#{connection_configuration[:database]}"
|
35
35
|
Valkyrie::ID.new(Digest::MD5.hexdigest(to_hash))
|
36
36
|
end
|
37
37
|
end
|
38
|
+
|
39
|
+
private
|
40
|
+
|
41
|
+
def connection_configuration
|
42
|
+
if resource_factory.orm_class.respond_to?(:connection_db_config)
|
43
|
+
resource_factory.orm_class.connection_db_config.configuration_hash
|
44
|
+
else
|
45
|
+
resource_factory.orm_class.connection_config
|
46
|
+
end
|
47
|
+
end
|
38
48
|
end
|
39
49
|
end
|
data/lib/valkyrie/persistence.rb
CHANGED
data/lib/valkyrie/rdf_patches.rb
CHANGED
@@ -10,8 +10,10 @@ RSpec.shared_examples 'a Valkyrie query provider' do
|
|
10
10
|
attribute :a_member_of, Valkyrie::Types::Array
|
11
11
|
attribute :an_ordered_member_of, Valkyrie::Types::Array.meta(ordered: true)
|
12
12
|
end
|
13
|
+
|
13
14
|
class Valkyrie::Specs::SecondResource < Valkyrie::Resource
|
14
15
|
end
|
16
|
+
|
15
17
|
class Valkyrie::Specs::ThirdResource < Valkyrie::Resource
|
16
18
|
attribute :a_member_of, Valkyrie::Types::Array
|
17
19
|
attribute :an_ordered_member_of, Valkyrie::Types::Array.meta(ordered: true)
|
@@ -353,9 +355,11 @@ RSpec.shared_examples 'a Valkyrie query provider' do
|
|
353
355
|
context "when the property is ordered for one child but not the other" do
|
354
356
|
before do
|
355
357
|
class Valkyrie::Specs::Parent < Valkyrie::Resource; end
|
358
|
+
|
356
359
|
class Valkyrie::Specs::ChildWithUnorderedParents < Valkyrie::Resource
|
357
360
|
attribute :a_member_of, Valkyrie::Types::Array
|
358
361
|
end
|
362
|
+
|
359
363
|
class Valkyrie::Specs::ChildWithOrderedParents < Valkyrie::Resource
|
360
364
|
attribute :a_member_of, Valkyrie::Types::Array.meta(ordered: true)
|
361
365
|
end
|
@@ -24,7 +24,7 @@ module Valkyrie::Storage
|
|
24
24
|
# @param id [Valkyrie::ID]
|
25
25
|
# @return [Boolean] true if this adapter can handle this type of identifer
|
26
26
|
def handles?(id:)
|
27
|
-
id.to_s.start_with?("disk
|
27
|
+
id.to_s.start_with?("disk://#{base_path}")
|
28
28
|
end
|
29
29
|
|
30
30
|
def file_path(id)
|
data/lib/valkyrie/version.rb
CHANGED
@@ -47,7 +47,8 @@ module Valkyrie::Vocab
|
|
47
47
|
"rdf:subClassOf": %(http://pcdm.org/resources#File),
|
48
48
|
"rdfs:isDefinedBy": %(pcdmuse:),
|
49
49
|
type: "rdfs:Class"
|
50
|
-
warn "[DEPRECATION] PCDM is deprecating '#{
|
50
|
+
warn "[DEPRECATION] PCDM is deprecating '#{name}#PreservationMasterFile'. Use '#{name}#PreservationFile' instead. " \
|
51
|
+
"This warning does *not* indicate that usage of the deprecated term has been detected."
|
51
52
|
# @deprecated
|
52
53
|
term :PreservationMasterFile,
|
53
54
|
comment: %(Best quality representation of the Object appropriate for long-term
|
data/lib/valkyrie.rb
CHANGED
@@ -27,7 +27,6 @@ module Valkyrie
|
|
27
27
|
require 'valkyrie/indexers/access_controls_indexer'
|
28
28
|
require 'valkyrie/storage'
|
29
29
|
require 'valkyrie/vocab/pcdm_use'
|
30
|
-
require 'generators/valkyrie/resource_generator'
|
31
30
|
require 'valkyrie/engine' if defined?(Rails)
|
32
31
|
def config
|
33
32
|
@config ||= Config.new(
|
data/valkyrie.gemspec
CHANGED
@@ -31,7 +31,8 @@ Gem::Specification.new do |spec|
|
|
31
31
|
spec.add_dependency 'json-ld'
|
32
32
|
spec.add_dependency 'json'
|
33
33
|
spec.add_dependency 'rdf-vocab'
|
34
|
-
spec.add_dependency 'faraday', '
|
34
|
+
spec.add_dependency 'faraday', '>= 0.9', '!= 2.0.0', '< 3'
|
35
|
+
spec.add_dependency 'faraday-multipart'
|
35
36
|
|
36
37
|
spec.add_development_dependency "bundler", "> 1.16.0", "< 3"
|
37
38
|
spec.add_development_dependency "rake", ">= 10"
|
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.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Trey Pendragon
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-06-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-struct
|
@@ -174,16 +174,42 @@ dependencies:
|
|
174
174
|
name: faraday
|
175
175
|
requirement: !ruby/object:Gem::Requirement
|
176
176
|
requirements:
|
177
|
+
- - ">="
|
178
|
+
- !ruby/object:Gem::Version
|
179
|
+
version: '0.9'
|
180
|
+
- - "!="
|
181
|
+
- !ruby/object:Gem::Version
|
182
|
+
version: 2.0.0
|
177
183
|
- - "<"
|
178
184
|
- !ruby/object:Gem::Version
|
179
|
-
version: '
|
185
|
+
version: '3'
|
180
186
|
type: :runtime
|
181
187
|
prerelease: false
|
182
188
|
version_requirements: !ruby/object:Gem::Requirement
|
183
189
|
requirements:
|
190
|
+
- - ">="
|
191
|
+
- !ruby/object:Gem::Version
|
192
|
+
version: '0.9'
|
193
|
+
- - "!="
|
194
|
+
- !ruby/object:Gem::Version
|
195
|
+
version: 2.0.0
|
184
196
|
- - "<"
|
185
197
|
- !ruby/object:Gem::Version
|
186
|
-
version: '
|
198
|
+
version: '3'
|
199
|
+
- !ruby/object:Gem::Dependency
|
200
|
+
name: faraday-multipart
|
201
|
+
requirement: !ruby/object:Gem::Requirement
|
202
|
+
requirements:
|
203
|
+
- - ">="
|
204
|
+
- !ruby/object:Gem::Version
|
205
|
+
version: '0'
|
206
|
+
type: :runtime
|
207
|
+
prerelease: false
|
208
|
+
version_requirements: !ruby/object:Gem::Requirement
|
209
|
+
requirements:
|
210
|
+
- - ">="
|
211
|
+
- !ruby/object:Gem::Version
|
212
|
+
version: '0'
|
187
213
|
- !ruby/object:Gem::Dependency
|
188
214
|
name: bundler
|
189
215
|
requirement: !ruby/object:Gem::Requirement
|
@@ -428,10 +454,9 @@ files:
|
|
428
454
|
- db/schema.rb
|
429
455
|
- gemfiles/activerecord_5_2.gemfile
|
430
456
|
- gemfiles/activerecord_6_0.gemfile
|
431
|
-
-
|
432
|
-
-
|
433
|
-
-
|
434
|
-
- lib/generators/valkyrie/templates/resource_spec.rb.erb
|
457
|
+
- gemfiles/activerecord_7_0.gemfile
|
458
|
+
- gemfiles/faraday_0.gemfile
|
459
|
+
- gemfiles/faraday_1.gemfile
|
435
460
|
- lib/valkyrie.rb
|
436
461
|
- lib/valkyrie/adapter_container.rb
|
437
462
|
- lib/valkyrie/change_set.rb
|
@@ -553,7 +578,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
553
578
|
- !ruby/object:Gem::Version
|
554
579
|
version: 1.3.1
|
555
580
|
requirements: []
|
556
|
-
rubygems_version: 3.
|
581
|
+
rubygems_version: 3.1.6
|
557
582
|
signing_key:
|
558
583
|
specification_version: 4
|
559
584
|
summary: An ORM using the Data Mapper pattern, specifically built to solve Digital
|
@@ -1,15 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
require 'active_record'
|
3
|
-
require 'erb'
|
4
|
-
|
5
|
-
module DatabaseConnection
|
6
|
-
def self.connect!(env)
|
7
|
-
# Ref https://github.com/puma/puma#clustered-mode
|
8
|
-
ActiveSupport.on_load(:active_record) do
|
9
|
-
::ActiveRecord::Base.connection_pool.disconnect! if ::ActiveRecord::Base.connected?
|
10
|
-
::ActiveRecord::Base.configurations = YAML.safe_load(ERB.new(File.read("db/config.yml")).result, [], [], true) || {}
|
11
|
-
config = ::ActiveRecord::Base.configurations[env.to_s]
|
12
|
-
::ActiveRecord::Base.establish_connection(config)
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
require 'rails/generators'
|
3
|
-
require 'rails/generators/model_helpers'
|
4
|
-
|
5
|
-
class Valkyrie::ResourceGenerator < Rails::Generators::NamedBase
|
6
|
-
# Include ModelHelpers to warn about pluralization when generating new models or scaffolds
|
7
|
-
include Rails::Generators::ModelHelpers
|
8
|
-
|
9
|
-
source_root File.expand_path('../templates', __FILE__)
|
10
|
-
|
11
|
-
argument :attributes, type: :array, default: [], banner: 'field:type field:type'
|
12
|
-
|
13
|
-
def create_model
|
14
|
-
template('resource.rb.erb', File.join('app/models', class_path, "#{file_name}.rb"))
|
15
|
-
end
|
16
|
-
|
17
|
-
def create_model_spec
|
18
|
-
return unless rspec_installed?
|
19
|
-
template('resource_spec.rb.erb', File.join('spec/models', class_path, "#{file_name}_spec.rb"))
|
20
|
-
end
|
21
|
-
|
22
|
-
private
|
23
|
-
|
24
|
-
def rspec_installed?
|
25
|
-
defined?(RSpec) && defined?(RSpec::Rails)
|
26
|
-
end
|
27
|
-
end
|
@@ -1,8 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
# Generated with `rails generate valkyrie:model <%= class_name %>`
|
3
|
-
class <%= class_name %> < Valkyrie::Resource
|
4
|
-
include Valkyrie::Resource::AccessControls
|
5
|
-
<%- attributes.each do |att| -%>
|
6
|
-
attribute :<%= att.name %>, Valkyrie::Types::<%= (att.type == :array) ? 'Array' : 'Set' %>
|
7
|
-
<%- end -%>
|
8
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
# Generated with `rails generate valkyrie:model <%= class_name %>`
|
3
|
-
require 'rails_helper'
|
4
|
-
require 'valkyrie/specs/shared_specs'
|
5
|
-
|
6
|
-
RSpec.describe <%= class_name %> do
|
7
|
-
let(:resource_klass) { described_class }
|
8
|
-
it_behaves_like "a Valkyrie::Resource"
|
9
|
-
|
10
|
-
it "has tests" do
|
11
|
-
skip "Add your tests here"
|
12
|
-
end
|
13
|
-
end
|