utopia 1.0.10 → 1.0.11

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: 36fe0ba2136d78c5df750901c7ec3a971c8b5cd4
4
- data.tar.gz: ba887c427521d032f30a4e69f89c4bac632786f6
3
+ metadata.gz: fb9c01f8a43932f752a9588dd957deb2afec170c
4
+ data.tar.gz: 85654a0ecc710fb663616fd7afda1a3da995790e
5
5
  SHA512:
6
- metadata.gz: 784a23846c7a104b9995f22864a9ea40718bb9f881d0c637a86d3ecd105d6b0f222531007fc071b538449b8006ce44d6b287d6e6a31cf77fbe3c51d759d8e314
7
- data.tar.gz: 1ccd66d32c8ff84c5b6109b931601451debcd086800008d1536835978f349e97c0bd15245422bdecc857b614c9ceec9c0a8487cf3ad3888eb568dce1bc35111d
6
+ metadata.gz: 5a1de4ccb2fa9a111cefce7ff9c19c065b8551e1cbf6bf8a919d7db6c38a31b5b5b8c4edd7fe23fce192aa17635a74f0c170749c9cb03b78c068c872bf1db8fa
7
+ data.tar.gz: 6aa5e5815944530c84c53d14929993036cc09b3f0d4911ed68c6a7dbf2a1db495ec3d4eccb43edd2e9632d5003a262b58cd6c11e379407b27d8b86af8ae4537e
@@ -119,7 +119,7 @@ module Utopia
119
119
 
120
120
  locale = env[Localization::CURRENT_LOCALE_KEY]
121
121
  if link = Links.for(@root, path, locale)
122
- if node = lookup_node(link.path)
122
+ if link.path and node = lookup_node(link.path)
123
123
  response = Rack::Response.new
124
124
 
125
125
  attributes = nil
@@ -131,6 +131,8 @@ module Utopia
131
131
  node.process!(request, response, (attributes || {}).to_hash)
132
132
 
133
133
  return response.finish
134
+ elsif redirect_uri = link[:uri]
135
+ return [307, {"Location" => redirect_uri}, []]
134
136
  end
135
137
  end
136
138
 
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module Utopia
22
- VERSION = "1.0.10"
22
+ VERSION = "1.0.11"
23
23
  end
@@ -56,6 +56,13 @@ module Utopia::ContentSpec
56
56
 
57
57
  expect(last_response.body).to be == '10'
58
58
  end
59
+
60
+ it "should successfully redirect to the foo page" do
61
+ get '/content/redirect'
62
+
63
+ expect(last_response.status).to be == 307
64
+ expect(last_response.headers['Location']).to be == 'foo'
65
+ end
59
66
  end
60
67
 
61
68
  describe Utopia::Content do
@@ -0,0 +1,2 @@
1
+ redirect:
2
+ uri: foo
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: utopia
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.10
4
+ version: 1.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-05 00:00:00.000000000 Z
11
+ date: 2015-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: trenni
@@ -239,6 +239,7 @@ files:
239
239
  - spec/utopia/middleware_spec.rb
240
240
  - spec/utopia/pages/_heading.xnode
241
241
  - spec/utopia/pages/content/_show-value.xnode
242
+ - spec/utopia/pages/content/links.yaml
242
243
  - spec/utopia/pages/content/test-partial.xnode
243
244
  - spec/utopia/pages/controller/controller.rb
244
245
  - spec/utopia/pages/controller/index.xnode
@@ -317,6 +318,7 @@ test_files:
317
318
  - spec/utopia/middleware_spec.rb
318
319
  - spec/utopia/pages/_heading.xnode
319
320
  - spec/utopia/pages/content/_show-value.xnode
321
+ - spec/utopia/pages/content/links.yaml
320
322
  - spec/utopia/pages/content/test-partial.xnode
321
323
  - spec/utopia/pages/controller/controller.rb
322
324
  - spec/utopia/pages/controller/index.xnode