plezi 0.12.8 → 0.12.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/plezi/handlers/controller_magic.rb +9 -2
- data/lib/plezi/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c9bab19c1f422e4cf78c2c37b43657b86bf65306
|
4
|
+
data.tar.gz: 01189f978d0f1d984a0e800886ac33d2ab8048b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 196629ba008ad6b9b987d2db2eaf699b13eb64a78a6647303ea98338b0be2f6114b6400a5e4f5ed536c6b849d84c203083d4a1b9a303a2f2f2b5fd207d7d3849
|
7
|
+
data.tar.gz: 0c768c0fc8b5cec673e2447a6b82651d42c7a017c0f7e9884591b6abe739275ae03a5ab7fe55abc637df99cdb7c5a8f10bb57e9412e36fff62c967538fb5f604
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,14 @@
|
|
2
2
|
|
3
3
|
***
|
4
4
|
|
5
|
+
Change log v.0.12.9
|
6
|
+
|
7
|
+
**Fix**: Layered rendering (when using layout) will now fail if the inner layer (the actual page) fails to render - directing the user to the 404 error page instead of displaying the layout with no data.
|
8
|
+
|
9
|
+
**Update**: `render` will now accept either a String (for a template name in the root of the template folder), a Symbol (the `_` sign will be used to delimit folders, if needed) or an Array of Strings (delimiting folders up to the file's base name).
|
10
|
+
|
11
|
+
***
|
12
|
+
|
5
13
|
Change log v.0.12.8
|
6
14
|
|
7
15
|
**Fix**: Sass cacheing now works as expected, so that repeated calls to the SASS renderer are loaded from the cache without failing.
|
@@ -174,7 +174,12 @@ module Plezi
|
|
174
174
|
# make sure templates are enabled
|
175
175
|
return false if host_params[:templates].nil?
|
176
176
|
# render layout by recursion, if exists
|
177
|
-
|
177
|
+
if options[:layout]
|
178
|
+
layout = options.delete(:layout)
|
179
|
+
inner = render(template, options, &block)
|
180
|
+
return false unless inner
|
181
|
+
return render(layout, options) { inner }
|
182
|
+
end
|
178
183
|
# set up defaults
|
179
184
|
options[:type] ||= 'html'.freeze
|
180
185
|
options[:locale] ||= params[:locale].to_sym if params[:locale]
|
@@ -188,7 +193,9 @@ module Plezi
|
|
188
193
|
# Circumvents I18n persistance issues (live updating and thread data storage).
|
189
194
|
I18n.locale = options[:locale] || I18n.default_locale if defined?(I18n) # sets the locale to nil for default behavior even if the locale was set by a previous action - removed: # && options[:locale]
|
190
195
|
# find template and create template object
|
191
|
-
|
196
|
+
template = [template] if template.is_a?(String)
|
197
|
+
filename = ( template.is_a?(Array) ? File.join( host_params[:templates].to_s, *template) : File.join( host_params[:templates].to_s, *template.to_s.split('_') ) ) + (options[:type].empty? ? '': ".#{options[:type]}")
|
198
|
+
puts "searching for #{filename}"
|
192
199
|
::Plezi::Renderer.render filename, binding, &block
|
193
200
|
end
|
194
201
|
|
data/lib/plezi/version.rb
CHANGED