riiif 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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad367b2b2d10b9b46d5944b0d69a3aaf62fe3cdc
|
4
|
+
data.tar.gz: 2546fdcfb0322e87f841bd4974b7ff6afbb7772c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf4a63d5b3f3f81500979374454464cf17daf1b0bd14103a86d4d6e49f38e8aa25cb1f23d5065ce89da0cf5b327c893317b1d33509c760abd1e75965e60c4044
|
7
|
+
data.tar.gz: b918a8c2af312223d20e20cfbeb3e0b7b07b42e742f3bf88186791ae1c83937ebf84360ebccc27cce174938927c81967e9726b7ccb32f579d144368adeca4231
|
data/lib/riiif.rb
CHANGED
@@ -12,16 +12,12 @@ module Riiif
|
|
12
12
|
|
13
13
|
class Error < RuntimeError; end
|
14
14
|
class InvalidAttributeError < Error; end
|
15
|
-
class ImageNotFoundError < Error
|
16
|
-
attr_reader :original_exception
|
17
|
-
def initialize(orig = nil)
|
18
|
-
@original_exception = orig
|
19
|
-
end
|
20
|
-
end
|
15
|
+
class ImageNotFoundError < Error; end
|
21
16
|
# This error is raised when Riiif can't convert an image
|
22
17
|
class ConversionError < Error; end
|
23
18
|
|
24
19
|
Transformation = Struct.new(:crop, :size, :quality, :rotation, :format)
|
25
20
|
ImageInformation = Struct.new(:width, :height)
|
26
21
|
mattr_accessor :not_found_image # the image to use when a lookup fails
|
22
|
+
mattr_accessor :unauthorized_image # the image to use when a lookup fails
|
27
23
|
end
|
data/lib/riiif/version.rb
CHANGED
@@ -5,6 +5,20 @@ describe Riiif::ImagesController do
|
|
5
5
|
let(:filename) { File.expand_path('spec/samples/world.jp2') }
|
6
6
|
routes { Riiif::Engine.routes }
|
7
7
|
|
8
|
+
describe '#error_image' do
|
9
|
+
context 'with unauthorized' do
|
10
|
+
around do |example|
|
11
|
+
old_value = Riiif.unauthorized_image
|
12
|
+
Riiif.unauthorized_image = filename
|
13
|
+
example.run
|
14
|
+
Riiif.unauthorized_image = old_value
|
15
|
+
end
|
16
|
+
subject { controller.send(:error_image, :unauthorized) }
|
17
|
+
it 'gives the path to the image' do
|
18
|
+
subject
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
8
22
|
describe '#show' do
|
9
23
|
it 'sends images to the service' do
|
10
24
|
image = double
|
@@ -17,7 +17,7 @@ describe Riiif::HTTPFileResolver do
|
|
17
17
|
rescue Riiif::ImageNotFoundError => e
|
18
18
|
end
|
19
19
|
expect(e).to be_a Riiif::ImageNotFoundError
|
20
|
-
expect(e.
|
20
|
+
expect(e.message).to eq 'failure'
|
21
21
|
end
|
22
22
|
|
23
23
|
context 'when basic authentication credentials are set' do
|
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: 1.4.
|
4
|
+
version: 1.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Coyne
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|