From: William James Date: 2005-09-05T16:41:27+09:00 Subject: Re: Help me clean up this method Vincent Foley wrote: > Hello guys, > > I wrote this little method to return the size of a given directory, but > I think it's very ugly. Could anyone help me clean it up a bit? def Dir.size(name) Dir[ name + "/**/*" ].select{|x| File.file?(x)}.inject(0){|sum,f| sum + File.size(f) } end