triannon 0.4.0 → 0.4.1
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 +4 -4
- data/config/routes.rb +13 -5
- data/lib/triannon/version.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: fe781b6ecd92bc4a8862c0be6d1d16964be6a197
|
4
|
+
data.tar.gz: afde4024d9b2fb317f359c99a3cc2828de69bca7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f56d27f5281ab3fe37705bc0314a612c2f4c81f4c8556018e21cf78234417b555049cd75ef3448d50367be654eee261d6892bbaef9d60decfce657627495742
|
7
|
+
data.tar.gz: b1e61108016b1c7e348e27aad4e85f799f02fc91a1a056c754eca8ecbd996944cf21321cb898f21729fa817f6efd439fc435fc5715c5a0dc0a8699230742b540
|
data/config/routes.rb
CHANGED
@@ -1,18 +1,26 @@
|
|
1
1
|
Triannon::Engine.routes.draw do
|
2
2
|
root to: 'annotations#index'
|
3
3
|
|
4
|
-
# show action must explicitly forbid "iiif"
|
5
|
-
# figure out how to do it with regexp constraint since beginning and end
|
4
|
+
# show action must explicitly forbid "new", "iiif" and "oa" as id values; couldn't
|
5
|
+
# figure out how to do it with regexp constraint since beginning and end regex
|
6
6
|
# matchers aren't allowed when enforcing formats for segment (e.g. :id)
|
7
7
|
get '/annotations/:id(.:format)', to: 'annotations#show',
|
8
8
|
constraints: lambda { |request|
|
9
9
|
id = request.env["action_dispatch.request.path_parameters"][:id]
|
10
|
-
id !~ /^iiif$/ && id !~ /^oa$/
|
10
|
+
id !~ /^new$/ && id !~ /^iiif$/ && id !~ /^oa$/
|
11
11
|
}
|
12
12
|
|
13
13
|
resources :annotations, :except => [:update, :edit, :show]
|
14
14
|
|
15
|
-
# allow jsonld context in path
|
16
|
-
|
15
|
+
# allow jsonld context in path (only allow iiif or oa as values)
|
16
|
+
# must explicitly forbid "new" as id values; couldn't
|
17
|
+
# figure out how to do it with regexp constraint since beginning and end regex
|
18
|
+
# matchers aren't allowed when enforcing formats for segment (e.g. :id)
|
19
|
+
get '/annotations/:jsonld_context/:id(.:format)', to: 'annotations#show',
|
20
|
+
constraints: lambda { |request|
|
21
|
+
jsonld_context = request.env["action_dispatch.request.path_parameters"][:jsonld_context]
|
22
|
+
id = request.env["action_dispatch.request.path_parameters"][:id]
|
23
|
+
(jsonld_context =~ /^iiif$/ || jsonld_context =~ /^oa$/ ) && id !~ /^new$/
|
24
|
+
}
|
17
25
|
|
18
26
|
end
|
data/lib/triannon/version.rb
CHANGED