Upon further testing, it appears this is also fixed in tags/stable. Just
FYI.
- Nathan
Nathan Weizenbaum wrote:
> Ah, that's breaking for me. However, I think I'm not going to bother
> fixing it, as it's fixed in trunk which I'm probably going to release
> within the week. For the time being, you can either fix it in your
> local copy or upgrade to trunk.
>
> Thanks for pointing it out, though. Any other time and I'd definitely
> make it go away.
>
> - Nathan
>
> Michiel de Mare wrote:
>>
>> On Dec 11, 8:08 am, Nathan Weizenbaum <[EMAIL PROTECTED]> wrote:
>>
>>> What version are you using? In Haml 1.7.2, both empty and nil values
>>> result in a non-rendering attribute. I agree that empty values should
>>> render as empty attributes - this is the behavior in trunk.
>>>
>>
>> 1.7.2. I got the exception when I upgraded. This produces the
>> exception:
>>
>> Haml::Engine.new(".a{ :id => '', :class => 'c'}").render
>>
>> How about:
>>
>> result = attributes.reject{|a,v| v.nil? }.collect do |a,v|
>>
>> ... and delete the unless condition?
>>
>>
>>> I only use empty? on variables I know to be strings or arrays, for
>>> which
>>> it's defined in core.
>>>
>>
>> Right, I missed the to_s conversion.
>>
>> Cheers,
>>
>> Michiel.
>>
>>
>>> - Nathan
>>>
>>> Michiel de Mare wrote:
>>>
>>>> Oh, another thing - don't use "empty?" because it's defined for very
>>>> few objects outside rails.
>>>> On Dec 11, 7:44 am, Michiel de Mare <[EMAIL PROTECTED]> wrote:
>>>>
>>>>> Attributes with nil or empty values cause an exception (in
>>>>> Haml::Engine#build_attributes at line 685, sorting an array with
>>>>> nils).
>>>>> Also, I think the intention of the code is to skip
>>>>> attributes with
>>>>> empty values, but that's definitely not desired - empty attribute
>>>>> values are often necessary.
>>>>>
>> >>
>>
>>
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Haml" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---