iiif-presentation 0.1.0 → 0.2.0
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/.travis.yml +1 -1
- data/README.md +3 -3
- data/VERSION +1 -1
- data/iiif-presentation.gemspec +1 -1
- data/lib/iiif/presentation/image_resource.rb +1 -1
- data/lib/iiif/service.rb +1 -1
- data/spec/integration/iiif/presentation/image_resource_spec.rb +2 -4
- data/spec/spec_helper.rb +8 -1
- data/spec/unit/iiif/presentation/image_resource_spec.rb +2 -2
- data/spec/unit/iiif/service_spec.rb +18 -0
- metadata +7 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d2ae4eba89da3249e90fd07899b0c959a2ad6d1
|
4
|
+
data.tar.gz: 2b9d3fb56e25a15c4d66f1d8b44488a873a3adba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30779f16f6794adfac654ea104a49a5d4970a28248fde2b93fdc941e55f2da3bb050fd046ea2fdcde639886ce3cc3a0a71550be74acbce139cd8c123928944a4
|
7
|
+
data.tar.gz: 6c14f0bf0d3c3a5ea647372267634768f8a6ef9dde304c68a5ed0c598e22f937fcd4428d653cb73cd2871123f00f828cdeb56626d0a6bf8d37a786637df5cbdf
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
# O'Sullivan: A Ruby API for working with IIIF Presentation manifests
|
2
2
|
|
3
|
-
[](https://travis-ci.org/iiif-prezi/osullivan)
|
4
|
+
[](https://coveralls.io/github/iiif-prezi/osullivan?branch=development)
|
5
5
|
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
9
|
-
From the source code do `rake install`, or get the latest release [from RubyGems](https://rubygems.org/gems/
|
9
|
+
From the source code do `rake install`, or get the latest release [from RubyGems](https://rubygems.org/gems/iiif-presentation).
|
10
10
|
|
11
11
|
## Building New Objects
|
12
12
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0
|
data/iiif-presentation.gemspec
CHANGED
data/lib/iiif/service.rb
CHANGED
@@ -241,7 +241,7 @@ module IIIF
|
|
241
241
|
|
242
242
|
# All known subclasses of service.
|
243
243
|
def self.all_service_subclasses
|
244
|
-
@all_service_subclasses ||= IIIF::Service.descendants
|
244
|
+
@all_service_subclasses ||= IIIF::Service.descendants.reject(&:singleton_class?)
|
245
245
|
end
|
246
246
|
|
247
247
|
def data=(hsh)
|
@@ -32,7 +32,7 @@ describe IIIF::Presentation::ImageResource do
|
|
32
32
|
# expect(resource['@context']).to eq 'http://iiif.io/api/presentation/2/context.json'
|
33
33
|
# @context is only added when we call to_json...
|
34
34
|
expect(resource['@id']).to eq 'http://libimages.princeton.edu/loris2/pudl0001%2F4612422%2F00000001.jp2/full/!200,200/0/default.jpg'
|
35
|
-
expect(resource['@type']).to eq '
|
35
|
+
expect(resource['@type']).to eq 'dctypes:Image'
|
36
36
|
expect(resource.format).to eq "image/jpeg"
|
37
37
|
expect(resource.width).to eq 3047
|
38
38
|
expect(resource.height).to eq 7200
|
@@ -44,7 +44,7 @@ describe IIIF::Presentation::ImageResource do
|
|
44
44
|
opts = { service_id: valid_service_id, copy_info: true }
|
45
45
|
resource = described_class.create_image_api_image_resource(opts)
|
46
46
|
expect(resource['@id']).to eq 'http://libimages.princeton.edu/loris2/pudl0001%2F4612422%2F00000001.jp2/full/!200,200/0/default.jpg'
|
47
|
-
expect(resource['@type']).to eq '
|
47
|
+
expect(resource['@type']).to eq 'dctypes:Image'
|
48
48
|
expect(resource.format).to eq "image/jpeg"
|
49
49
|
expect(resource.width).to eq 3047
|
50
50
|
expect(resource.height).to eq 7200
|
@@ -119,5 +119,3 @@ describe IIIF::Presentation::ImageResource do
|
|
119
119
|
|
120
120
|
end
|
121
121
|
end
|
122
|
-
|
123
|
-
|
data/spec/spec_helper.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'iiif/presentation'
|
2
|
+
require 'simplecov'
|
2
3
|
require 'coveralls'
|
3
4
|
Dir["#{File.dirname(__FILE__)}/unit/iiif/presentation/shared_examples/*.rb"].each do |f|
|
4
5
|
require f
|
@@ -11,7 +12,13 @@ VCR.configure do |c|
|
|
11
12
|
c.configure_rspec_metadata!
|
12
13
|
end
|
13
14
|
|
14
|
-
|
15
|
+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
16
|
+
SimpleCov::Formatter::HTMLFormatter,
|
17
|
+
Coveralls::SimpleCov::Formatter
|
18
|
+
]
|
19
|
+
SimpleCov.start do
|
20
|
+
add_filter 'spec/'
|
21
|
+
end
|
15
22
|
|
16
23
|
# This file was generated by the `rspec --init` command. Conventionally, all
|
17
24
|
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
@@ -1,8 +1,8 @@
|
|
1
1
|
describe IIIF::Presentation::ImageResource do
|
2
2
|
|
3
3
|
describe '#initialize' do
|
4
|
-
it 'sets @type to
|
5
|
-
expect(subject['@type']).to eq '
|
4
|
+
it 'sets @type to dctypes:Image' do
|
5
|
+
expect(subject['@type']).to eq 'dctypes:Image'
|
6
6
|
end
|
7
7
|
end
|
8
8
|
|
@@ -1,10 +1,28 @@
|
|
1
1
|
describe IIIF::Service do
|
2
2
|
|
3
3
|
describe 'self#get_descendant_class_by_jld_type' do
|
4
|
+
before do
|
5
|
+
class DummyClass < IIIF::Service
|
6
|
+
TYPE = "sc:Collection"
|
7
|
+
def self.singleton_class?
|
8
|
+
true
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
after do
|
13
|
+
Object.send(:remove_const, :DummyClass)
|
14
|
+
end
|
4
15
|
it 'gets the right class' do
|
5
16
|
klass = described_class.get_descendant_class_by_jld_type('sc:Canvas')
|
6
17
|
expect(klass).to be IIIF::Presentation::Canvas
|
7
18
|
end
|
19
|
+
context "when there are singleton classes which are returned" do
|
20
|
+
it "gets the right class" do
|
21
|
+
allow(IIIF::Service).to receive(:descendants).and_return([DummyClass, IIIF::Presentation::Collection])
|
22
|
+
klass = described_class.get_descendant_class_by_jld_type('sc:Collection')
|
23
|
+
expect(klass).to be IIIF::Presentation::Collection
|
24
|
+
end
|
25
|
+
end
|
8
26
|
end
|
9
27
|
|
10
28
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iiif-presentation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Stroop
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -140,16 +140,16 @@ dependencies:
|
|
140
140
|
name: faraday
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
|
-
- - "
|
143
|
+
- - ">="
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: 0.9
|
145
|
+
version: '0.9'
|
146
146
|
type: :runtime
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
|
-
- - "
|
150
|
+
- - ">="
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: 0.9
|
152
|
+
version: '0.9'
|
153
153
|
description: API for working with IIIF Presentation manifests.
|
154
154
|
email:
|
155
155
|
- jpstroop@gmail.com
|
@@ -229,7 +229,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
229
229
|
version: '0'
|
230
230
|
requirements: []
|
231
231
|
rubyforge_project:
|
232
|
-
rubygems_version: 2.5.
|
232
|
+
rubygems_version: 2.5.2
|
233
233
|
signing_key:
|
234
234
|
specification_version: 4
|
235
235
|
summary: API for working with IIIF Presentation manifests.
|
@@ -260,4 +260,3 @@ test_files:
|
|
260
260
|
- spec/unit/iiif/presentation/shared_examples/int_only_keys.rb
|
261
261
|
- spec/unit/iiif/presentation/shared_examples/string_only_keys.rb
|
262
262
|
- spec/unit/iiif/service_spec.rb
|
263
|
-
has_rdoc:
|