Forum: Ruby tagz-5.0.0

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Andrew S. Townley (Guest)
on 2009-03-27 15:24
(Received via mailing list)
Hi Ara,

Here's a fix for the empty tag problem.  With this fix, I now have a
usable solution.  It would still be nice to support combining multiple
hash arguments automatically, but that's not a showstopper.

Thanks again for all your hard work.



excalibur$ diff -u /var/lib/gems/1.8/gems/tagz-5.0.0/lib/tagz.rb
--- /var/lib/gems/1.8/gems/tagz-5.0.0/lib/tagz.rb  2009-03-24
11:58:05.000000000 +0000
+++ /tmp/tagz.rb  2009-03-27 13:21:47.000000000 +0000
@@ -37,6 +37,7 @@

       tagz.concat "<#{ name }#{ attributes }>"
+      startsz = tagz.size

       if content.empty?
         if block
@@ -59,6 +60,7 @@
         tagz.concat "</#{ name }>"

+      tagz[-1] = "/>" if tagz.size == startsz
This topic is locked and can not be replied to.