From: dam@... (Damien Merenne) Date: 2007-11-14T00:31:54+09:00 Subject: Re: How do I exit from a block On Wed, Nov 14, 2007 at 12:03:42AM +0900, Jigar Gosar wrote: > my code has reduced to > > Dir["C:/pde/cvshome/trunk/OBox/**/src/core/**/*.java"].each{|f| > file = f.gsub(/.*\/src\/core\//,"") > file = file.gsub("/",".") > file = file.gsub(/.java$/,"") > puts file > } > > Any way to shorten it further?? If you want only the name of the file, use puts File.basename(f, ".java") Best, -- Damien MERENNE http://blog.cosinux.org/