ruby-handlebars 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ruby-handlebars.rb +4 -2
- 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: 6ed8f17bdd377f5056cc1069ca285b73202f7c4c
|
4
|
+
data.tar.gz: e5989ea19b7c9a1b17ab34fdb9f36d772490e3b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a4bbee6e34790662483575d504997614ad8c9cc73b5b699ea48d9e0de6d9f31ac10836c92574ac454fc53bbe6ce63a6a52ec4396c5cb50bef1d5f0983f653b6
|
7
|
+
data.tar.gz: 77ad95bf4be3647cce456a217260e73c03433bc1e82453ec72eb5d42a4ecfef7b8e5bb358979cea37b9a91d30eb12930d17c5b4258c660fb7e678d9e0cb078f0
|
data/lib/ruby-handlebars.rb
CHANGED
@@ -69,8 +69,10 @@ module Handlebars
|
|
69
69
|
register_helper('each') do |context, items, block, else_block|
|
70
70
|
current_this = context.get('this')
|
71
71
|
|
72
|
-
if (items.nil? || items.empty?)
|
73
|
-
|
72
|
+
if (items.nil? || items.empty?)
|
73
|
+
if else_block
|
74
|
+
result = else_block.fn(context)
|
75
|
+
end
|
74
76
|
else
|
75
77
|
result = items.map do |item|
|
76
78
|
context.add_item(:this, item)
|