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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 136f2338c1c913c7a28bc3beff44986c274ff9a7
4
- data.tar.gz: 286915f2245cce194b378b21a8790f39ccf0e16b
3
+ metadata.gz: 5d2ae4eba89da3249e90fd07899b0c959a2ad6d1
4
+ data.tar.gz: 2b9d3fb56e25a15c4d66f1d8b44488a873a3adba
5
5
  SHA512:
6
- metadata.gz: 3ffb123653fe951624635cf0f7499f1a34e099a5e44b8a63f5fbae19b43751b3ce44337c251bd46c5337ca719d514a2f48fc87484309061bba18e63ccd227a50
7
- data.tar.gz: 0c8acd7f1e9b253cd32ec90cbc855c9666d94552728e4d72858a7d751207c088aafa21a03522ab58c9308ea44e5e818b8bdcff3a326709103ef4c88bb1e79b3a
6
+ metadata.gz: 30779f16f6794adfac654ea104a49a5d4970a28248fde2b93fdc941e55f2da3bb050fd046ea2fdcde639886ce3cc3a0a71550be74acbce139cd8c123928944a4
7
+ data.tar.gz: 6c14f0bf0d3c3a5ea647372267634768f8a6ef9dde304c68a5ed0c598e22f937fcd4428d653cb73cd2871123f00f828cdeb56626d0a6bf8d37a786637df5cbdf
@@ -1,7 +1,7 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.9.3
4
3
  - 2.1.0
4
+ - 2.3.0
5
5
  install:
6
6
  - "gem install bundler"
7
7
  - "bundle install --jobs=3 --retry=3"
data/README.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # O'Sullivan: A Ruby API for working with IIIF Presentation manifests
2
2
 
3
- [![Build Status](https://travis-ci.org/IIIF/osullivan.svg?branch=development)](https://travis-ci.org/IIIF/osullivan)
4
- [![Coverage Status](https://coveralls.io/repos/IIIF/osullivan/badge.svg?branch=development&service=github)](https://coveralls.io/github/IIIF/osullivan?branch=development)
3
+ [![Build Status](https://travis-ci.org/iiif-prezi/osullivan.svg?branch=development)](https://travis-ci.org/iiif-prezi/osullivan)
4
+ [![Coverage Status](https://coveralls.io/repos/github/iiif-prezi/osullivan/badge.svg?branch=development)](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/osullivan).
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
1
+ 0.2.0
@@ -24,5 +24,5 @@ Gem::Specification.new do |spec|
24
24
 
25
25
  spec.add_dependency 'json'
26
26
  spec.add_dependency 'activesupport', '>= 3.2.18'
27
- spec.add_dependency 'faraday', '~> 0.9.0'
27
+ spec.add_dependency 'faraday', '>= 0.9'
28
28
  end
@@ -13,7 +13,7 @@ module IIIF
13
13
  end
14
14
 
15
15
  def initialize(hsh={})
16
- hsh['@type'] = 'dcterms:Image' unless hsh.has_key? '@type'
16
+ hsh['@type'] = TYPE unless hsh.has_key? '@type'
17
17
  super(hsh)
18
18
  end
19
19
 
@@ -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 'dcterms:Image'
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 'dcterms:Image'
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
-
@@ -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
- Coveralls.wear!
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 dcterms:Image' do
5
- expect(subject['@type']).to eq 'dcterms:Image'
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.1.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: 2016-05-13 00:00:00.000000000 Z
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.0
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.0
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.1
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: