iiif-presentation 1.4.1 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/iiif/v3/abstract_resource.rb +9 -18
- data/spec/integration/iiif/v3/abstract_resource_spec.rb +1 -0
- data/spec/unit/iiif/v3/abstract_resource_spec.rb +7 -15
- data/spec/unit/iiif/v3/presentation/manifest_spec.rb +1 -3
- data/spec/unit/iiif/v3/presentation/sequence_spec.rb +2 -2
- metadata +3 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e5872ac7de857fa05e0181916f712460413e5b08b09d0b99867cc14ae39e0e5
|
4
|
+
data.tar.gz: 213166e3e00800955380ed432a1b10fce3a497011af92db4657474ef56e4b2aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 840576064059d424a68fc9917e30a6a2bc120fb7157691fae70edadaa705711301fd175a3942ce227298086c934ae0f0f471b8379a00314da9aea7b068643b07
|
7
|
+
data.tar.gz: 308dd4b3bcd7b4dfbfaa5147a4d0208dfaedaa69265577b43fd46e04e59be8f95f12a92667a12c935d07a534e6ef271ea2ce9d50dbc449b5a2af1a800b0a51d9
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.4.
|
1
|
+
1.4.2
|
@@ -31,11 +31,11 @@ module IIIF
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def string_only_keys
|
34
|
-
%w{ nav_date type format viewing_direction start_canvas }
|
34
|
+
%w{ nav_date type format rights viewing_direction start_canvas }
|
35
35
|
end
|
36
36
|
|
37
37
|
def array_only_keys
|
38
|
-
%w{ metadata
|
38
|
+
%w{ metadata thumbnail rendering first last next prev items service }
|
39
39
|
end
|
40
40
|
|
41
41
|
def hash_only_keys
|
@@ -122,10 +122,9 @@ module IIIF
|
|
122
122
|
end
|
123
123
|
end
|
124
124
|
|
125
|
-
|
125
|
+
uri_only_keys.each do |k|
|
126
126
|
if self[k]
|
127
|
-
|
128
|
-
vals.each { |val| validate_uri(val, k) }
|
127
|
+
Array(self[k]).each { |val| validate_uri(val, k) }
|
129
128
|
end
|
130
129
|
end
|
131
130
|
|
@@ -187,20 +186,12 @@ module IIIF
|
|
187
186
|
raise IIIF::V3::Presentation::IllegalValueError, m
|
188
187
|
end
|
189
188
|
end
|
190
|
-
|
191
|
-
if
|
192
|
-
|
193
|
-
|
194
|
-
raise IIIF::V3::Presentation::IllegalValueError, m
|
195
|
-
end
|
196
|
-
self['rights'].each do |entry|
|
197
|
-
unless entry.keys.include?('id')
|
198
|
-
m = 'rights members must be a Hash including "id"'
|
199
|
-
raise IIIF::V3::Presentation::IllegalValueError, m
|
200
|
-
end
|
201
|
-
validate_uri(entry['id'], 'id') # raises IllegalValueError
|
202
|
-
end
|
189
|
+
|
190
|
+
if key?('rights') && !self['rights'].kind_of?(String)
|
191
|
+
m = 'rights must be a String'
|
192
|
+
raise IIIF::V3::Presentation::IllegalValueError, m
|
203
193
|
end
|
194
|
+
|
204
195
|
# rendering is Array; each entry is a Hash containing 'label' and 'format' keys
|
205
196
|
if self.has_key?('rendering') && self['rendering']
|
206
197
|
unless self['rendering'].all? { |entry| entry.kind_of?(Hash) }
|
@@ -139,27 +139,19 @@ describe IIIF::V3::AbstractResource do
|
|
139
139
|
expect { subject.validate }.to raise_error(IIIF::V3::Presentation::IllegalValueError, exp_err_msg)
|
140
140
|
end
|
141
141
|
end
|
142
|
+
|
142
143
|
describe 'rights' do
|
143
|
-
it 'raises IllegalValueError for entry that is not a
|
144
|
+
it 'raises IllegalValueError for entry that is not a string' do
|
144
145
|
subject['rights'] = ['error']
|
145
|
-
|
146
|
-
expect { subject.validate }.to raise_error(IIIF::V3::Presentation::IllegalValueError, exp_err_msg)
|
146
|
+
expect { subject.validate }.to raise_error(IIIF::V3::Presentation::IllegalValueError)
|
147
147
|
end
|
148
|
-
|
149
|
-
|
148
|
+
|
149
|
+
it 'does not raise error for entry that is string' do
|
150
|
+
subject['rights'] = 'http://example.org/rights'
|
150
151
|
expect { subject.validate }.not_to raise_error
|
151
152
|
end
|
152
|
-
it 'raises IllegalValueError for entry with "id" that is not URI' do
|
153
|
-
subject['rights'] = [{ 'id' => 'bar', 'format' => 'text/html' }]
|
154
|
-
exp_err_msg = "id value must be a String containing a URI for #{subject.class}"
|
155
|
-
expect { subject.validate }.to raise_error(IIIF::V3::Presentation::IllegalValueError, exp_err_msg)
|
156
|
-
end
|
157
|
-
it 'raises IllegalValueError for entry that does not contain "id"' do
|
158
|
-
subject['rights'] = [{ 'whoops' => 'http://example.org/rights' }]
|
159
|
-
exp_err_msg = 'rights members must be a Hash including "id"'
|
160
|
-
expect { subject.validate }.to raise_error(IIIF::V3::Presentation::IllegalValueError, exp_err_msg)
|
161
|
-
end
|
162
153
|
end
|
154
|
+
|
163
155
|
describe 'rendering' do
|
164
156
|
it 'raises IllegalValueError for entry that is not a Hash' do
|
165
157
|
subject['rendering'] = ['error']
|
@@ -322,9 +322,7 @@ describe IIIF::V3::Presentation::Manifest do
|
|
322
322
|
"viewingDirection" => "right-to-left",
|
323
323
|
"viewingHint" => ["paged"],
|
324
324
|
"navDate" => "1856-01-01T00:00:00Z",
|
325
|
-
"rights" =>
|
326
|
-
"id" =>"http://example.org/license.html",
|
327
|
-
"format" => "text/html"}],
|
325
|
+
"rights" => "http://example.org/license.html",
|
328
326
|
"requiredStatement" => {
|
329
327
|
"label": { "en": [ "Attribution" ] },
|
330
328
|
"value": { "en": [ "bleah" ] },
|
@@ -96,7 +96,7 @@ describe IIIF::V3::Presentation::Sequence do
|
|
96
96
|
expect(sequence_object.items.first).to eq canvas_object
|
97
97
|
end
|
98
98
|
end
|
99
|
-
|
99
|
+
|
100
100
|
describe 'example from Stanford purl' do
|
101
101
|
let(:seq_id) { 'https://example.org/abc666#sequence-1' }
|
102
102
|
let(:sequence_object) {
|
@@ -184,7 +184,7 @@ describe IIIF::V3::Presentation::Sequence do
|
|
184
184
|
}]
|
185
185
|
}],
|
186
186
|
'attribution' => 'Provided by Example Organization',
|
187
|
-
'rights' =>
|
187
|
+
'rights' => 'Sample rights',
|
188
188
|
'logo' => 'http://www.example.org/logos/institution1.jpg',
|
189
189
|
'see_also' => 'http://www.example.org/library/catalog/book1.xml',
|
190
190
|
'service' => [{
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iiif-presentation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Stroop
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: bundler
|
@@ -270,7 +269,6 @@ homepage: https://github.com/iiif/osullivan
|
|
270
269
|
licenses:
|
271
270
|
- Simplified BSD
|
272
271
|
metadata: {}
|
273
|
-
post_install_message:
|
274
272
|
rdoc_options: []
|
275
273
|
require_paths:
|
276
274
|
- lib
|
@@ -285,8 +283,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
285
283
|
- !ruby/object:Gem::Version
|
286
284
|
version: '0'
|
287
285
|
requirements: []
|
288
|
-
rubygems_version: 3.
|
289
|
-
signing_key:
|
286
|
+
rubygems_version: 3.6.9
|
290
287
|
specification_version: 4
|
291
288
|
summary: API for working with IIIF Presentation manifests.
|
292
289
|
test_files:
|