parliament-utils 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d050ead54413d5e5add3db477f62722452ff0cfb
|
4
|
+
data.tar.gz: 1426f74fdbe7abb1cc2d940281f80afd7b03622d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3277280384cf8071914ab3db7150d589bfe48f1721c0aadab9cf4a6a395c17df686cfab733b8fee5a050e714fad0d320b354b8f7a7607b122f86691f001b1e6f
|
7
|
+
data.tar.gz: e65d6abe42df7bcb7c6c325c2e19c6389edf25adc80bf65370c1eb7ceec34f8877926c1e5b3fc4a2e747b3a419044b7fa0cf8b4d2877141500a773003b0a0c07
|
@@ -23,7 +23,13 @@ module Parliament
|
|
23
23
|
raise StandardError, 'Data URL does not exist' if @data_url.nil?
|
24
24
|
|
25
25
|
response.headers['Accept'] = request.formats.first
|
26
|
-
|
26
|
+
# Store format_type if format in url is json or xml
|
27
|
+
request.path_parameters[:format] == 'json' || request.path_parameters[:format] == 'xml' ? format_type = request.path_parameters[:format] : format_type = nil
|
28
|
+
# Set redirect_url as URI object
|
29
|
+
redirect_url = URI(@data_url.call(params).query_url)
|
30
|
+
# add format_type to path if format in url is json or xml
|
31
|
+
redirect_url.path = redirect_url.path + '.' + format_type if format_type
|
32
|
+
redirect_to(redirect_url.to_s) && return
|
27
33
|
end
|
28
34
|
|
29
35
|
# Get the data URL for our current controller and action OR raise a StandardError
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: parliament-utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rebecca Appleyard
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-08-
|
11
|
+
date: 2017-08-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parliament-ruby
|