riiif 2.1.0 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +6 -1
- data/Gemfile +1 -8
- data/README.md +3 -3
- data/app/resolvers/riiif/http_file_resolver.rb +2 -2
- data/lib/riiif.rb +2 -0
- data/lib/riiif/version.rb +1 -1
- data/riiif.gemspec +1 -1
- data/spec/models/riiif/http_file_resolver_spec.rb +1 -1
- data/spec/models/riiif/image_spec.rb +2 -2
- metadata +5 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b79bb6c8082dc7033167055a4f335122b60ac337c0eaf9b3b49a1b9119741edb
|
4
|
+
data.tar.gz: 32ef6a3ecfb7b3cec38e3ffe5189f499bc002fdaf06b0307face66f5ee8ad239
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e1f6cbb5ac851d0e6b86d27af6d68643dc4c3ab7da1eb0e61d884634bb2e9d8c56679becb1c98ccda2c4c119cf7926c0416386c1b91b0489eb88c4a106a63c5
|
7
|
+
data.tar.gz: 0f5ac5d03dc707c2a14b5a720a393192611adec04ab40407b7ce3e7c49e0ea0ccb0df9d0607d7da4f7689a2d69f67c358e60a26150afd661e7522a0049fb323b
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
@@ -28,13 +28,6 @@ else
|
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
|
-
|
32
|
-
when /^4.2/
|
33
|
-
gem 'responders', '~> 2.0'
|
34
|
-
gem 'sass-rails', '>= 5.0'
|
35
|
-
gem 'coffee-rails', '~> 4.1.0'
|
36
|
-
when /^4.[01]/
|
37
|
-
gem 'sass-rails', '< 5.0'
|
38
|
-
end
|
31
|
+
gem 'sass-rails', '~> 5.0'
|
39
32
|
end
|
40
33
|
# END ENGINE_CART BLOCK
|
data/README.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
[![Coverage Status](https://coveralls.io/repos/github/curationexperts/riiif/badge.svg?branch=master)](https://coveralls.io/github/curationexperts/riiif?branch=master)
|
4
4
|
|
5
5
|
|
6
|
-
A Ruby IIIF image server as a rails engine
|
6
|
+
A Ruby IIIF image server as a rails engine. Note that RIIIF is meant for development convenience and will not scale to the needs of most production-level applications.
|
7
7
|
|
8
8
|
## Installation
|
9
9
|
|
@@ -48,7 +48,7 @@ When the Id passed in is "foo_image", then it will look for an image file using
|
|
48
48
|
### Images retrieved over HTTP
|
49
49
|
It's preferable to use files on the filesystem, because this avoids the overhead of downloading the file. If this is unavoidable, Riiif can be configured to fetch files from the network. To enable this behavior, configure Riiif to use an alternative resolver:
|
50
50
|
```
|
51
|
-
Riiif::Image.file_resolver = Riiif::
|
51
|
+
Riiif::Image.file_resolver = Riiif::HttpFileResolver.new
|
52
52
|
```
|
53
53
|
Then we configure the resolver with a mechanism for mapping the provided id to a url:
|
54
54
|
```
|
@@ -154,7 +154,7 @@ Create an initializer like this in `config/initializers/riiif_initializer.rb`
|
|
154
154
|
|
155
155
|
```ruby
|
156
156
|
# Tell RIIIF to get files via HTTP (not from the local disk)
|
157
|
-
Riiif::Image.file_resolver = Riiif::
|
157
|
+
Riiif::Image.file_resolver = Riiif::HttpFileResolver.new
|
158
158
|
|
159
159
|
# This tells RIIIF how to resolve the identifier to a URI in Fedora
|
160
160
|
Riiif::Image.file_resolver.id_to_uri = lambda do |id|
|
@@ -2,11 +2,11 @@ require 'open-uri'
|
|
2
2
|
require 'active_support/core_ext/file/atomic'
|
3
3
|
|
4
4
|
module Riiif
|
5
|
-
class
|
5
|
+
class HttpFileResolver
|
6
6
|
# Set a lambda that maps the first parameter (id) to a URL
|
7
7
|
# Example:
|
8
8
|
#
|
9
|
-
# resolver = Riiif::
|
9
|
+
# resolver = Riiif::HttpFileResolver.new
|
10
10
|
# resolver.id_to_uri = lambda do |id|
|
11
11
|
# "http://upload.wikimedia.org/wikipedia/commons/thumb/a/a4/#{id}.jpg/600px-#{id}.jpg"
|
12
12
|
# end
|
data/lib/riiif.rb
CHANGED
@@ -12,6 +12,8 @@ module Riiif
|
|
12
12
|
# This error is raised when Riiif can't convert an image
|
13
13
|
class ConversionError < Error; end
|
14
14
|
|
15
|
+
HTTPFileResolver = ActiveSupport::Deprecation::DeprecatedConstantProxy.new('Riiif::HTTPFileResolver', 'Riiif::HttpFileResolver')
|
16
|
+
|
15
17
|
mattr_accessor :not_found_image # the image to use when a lookup fails
|
16
18
|
mattr_accessor :unauthorized_image # the image to use when a user doesn't have access
|
17
19
|
|
data/lib/riiif/version.rb
CHANGED
data/riiif.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ['lib']
|
20
20
|
|
21
|
-
spec.add_dependency 'railties', '>= 4.2', '<
|
21
|
+
spec.add_dependency 'railties', '>= 4.2', '<7'
|
22
22
|
spec.add_dependency 'deprecation', '>= 1.0.0'
|
23
23
|
spec.add_dependency 'iiif-image-api', '~> 0.1.0'
|
24
24
|
spec.add_development_dependency 'bundler'
|
@@ -39,9 +39,9 @@ RSpec.describe Riiif::Image do
|
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
|
-
context 'using
|
42
|
+
context 'using HttpFileResolver' do
|
43
43
|
before do
|
44
|
-
described_class.file_resolver = Riiif::
|
44
|
+
described_class.file_resolver = Riiif::HttpFileResolver.new
|
45
45
|
described_class.file_resolver.id_to_uri = lambda do |id|
|
46
46
|
"https://upload.wikimedia.org/wikipedia/commons/thumb/a/a4/#{id}.jpg/600px-#{id}.jpg"
|
47
47
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: riiif
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Coyne
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-11-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '4.2'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
22
|
+
version: '7'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: '4.2'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
32
|
+
version: '7'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: deprecation
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -233,8 +233,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
233
233
|
- !ruby/object:Gem::Version
|
234
234
|
version: '0'
|
235
235
|
requirements: []
|
236
|
-
|
237
|
-
rubygems_version: 2.7.9
|
236
|
+
rubygems_version: 3.0.3
|
238
237
|
signing_key:
|
239
238
|
specification_version: 4
|
240
239
|
summary: A rails engine that support IIIF requests
|