From: why the lucky stiff Date: 2006-10-30T02:08:16+09:00 Subject: Re: Interesting trival example of why open classes are good? On Sun, Oct 29, 2006 at 04:45:13PM +0900, Peter Michaux wrote: > I am trying to explain why the fact that Ruby's classes are never > closed is advantageous. I can only think of relatively complex examples > like Rails plugins. Does anyone have an interesting, standalone example > showing the utility of open classes in under 30 lines? under 20? Have you heard of the `cgi_multipart_eof_fix' gem? It was recently released to patch an exploit in Ruby's CGI class which could be used to bring down Mongrel. You load the gem and it patches the class during runtime. Rather than needing to rebuild a patched Ruby. Also, it's not just about adding methods, removing methods is a really handy thing, too. _why