From: Michael Fellinger Date: 2007-12-07T13:02:17+09:00 Subject: Re: Rubyisms wanted to shorten code in search program On Dec 7, 2007 10:15 AM, RichardOnRails wrote: > On Dec 5, 3:00 am, Michael Fellinger wrote: > > On Dec 4, 2007 2:05 PM, RichardOnRails > > > > wrote: > > > Hi, > > > > > Search on WindowsXP/SP2 didn't seem to locate a file is looking for. > > > As someone relatively new to Ruby, I wonder whether there are any > > > Rubyisms I could have used to cut down the the 80+ lines I took to > > > accomplish this task, given the USAGE requirement I posed in the > > > code. > > > > Quick implementation of what i could read from your code...http://rafb.net/p/GyzZxJ94.html > > Hi Michael, > > Great code! You interpreted my intent perfectly. And your code > worked perfectly (though, in case someone else uses it, I think I had > to tweak something before I got it to work, though I can't remember > what it was and I might be confusing this with someone else's > offering. ) > > The option-handling is package is great, though it's going to take me > a few days to understand its nuances ... maybe quite a few days :-) > > Thanks for showing me some of the elegant heights of Ruby. > > After I'm satisfied with my understanding of the package, I'm going > to try adding -cra --created_after, -cha --changed_after, etc. It > seems to me that we should be able specify more than RE comparisons > with an option-handler package. Thank you as well, it was a fun little quiz :) I usually use the GNU tools grep and awk to get the same results, but i'm not sure if they are available for windows. Anyway, hope i helped you in your understanding of ruby itself, some idioms, code-style and overall flow... Ruby code usually is well done when you cannot suppress the urge to frame and hang it up on in your room :) ^ manveru