From: John Carter Date: 2007-02-09T06:45:49+09:00 Subject: Re: Your favorite bit of ruby code? On Fri, 9 Feb 2007, Carl Lerche wrote: > I'm just curious what your favorite bit of ruby code is? Do you have > any small bits, methods, classes, or anything else, that just make you > say "Wow, that is sweet!" It's the IO.read().scan(%r{}mx){|m| ...} paradigm here I love... Equally Good is `command`.scan(%r{}mx){|m| ...} ruby -e 'IO.read("ruby/eval.c").scan(%r{^([a-z_]+)\s*\(.*?\{}m){|m|puts $1}' rb_jump_context rb_secure rb_secure_update rb_check_safe_obj rb_check_safe_str raise_undef rb_clear_cache rb_clear_cache_for_remove rb_clear_cache_by_id rb_clear_cache_by_class John Carter Phone : (64)(3) 358 6639 Tait Electronics Fax : (64)(3) 359 4632 PO Box 1645 Christchurch Email : john.carter@tait.co.nz New Zealand