riiif 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/app/controllers/riiif/images_controller.rb +2 -1
- data/lib/riiif/version.rb +1 -1
- data/spec/controllers/images_controller_spec.rb +1 -1
- data/spec/routing/redirect_spec.rb +2 -2
- data/spec/routing/resize_routes_spec.rb +3 -3
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d27a0256321086b2506eff19730afe79b72e198f
|
4
|
+
data.tar.gz: 7e4673c9759001f4176228c80d91c40f9afed2ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c38c62c7772d793ddc74250b89d98b8d694a09f871f77e848d7d26da24b02e3d34305cb9543f6c03b02facf11249229414ba28f359b01cef3972bc73c74587f
|
7
|
+
data.tar.gz: c1a52a6d8ace9585c4d4d267c175d7ab2a8ba227762860e627dc6ecd4cd2db047de4612a5f90b5d1696139a93bbec97276a1d5b5b9c807a3fa3b864415a7a5df
|
data/README.md
CHANGED
@@ -67,7 +67,7 @@ By default the cache is located in `tmp/network_files`. You can set the cache pa
|
|
67
67
|
|
68
68
|
Add the routes to your application by inserting the following line into `config/routes.rb`
|
69
69
|
```
|
70
|
-
|
70
|
+
mount Riiif::Engine => '/image-service', as: 'riiif'
|
71
71
|
```
|
72
72
|
|
73
73
|
Then you can make requests like this:
|
@@ -34,7 +34,8 @@ module Riiif
|
|
34
34
|
|
35
35
|
# this is a workaround for https://github.com/rails/rails/issues/25087
|
36
36
|
def redirect
|
37
|
-
|
37
|
+
# This was attempted with just info_path, but it gave a NoMethodError
|
38
|
+
redirect_to Riiif::Engine.routes.url_helpers.info_path(params[:id])
|
38
39
|
end
|
39
40
|
|
40
41
|
protected
|
data/lib/riiif/version.rb
CHANGED
@@ -97,7 +97,7 @@ describe Riiif::ImagesController do
|
|
97
97
|
expect(response).to be_successful
|
98
98
|
json = JSON.parse(response.body)
|
99
99
|
expect(json).to eq "@context" => "http://iiif.io/api/image/2/context.json",
|
100
|
-
"@id" =>"http://test.host/abcd1234",
|
100
|
+
"@id" =>"http://test.host/images/abcd1234",
|
101
101
|
"width" =>6000,
|
102
102
|
"height" =>4000,
|
103
103
|
"profile" => ["http://iiif.io/api/image/2/level1.json", "formats" => ["jpg", "png"]],
|
@@ -2,7 +2,7 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe "GET /abcd%2F1234", type: :request do
|
4
4
|
it "redirects, without unescaping" do
|
5
|
-
get "/
|
6
|
-
expect(response).to redirect_to ('/
|
5
|
+
get "/images/abcd%2F1234"
|
6
|
+
expect(response).to redirect_to ('/images/abcd%2F1234/info.json')
|
7
7
|
end
|
8
8
|
end
|
@@ -37,10 +37,10 @@ describe "routes" do
|
|
37
37
|
describe "route helper" do
|
38
38
|
it "takes all the options" do
|
39
39
|
expect(image_path('abcd1234', region: 'full', size: '100,50', rotation: '22.5', quality: 'default',
|
40
|
-
format: 'jpg')).to eq '/abcd1234/full/100,50/22.5/default.jpg'
|
40
|
+
format: 'jpg')).to eq '/images/abcd1234/full/100,50/22.5/default.jpg'
|
41
41
|
end
|
42
42
|
it "has defaults" do
|
43
|
-
expect(image_path('abcd1234', size: '100,50')).to eq '/abcd1234/full/100,50/0/default.jpg'
|
43
|
+
expect(image_path('abcd1234', size: '100,50')).to eq '/images/abcd1234/full/100,50/0/default.jpg'
|
44
44
|
end
|
45
45
|
end
|
46
46
|
end
|
@@ -53,7 +53,7 @@ describe "routes" do
|
|
53
53
|
action: "info", format: 'json', model: "riiif/image")
|
54
54
|
end
|
55
55
|
it "should have a route helper" do
|
56
|
-
expect(info_path('abcd1234')).to eq '/abcd1234/info.json'
|
56
|
+
expect(info_path('abcd1234')).to eq '/images/abcd1234/info.json'
|
57
57
|
end
|
58
58
|
end
|
59
59
|
end
|