plezi 0.12.8 → 0.12.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 92408c765d2c38c2c1585e1091fb84b9c082bc5c
4
- data.tar.gz: 8238991470cad7a350f725b869e1599fb4b2b18c
3
+ metadata.gz: c9bab19c1f422e4cf78c2c37b43657b86bf65306
4
+ data.tar.gz: 01189f978d0f1d984a0e800886ac33d2ab8048b7
5
5
  SHA512:
6
- metadata.gz: b46eec031af3a77a791e75c0cf9159d9b2f24a01944d2d527d865c0d4a4a77a893572c7ba01bd229a9e55f4afef5943575f7dda47228612f89c95ddd9c23ccb2
7
- data.tar.gz: 1043195255a1ad12772067e5e672ae98d7a80e3de18ee2bbadab1985f7d6d44fe02b5a0e5b010a2d5b7f310f764a9d16ad48cc836a5dcca6b7c92f5cea2238c6
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
- (return render(options.delete(:layout), options) { render template, options, &block }) if options[:layout]
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
- filename = template.is_a?(String) ? File.join( host_params[:templates].to_s, template) : (File.join( host_params[:templates].to_s, *template.to_s.split('_')) + (options[:type].empty? ? '': ".#{options[:type]}"))
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
@@ -1,3 +1,3 @@
1
1
  module Plezi
2
- VERSION = "0.12.8"
2
+ VERSION = "0.12.9"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plezi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.8
4
+ version: 0.12.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Boaz Segev