active-fedora 12.2.4 → 13.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/active-fedora.gemspec +6 -9
- data/lib/active_fedora/aggregation/list_source.rb +0 -10
- data/lib/active_fedora/core/fedora_id_translator.rb +1 -1
- data/lib/active_fedora/file.rb +4 -2
- data/lib/active_fedora/version.rb +1 -1
- data/lib/active_fedora.rb +1 -3
- data/lib/generators/active_fedora/config/solr/solr_generator.rb +1 -1
- data/spec/integration/date_time_properties_spec.rb +1 -25
- data/spec/unit/file_spec.rb +0 -17
- metadata +37 -79
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 61e9e73d569fd4d2c553d84d8edf1005cceb73912478bd45bd5b7ae451d28d63
|
4
|
+
data.tar.gz: 82d9d52da4b6cb81bb2ef1748542305dce3a6ffd5ed81fc2bae598cb6114a405
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 526c020760edeb2703961ad0a34e85ddfcd2de5535a753c15598afd45c503640c89527dc5ad239522d051d522e1072cbd10f8a054361bbee437f70378f317940
|
7
|
+
data.tar.gz: 9c6a6b796268853d5b594804dd5036e82d2cf085888f82eac0924108cdce8f152ddc5de85fae385f03590c5ee857345cf031df529684df1490eeae746869b71b
|
data/active-fedora.gemspec
CHANGED
@@ -20,25 +20,22 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.add_dependency "active-triples", '>= 0.11.0', '< 2.0.0'
|
21
21
|
s.add_dependency "deprecation"
|
22
22
|
s.add_dependency "ldp", '>= 0.7.0', '< 2'
|
23
|
-
s.add_dependency 'rdf-vocab', '< 3.1.5'
|
24
23
|
s.add_dependency "ruby-progressbar", '~> 1.0'
|
25
24
|
s.add_dependency 'faraday', '~> 0.12'
|
26
25
|
s.add_dependency 'faraday-encoding', '0.0.4'
|
27
26
|
|
28
|
-
s.add_development_dependency "equivalent-xml"
|
29
|
-
s.add_development_dependency 'fcrepo_wrapper', '~> 0.2'
|
30
|
-
s.add_development_dependency "github_changelog_generator"
|
31
|
-
s.add_development_dependency "rdoc"
|
32
|
-
s.add_development_dependency "psych", "< 4" # Restricted because 4.0+ do not work with rubocop 0.56.x
|
33
27
|
s.add_development_dependency "rails"
|
28
|
+
s.add_development_dependency "rdoc"
|
29
|
+
s.add_development_dependency "yard"
|
34
30
|
s.add_development_dependency "rake"
|
31
|
+
s.add_development_dependency "solr_wrapper", "~> 2.0"
|
32
|
+
s.add_development_dependency 'fcrepo_wrapper', '~> 0.2'
|
35
33
|
s.add_development_dependency "rspec", "~> 3.5"
|
36
34
|
s.add_development_dependency "rspec-its"
|
35
|
+
s.add_development_dependency "equivalent-xml"
|
36
|
+
s.add_development_dependency "simplecov", '~> 0.8'
|
37
37
|
s.add_development_dependency "rubocop", '~> 0.56.0'
|
38
38
|
s.add_development_dependency "rubocop-rspec", '~> 1.12.0'
|
39
|
-
s.add_development_dependency "simplecov", '~> 0.8'
|
40
|
-
s.add_development_dependency "solr_wrapper", "~> 2.0"
|
41
|
-
s.add_development_dependency "yard"
|
42
39
|
|
43
40
|
s.files = `git ls-files`.split("\n")
|
44
41
|
s.test_files = `git ls-files -- {spec}/*`.split("\n")
|
@@ -61,16 +61,6 @@ module ActiveFedora
|
|
61
61
|
["ActiveFedora::Aggregation::ListSource"]
|
62
62
|
end
|
63
63
|
|
64
|
-
# Short circuit ActiveModel::Dirty which attempts to load the whole ordered list when calling nodes_will_change!
|
65
|
-
# which leads to a stack level too deep exception in some cases
|
66
|
-
# See https://github.com/samvera/hyrax/issues/4581
|
67
|
-
# This approach was also taken in ActiveFedora::File:
|
68
|
-
# See https://github.com/samvera/active_fedora/pull/1312/commits/7c8bbbefdacefd655a2ca653f5950c991e1dc999#diff-28356c4daa0d55cbaf97e4269869f510R100-R103
|
69
|
-
def attribute_will_change!(attr)
|
70
|
-
return super unless attr == 'nodes'
|
71
|
-
attributes_changed_by_setter[:nodes] = true
|
72
|
-
end
|
73
|
-
|
74
64
|
private
|
75
65
|
|
76
66
|
def persist_ordered_self
|
@@ -2,7 +2,7 @@ module ActiveFedora::Core
|
|
2
2
|
class FedoraIdTranslator
|
3
3
|
SLASH = '/'.freeze
|
4
4
|
def self.call(id)
|
5
|
-
id = URI
|
5
|
+
id = URI.escape(id, '[]'.freeze)
|
6
6
|
id = "/#{id}" unless id.start_with? SLASH
|
7
7
|
unless ActiveFedora.fedora.base_path == SLASH || id.start_with?("#{ActiveFedora.fedora.base_path}/")
|
8
8
|
id = ActiveFedora.fedora.base_path + id
|
data/lib/active_fedora/file.rb
CHANGED
@@ -179,7 +179,7 @@ module ActiveFedora
|
|
179
179
|
|
180
180
|
def ldp_headers
|
181
181
|
headers = { 'Content-Type'.freeze => mime_type, 'Content-Length'.freeze => content.size.to_s }
|
182
|
-
headers['Content-Disposition'.freeze] = "attachment; filename=\"#{URI
|
182
|
+
headers['Content-Disposition'.freeze] = "attachment; filename=\"#{URI.encode(@original_name)}\"" if @original_name
|
183
183
|
headers
|
184
184
|
end
|
185
185
|
|
@@ -196,7 +196,9 @@ module ActiveFedora
|
|
196
196
|
end
|
197
197
|
|
198
198
|
def local_or_remote_content(ensure_fetch = true)
|
199
|
-
@content
|
199
|
+
return @content if new_record?
|
200
|
+
|
201
|
+
@content ||= ensure_fetch ? remote_content : @ds_content
|
200
202
|
@content.rewind if behaves_like_io?(@content)
|
201
203
|
@content
|
202
204
|
end
|
data/lib/active_fedora.rb
CHANGED
@@ -11,11 +11,9 @@ require 'active_triples'
|
|
11
11
|
# Monkey patching RDF::Literal::DateTime to support fractional seconds.
|
12
12
|
# See https://github.com/samvera/active_fedora/issues/497
|
13
13
|
# Also monkey patches in a fix for timezones to be stored properly.
|
14
|
-
# This is needed in both RDF <= 3.2.4 and RDF >= 3.2.5
|
15
|
-
# TODO: Figure out how to contribute something upstream to avoid monkey-patching
|
16
14
|
module RDF
|
17
15
|
class Literal
|
18
|
-
class DateTime
|
16
|
+
class DateTime < Literal
|
19
17
|
ALTERNATIVE_FORMAT = '%Y-%m-%dT%H:%M:%S'.freeze
|
20
18
|
DOT = '.'.freeze
|
21
19
|
EMPTY = ''.freeze
|
@@ -33,33 +33,9 @@ describe ActiveFedora::Base do
|
|
33
33
|
|
34
34
|
describe 'serializing' do
|
35
35
|
let(:object) { Foo.new(date: [date]) }
|
36
|
-
let(:triple) { object.resource.query(predicate: ::RDF::Vocab::DC.date).to_a.first
|
36
|
+
let(:triple) { object.resource.query(predicate: ::RDF::Vocab::DC.date).to_a.first }
|
37
37
|
it 'time zone must have semicolin to be a cannonical XMLSchema#dateTime' do
|
38
38
|
expect(triple.to_s).to match(/\+01:00/)
|
39
39
|
end
|
40
|
-
|
41
|
-
context 'nanoseconds' do
|
42
|
-
let(:date) { DateTime.parse("2015-10-22T10:20:03.653991025+01:00") }
|
43
|
-
|
44
|
-
it 'includes nanosecond precision' do
|
45
|
-
expect(triple.to_s).to eq "2015-10-22T10:20:03.653991025+01:00"
|
46
|
-
end
|
47
|
-
|
48
|
-
context 'with trailing zeros' do
|
49
|
-
let(:date) { DateTime.parse("2015-10-22T15:34:20.97800000-11:00") }
|
50
|
-
|
51
|
-
it 'trims trailing zeros' do
|
52
|
-
expect(triple.to_s).to eq "2015-10-22T15:34:20.978-11:00"
|
53
|
-
end
|
54
|
-
|
55
|
-
context 'and only zero nanoseconds' do
|
56
|
-
let(:date) { DateTime.parse("2015-10-22T15:34:20.000000000-11:00") }
|
57
|
-
|
58
|
-
it 'trims trailing zeros and dot if nanoseconds are all 0' do
|
59
|
-
expect(triple.to_s).to eq "2015-10-22T15:34:20-11:00"
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
64
40
|
end
|
65
41
|
end
|
data/spec/unit/file_spec.rb
CHANGED
@@ -192,23 +192,6 @@ describe ActiveFedora::File do
|
|
192
192
|
end
|
193
193
|
end
|
194
194
|
|
195
|
-
context 'when file is new and content behaves like io' do
|
196
|
-
let(:file_content) { "hello world" }
|
197
|
-
|
198
|
-
before do
|
199
|
-
af_file.uri = "http://localhost:8983/fedora/rest/test/1234/abcd"
|
200
|
-
af_file.content = StringIO.new(file_content)
|
201
|
-
allow(af_file).to receive(:new_record?).and_return(true)
|
202
|
-
end
|
203
|
-
|
204
|
-
describe "#content" do
|
205
|
-
it 'can be re-read' do
|
206
|
-
expect(af_file.content.read).to eq file_content
|
207
|
-
expect(af_file.content.read).to eq file_content
|
208
|
-
end
|
209
|
-
end
|
210
|
-
end
|
211
|
-
|
212
195
|
describe "#mime_type" do
|
213
196
|
let(:parent) { ActiveFedora::Base.create }
|
214
197
|
before do
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active-fedora
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 13.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Zumwalt
|
8
8
|
- McClain Looney
|
9
9
|
- Justin Coyne
|
10
|
-
autorequire:
|
10
|
+
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2019-08-19 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rsolr
|
@@ -126,20 +126,6 @@ dependencies:
|
|
126
126
|
- - "<"
|
127
127
|
- !ruby/object:Gem::Version
|
128
128
|
version: '2'
|
129
|
-
- !ruby/object:Gem::Dependency
|
130
|
-
name: rdf-vocab
|
131
|
-
requirement: !ruby/object:Gem::Requirement
|
132
|
-
requirements:
|
133
|
-
- - "<"
|
134
|
-
- !ruby/object:Gem::Version
|
135
|
-
version: 3.1.5
|
136
|
-
type: :runtime
|
137
|
-
prerelease: false
|
138
|
-
version_requirements: !ruby/object:Gem::Requirement
|
139
|
-
requirements:
|
140
|
-
- - "<"
|
141
|
-
- !ruby/object:Gem::Version
|
142
|
-
version: 3.1.5
|
143
129
|
- !ruby/object:Gem::Dependency
|
144
130
|
name: ruby-progressbar
|
145
131
|
requirement: !ruby/object:Gem::Requirement
|
@@ -183,7 +169,7 @@ dependencies:
|
|
183
169
|
- !ruby/object:Gem::Version
|
184
170
|
version: 0.0.4
|
185
171
|
- !ruby/object:Gem::Dependency
|
186
|
-
name:
|
172
|
+
name: rails
|
187
173
|
requirement: !ruby/object:Gem::Requirement
|
188
174
|
requirements:
|
189
175
|
- - ">="
|
@@ -197,21 +183,7 @@ dependencies:
|
|
197
183
|
- !ruby/object:Gem::Version
|
198
184
|
version: '0'
|
199
185
|
- !ruby/object:Gem::Dependency
|
200
|
-
name:
|
201
|
-
requirement: !ruby/object:Gem::Requirement
|
202
|
-
requirements:
|
203
|
-
- - "~>"
|
204
|
-
- !ruby/object:Gem::Version
|
205
|
-
version: '0.2'
|
206
|
-
type: :development
|
207
|
-
prerelease: false
|
208
|
-
version_requirements: !ruby/object:Gem::Requirement
|
209
|
-
requirements:
|
210
|
-
- - "~>"
|
211
|
-
- !ruby/object:Gem::Version
|
212
|
-
version: '0.2'
|
213
|
-
- !ruby/object:Gem::Dependency
|
214
|
-
name: github_changelog_generator
|
186
|
+
name: rdoc
|
215
187
|
requirement: !ruby/object:Gem::Requirement
|
216
188
|
requirements:
|
217
189
|
- - ">="
|
@@ -225,7 +197,7 @@ dependencies:
|
|
225
197
|
- !ruby/object:Gem::Version
|
226
198
|
version: '0'
|
227
199
|
- !ruby/object:Gem::Dependency
|
228
|
-
name:
|
200
|
+
name: yard
|
229
201
|
requirement: !ruby/object:Gem::Requirement
|
230
202
|
requirements:
|
231
203
|
- - ">="
|
@@ -239,47 +211,47 @@ dependencies:
|
|
239
211
|
- !ruby/object:Gem::Version
|
240
212
|
version: '0'
|
241
213
|
- !ruby/object:Gem::Dependency
|
242
|
-
name:
|
214
|
+
name: rake
|
243
215
|
requirement: !ruby/object:Gem::Requirement
|
244
216
|
requirements:
|
245
|
-
- - "
|
217
|
+
- - ">="
|
246
218
|
- !ruby/object:Gem::Version
|
247
|
-
version: '
|
219
|
+
version: '0'
|
248
220
|
type: :development
|
249
221
|
prerelease: false
|
250
222
|
version_requirements: !ruby/object:Gem::Requirement
|
251
223
|
requirements:
|
252
|
-
- - "
|
224
|
+
- - ">="
|
253
225
|
- !ruby/object:Gem::Version
|
254
|
-
version: '
|
226
|
+
version: '0'
|
255
227
|
- !ruby/object:Gem::Dependency
|
256
|
-
name:
|
228
|
+
name: solr_wrapper
|
257
229
|
requirement: !ruby/object:Gem::Requirement
|
258
230
|
requirements:
|
259
|
-
- - "
|
231
|
+
- - "~>"
|
260
232
|
- !ruby/object:Gem::Version
|
261
|
-
version: '0'
|
233
|
+
version: '2.0'
|
262
234
|
type: :development
|
263
235
|
prerelease: false
|
264
236
|
version_requirements: !ruby/object:Gem::Requirement
|
265
237
|
requirements:
|
266
|
-
- - "
|
238
|
+
- - "~>"
|
267
239
|
- !ruby/object:Gem::Version
|
268
|
-
version: '0'
|
240
|
+
version: '2.0'
|
269
241
|
- !ruby/object:Gem::Dependency
|
270
|
-
name:
|
242
|
+
name: fcrepo_wrapper
|
271
243
|
requirement: !ruby/object:Gem::Requirement
|
272
244
|
requirements:
|
273
|
-
- - "
|
245
|
+
- - "~>"
|
274
246
|
- !ruby/object:Gem::Version
|
275
|
-
version: '0'
|
247
|
+
version: '0.2'
|
276
248
|
type: :development
|
277
249
|
prerelease: false
|
278
250
|
version_requirements: !ruby/object:Gem::Requirement
|
279
251
|
requirements:
|
280
|
-
- - "
|
252
|
+
- - "~>"
|
281
253
|
- !ruby/object:Gem::Version
|
282
|
-
version: '0'
|
254
|
+
version: '0.2'
|
283
255
|
- !ruby/object:Gem::Dependency
|
284
256
|
name: rspec
|
285
257
|
requirement: !ruby/object:Gem::Requirement
|
@@ -309,33 +281,19 @@ dependencies:
|
|
309
281
|
- !ruby/object:Gem::Version
|
310
282
|
version: '0'
|
311
283
|
- !ruby/object:Gem::Dependency
|
312
|
-
name:
|
313
|
-
requirement: !ruby/object:Gem::Requirement
|
314
|
-
requirements:
|
315
|
-
- - "~>"
|
316
|
-
- !ruby/object:Gem::Version
|
317
|
-
version: 0.56.0
|
318
|
-
type: :development
|
319
|
-
prerelease: false
|
320
|
-
version_requirements: !ruby/object:Gem::Requirement
|
321
|
-
requirements:
|
322
|
-
- - "~>"
|
323
|
-
- !ruby/object:Gem::Version
|
324
|
-
version: 0.56.0
|
325
|
-
- !ruby/object:Gem::Dependency
|
326
|
-
name: rubocop-rspec
|
284
|
+
name: equivalent-xml
|
327
285
|
requirement: !ruby/object:Gem::Requirement
|
328
286
|
requirements:
|
329
|
-
- - "
|
287
|
+
- - ">="
|
330
288
|
- !ruby/object:Gem::Version
|
331
|
-
version:
|
289
|
+
version: '0'
|
332
290
|
type: :development
|
333
291
|
prerelease: false
|
334
292
|
version_requirements: !ruby/object:Gem::Requirement
|
335
293
|
requirements:
|
336
|
-
- - "
|
294
|
+
- - ">="
|
337
295
|
- !ruby/object:Gem::Version
|
338
|
-
version:
|
296
|
+
version: '0'
|
339
297
|
- !ruby/object:Gem::Dependency
|
340
298
|
name: simplecov
|
341
299
|
requirement: !ruby/object:Gem::Requirement
|
@@ -351,33 +309,33 @@ dependencies:
|
|
351
309
|
- !ruby/object:Gem::Version
|
352
310
|
version: '0.8'
|
353
311
|
- !ruby/object:Gem::Dependency
|
354
|
-
name:
|
312
|
+
name: rubocop
|
355
313
|
requirement: !ruby/object:Gem::Requirement
|
356
314
|
requirements:
|
357
315
|
- - "~>"
|
358
316
|
- !ruby/object:Gem::Version
|
359
|
-
version:
|
317
|
+
version: 0.56.0
|
360
318
|
type: :development
|
361
319
|
prerelease: false
|
362
320
|
version_requirements: !ruby/object:Gem::Requirement
|
363
321
|
requirements:
|
364
322
|
- - "~>"
|
365
323
|
- !ruby/object:Gem::Version
|
366
|
-
version:
|
324
|
+
version: 0.56.0
|
367
325
|
- !ruby/object:Gem::Dependency
|
368
|
-
name:
|
326
|
+
name: rubocop-rspec
|
369
327
|
requirement: !ruby/object:Gem::Requirement
|
370
328
|
requirements:
|
371
|
-
- - "
|
329
|
+
- - "~>"
|
372
330
|
- !ruby/object:Gem::Version
|
373
|
-
version:
|
331
|
+
version: 1.12.0
|
374
332
|
type: :development
|
375
333
|
prerelease: false
|
376
334
|
version_requirements: !ruby/object:Gem::Requirement
|
377
335
|
requirements:
|
378
|
-
- - "
|
336
|
+
- - "~>"
|
379
337
|
- !ruby/object:Gem::Version
|
380
|
-
version:
|
338
|
+
version: 1.12.0
|
381
339
|
description: ActiveFedora provides for creating and managing objects in the Fedora
|
382
340
|
Repository Architecture.
|
383
341
|
email:
|
@@ -759,7 +717,7 @@ homepage: https://github.com/samvera/active_fedora
|
|
759
717
|
licenses:
|
760
718
|
- Apache-2.0
|
761
719
|
metadata: {}
|
762
|
-
post_install_message:
|
720
|
+
post_install_message:
|
763
721
|
rdoc_options: []
|
764
722
|
require_paths:
|
765
723
|
- lib
|
@@ -774,8 +732,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
774
732
|
- !ruby/object:Gem::Version
|
775
733
|
version: '0'
|
776
734
|
requirements: []
|
777
|
-
rubygems_version: 3.1
|
778
|
-
signing_key:
|
735
|
+
rubygems_version: 3.0.1
|
736
|
+
signing_key:
|
779
737
|
specification_version: 4
|
780
738
|
summary: A convenience libary for manipulating documents in the Fedora Repository.
|
781
739
|
test_files: []
|