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 +4 -4
- data/lib/halfling/base.rb +15 -3
- data/lib/halfling/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4a9da0caf2833ae34205b76870cd21a9da0e4e8
|
4
|
+
data.tar.gz: 348e7f584cc4ee4a358c726b3c90ea6428d4e4d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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)
|
data/lib/halfling/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2017-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hobbit
|