inversion 0.11.1 → 0.11.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.rdoc +5 -0
- data/lib/inversion/template/fortag.rb +2 -2
- data/lib/inversion.rb +2 -2
- data/spec/inversion/template/fortag_spec.rb +18 -0
- data.tar.gz.sig +2 -2
- metadata +1 -1
- metadata.gz.sig +0 -0
data/History.rdoc
CHANGED
@@ -88,8 +88,8 @@ class Inversion::Template::ForTag < Inversion::Template::CodeTag
|
|
88
88
|
|
89
89
|
# Loop will exit as soon as the Enumerator runs out of elements
|
90
90
|
loop do
|
91
|
-
args =
|
92
|
-
|
91
|
+
args = lvalue.next
|
92
|
+
args = [ args ] unless args.is_a?( Array )
|
93
93
|
|
94
94
|
# Turn the block arguments into an overrides hash by zipping up
|
95
95
|
# the arguments names and values
|
data/lib/inversion.rb
CHANGED
@@ -25,10 +25,10 @@ module Inversion
|
|
25
25
|
warn ">>> Inversion requires Ruby 1.9.2 or later. <<<" if RUBY_VERSION < '1.9.2'
|
26
26
|
|
27
27
|
# Library version constant
|
28
|
-
VERSION = '0.11.
|
28
|
+
VERSION = '0.11.2'
|
29
29
|
|
30
30
|
# Version-control revision constant
|
31
|
-
REVISION = %q$Revision:
|
31
|
+
REVISION = %q$Revision: b4d374fa78a0 $
|
32
32
|
|
33
33
|
|
34
34
|
### Get the Inversion version.
|
@@ -170,6 +170,24 @@ describe Inversion::Template::ForTag do
|
|
170
170
|
render_state.to_s.should =~ /ch \(1\) => ch/
|
171
171
|
end
|
172
172
|
|
173
|
+
it "preserves an array of subhashes" do
|
174
|
+
tree = Inversion::Parser.new( nil ).parse( <<-"END_TEMPLATE" )
|
175
|
+
<?for subhash in the_hash[:a] ?>
|
176
|
+
Subhash is a <?call subhash.class.name ?>
|
177
|
+
<?end for ?>
|
178
|
+
END_TEMPLATE
|
179
|
+
|
180
|
+
# Drop the non-container nodes at the beginning and end
|
181
|
+
tree.delete_if {|node| !node.container? }
|
182
|
+
|
183
|
+
the_hash = { :a => [ { :b => 'foo', :c => 'bar' }, { :d => 'blah', :e => 'blubb'} ] }
|
184
|
+
|
185
|
+
render_state = Inversion::RenderState.new( :the_hash => the_hash )
|
186
|
+
tree.first.render( render_state )
|
187
|
+
|
188
|
+
render_state.to_s.should =~ /Subhash is a Hash/i
|
189
|
+
end
|
190
|
+
|
173
191
|
end
|
174
192
|
|
175
193
|
|
data.tar.gz.sig
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
��x�zێ9��S���c�:���$>��09���\zB~��;�^������q�`��K�g&��9���A�h�������}`�L���K�8��od��� �[������
|
2
|
+
�:���1}��ĪW肁+)5���M�4g�ŀ���m���"�:������ֽ�P�B�F@�/�^d�pT��%/��� =�^��9�SW4�v�-5<oF�o����o�yY��]��?߀�{&��7K)�R�8{x��D�>m�7R� ���P�
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|