From cremes.devlist at mac.com Wed Nov 29 19:12:28 2006 From: cremes.devlist at mac.com (Chuck Remes) Date: Wed, 29 Nov 2006 18:12:28 -0600 Subject: [Plist-devel] posted a few bugs today with patches Message-ID: <85AC02DE-3C01-47D0-801E-878D2DB33DEE@mac.com> Is this thing on? I sent an email to Ben earlier today with another patch for a bug I ran across. He suggested I officially submit them to the rubyforge bug tracker, so consider them submitted [1]. I could not figure out how to get rubyforge to allow multiple file uploads (one for each patch) so I ended up pasting the patches in inline. Hopefully that won't screw anything up. The first bug (and patches) were related to Plist blowing up if a submitted plist had a null Date field in it. That makes the plist invalid, but it shouldn't make Plist blow up either. I think it should be tolerant of Garbage In hence the patch. The second problem was related to Rails sometimes putting submitted forms (from the params object) into StringIOs. Passing this blindly on to Plist for parsing blows up because Plist can only handle Strings containing plists or Strings representing plist files on the filesystem. The patch checks to see if the #file_name_or_xml object respond_to?(:string) and pulls out the underlying String if it does. Again, this makes Plist a bit more tolerant of weird things being thrown at it. Ultimately that second patch should probably detect if an IO object was passed in. If so, read from it to snag the plist hiding inside. For now, this is a good stopgap. cr [1] http://rubyforge.org/tracker/index.php?group_id=2006&atid=7829