utopia 2.4.1 → 2.5.0

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
  SHA256:
3
- metadata.gz: c82107a036d11f5f56d84ed77517e349e84ea244d68f38dd59e69605519a110e
4
- data.tar.gz: 6a6bbed8272706c82a33ed410e215019d1e68e7e094e9812cdbadc8cb5f14032
3
+ metadata.gz: 37d97837ade8d210c7f13ac156ca9a1bdbc8f1f3f9eb9ef195dcc688b6ea933c
4
+ data.tar.gz: 6d3bb1d8a49183df2b3decdba70d8d42d996f1868fb44e4a184ca413f799760a
5
5
  SHA512:
6
- metadata.gz: c2a2bc42c4d978af6035ec6c460b81bb4e32cb544e4136890534569d191206c4463a0acfee5075456071d82e187264fdab566ff2679e972f75c20ee4dbacae09
7
- data.tar.gz: 592ff149b58116bef28f6233541ac266809c95f238c7952c645db508c76be891ccfb18a6404698ecc7cef50722af5ec161411bf552e898084f81eb79498aa077
6
+ metadata.gz: 93a81c8a0cf74142599575da2421eeb8e62ec0190de34c470451e44381855f304b2ba3390142ae41a98da80125c5a78623fd6dc75d2d2d2430c8114eea54b05e
7
+ data.tar.gz: 34ee51883e8abfbee0bb6be8fddaebeb358c644ba6e264d7f86aa4a95f0baad4bc3cd5d2e1408d3b285fc58df8812168b8e7bf3312c30311ab7dac85ea063d4d
@@ -208,7 +208,9 @@ module Utopia
208
208
  # Lookup a node with the given path relative to the current node.
209
209
  # @return [Node] The node if could be found.
210
210
  def lookup_node(path)
211
- @current.node.lookup_node(path)
211
+ @end_tags.reverse_each do |state|
212
+ return state.node.lookup_node(path) if state.node.respond_to?(:lookup_node)
213
+ end
212
214
  end
213
215
 
214
216
  # The content of the node
@@ -50,7 +50,7 @@ module Utopia
50
50
  end
51
51
 
52
52
  def lookup_node(path)
53
- @controller.lookup_node(@uri_path + Path[path])
53
+ @controller.lookup_node(parent_path + Path[path])
54
54
  end
55
55
 
56
56
  def local_path(path = '.', base = nil)
@@ -32,7 +32,7 @@ module Utopia
32
32
  :enable_starttls_auto => false
33
33
  }]
34
34
 
35
- DEFAULT_FROM = (ENV['USER'] || 'rack').freeze
35
+ DEFAULT_FROM = (ENV['USER'] || 'utopia').freeze
36
36
  DEFAULT_SUBJECT = '%{exception} [PID %{pid} : %{cwd}]'.freeze
37
37
 
38
38
  # @param to [String] The address to email error reports to.
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module Utopia
22
- VERSION = "2.4.1"
22
+ VERSION = "2.5.0"
23
23
  end
@@ -0,0 +1 @@
1
+ <p>Hello World</p>
@@ -0,0 +1 @@
1
+ <utopia:node path="content"/>
@@ -57,5 +57,11 @@ module Utopia::ContentSpec
57
57
  expect(links[1].name).to be == 'foo'
58
58
  expect(links[1].locale).to be == 'ja'
59
59
  end
60
+
61
+ it "should look up node by path" do
62
+ node = content.lookup_node(Utopia::Path['/lookup/index'])
63
+
64
+ expect(node.process!(nil)).to be == [200, {"Content-Type"=>"text/html; charset=utf-8"}, ["<p>Hello World</p>"]]
65
+ end
60
66
  end
61
67
  end
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: 2.4.1
4
+ version: 2.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-25 00:00:00.000000000 Z
11
+ date: 2018-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: trenni
@@ -634,6 +634,8 @@ files:
634
634
  - spec/utopia/content/localized/two.zh.xnode
635
635
  - spec/utopia/content/markup_spec.rb
636
636
  - spec/utopia/content/namespace_spec.rb
637
+ - spec/utopia/content/node/lookup/content.xnode
638
+ - spec/utopia/content/node/lookup/index.xnode
637
639
  - spec/utopia/content/node/ordered/first.xnode
638
640
  - spec/utopia/content/node/ordered/index.xnode
639
641
  - spec/utopia/content/node/ordered/links.yaml
@@ -760,6 +762,8 @@ test_files:
760
762
  - spec/utopia/content/localized/two.zh.xnode
761
763
  - spec/utopia/content/markup_spec.rb
762
764
  - spec/utopia/content/namespace_spec.rb
765
+ - spec/utopia/content/node/lookup/content.xnode
766
+ - spec/utopia/content/node/lookup/index.xnode
763
767
  - spec/utopia/content/node/ordered/first.xnode
764
768
  - spec/utopia/content/node/ordered/index.xnode
765
769
  - spec/utopia/content/node/ordered/links.yaml