halfling 0.0.10 → 0.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: 9047695f3092b0f51b109315003f5147bded1972
4
- data.tar.gz: 85edf877936c2bb6cc4b3524ebd2e5a8c97b39a7
3
+ metadata.gz: f4a9da0caf2833ae34205b76870cd21a9da0e4e8
4
+ data.tar.gz: 348e7f584cc4ee4a358c726b3c90ea6428d4e4d3
5
5
  SHA512:
6
- metadata.gz: 2b02ae742ccc5ac8f9ff3eca8d7bac57af7a48abe2628b61a99d41954661ee873a00616cf6014db0735b7c9847dcad04a332f61f16ba32468e9731d61cc5b459
7
- data.tar.gz: 4e2474dda72c3ce476dda606c566b4c268dcdaa4b02b5aeaefcf6c84dc7b51697e1b8726e6a1e66dda47f9929da8023fd15ec887b64cfd3cd132e571d54f3ed5
6
+ metadata.gz: 2b5c8adaaf1bccbad5ada58a5b69c290a19c1bc439ccc364677e78459faf4aebe41f6f6f02e465a7004df65b697419f9cae249831b0e096401fde0db5019896a
7
+ data.tar.gz: 230716d12d27fe2ac78d591c0b244572d2096d79e2e2d90e61007c4f9ee629fdcb47161e5131dd5cbc3f6d8cc1635127873c5da07799ab77d73bc0bcdb976799
data/lib/halfling/base.rb CHANGED
@@ -111,22 +111,34 @@ module Hobbit
111
111
  end
112
112
  @@root_controller = nil
113
113
  end
114
+ @render_nesting_level = 0
114
115
  super
115
116
  end
116
117
 
117
118
  #template stuff
118
119
  def find_template(template)
119
120
  tmpl_path=@@templates[template.to_sym]
120
- raise "template #{template} not found" unless tmpl_path
121
+ raise "template \"#{template}\" not found" unless tmpl_path
121
122
  tmpl_path
122
123
  end
123
124
  def default_layout
124
- find_template :"layouts/application"
125
+ if @render_nesting_level <= 1
126
+ find_template :"layouts/application"
127
+ else
128
+ #with nested rendering, default layout is nil.
129
+ nil
130
+ end
125
131
  end
126
132
  def template_engine
127
133
  raise "template_engine shouldn't be called"
128
134
  end
129
-
135
+
136
+ def render(*args)
137
+ @render_nesting_level += 1
138
+ ret = super
139
+ @render_nesting_level -= 1
140
+ ret
141
+ end
130
142
 
131
143
  #convenience stuff
132
144
  def set_content_type (val)
@@ -1,3 +1,3 @@
1
1
  module Halfling
2
- VERSION = '0.0.10'
2
+ VERSION = '0.0.11'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: halfling
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leo P.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-01-24 00:00:00.000000000 Z
11
+ date: 2017-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hobbit