inversion 0.11.1 → 0.11.2

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.
data/History.rdoc CHANGED
@@ -1,3 +1,8 @@
1
+ == v0.11.2 [2012-09-17] Michael Granger <ged@FaerieMUD.org>
2
+
3
+ - [bugfix] Don't cast enumerated values in for tags to Arrays.
4
+
5
+
1
6
  == v0.11.1 [2012-09-17] Michael Granger <ged@FaerieMUD.org>
2
7
 
3
8
  - [bugfix] Make subscriptions get nodes that were already published
@@ -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 = Array( lvalue.next )
92
- # self.log.debug " iterated block args are: %p" % [ args ]
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.1'
28
+ VERSION = '0.11.2'
29
29
 
30
30
  # Version-control revision constant
31
- REVISION = %q$Revision: cca3daa4a649 $
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
- ������%Sk���N��X���\�h8V
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
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inversion
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.1
4
+ version: 0.11.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
metadata.gz.sig CHANGED
Binary file