riiif 0.2.3 → 0.2.4

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: 0ec556c5a307f28203a15039180457e02b327409
4
- data.tar.gz: ae8922a640d2db6c090c787e02834c309532c10d
3
+ metadata.gz: d27a0256321086b2506eff19730afe79b72e198f
4
+ data.tar.gz: 7e4673c9759001f4176228c80d91c40f9afed2ca
5
5
  SHA512:
6
- metadata.gz: 133da6826e7516c92b4a444395b63717aa8cf3f7b4d8d0d16b00ed23dc82a58cbd44f420079a0b4da1d0eba5750a114d226006818a3fd8eea1226c2cfb38baca
7
- data.tar.gz: a312a088e61d9221e1071505bc8eb5303980ad60527d3b4eb62f9a3db2c84466816bd00db6ea7f4162be96905f83d1863dcd97fb1014dd677984a0b2596830e5
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
- iiif_for 'riiif/image', at: '/image-service'
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
- redirect_to main_app.info_path(params[:id])
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
@@ -1,3 +1,3 @@
1
1
  module Riiif
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end
@@ -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 "/image-service/abcd%2F1234"
6
- expect(response).to redirect_to ('/image-service/abcd%2F1234/info.json')
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
@@ -4,7 +4,7 @@ class TestAppGenerator < Rails::Generators::Base
4
4
  source_root "spec/test_app_templates"
5
5
 
6
6
  def add_routes
7
- route "iiif_for 'riiif/image', at: '/image-service'"
7
+ route "mount Riiif::Engine => '/images', as: 'riiif'"
8
8
  end
9
9
 
10
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: riiif
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne