From: Clement Ow Date: 2008-05-22T18:45:43+09:00 Subject: Re: Local Jump Error Sebastian Hungerecker wrote: > Clement Ow wrote: >> Apparently now the code raises an error at the last Find.find(src1).each >> do |file|, saying that there is a LocalJumpError. > > You still have the each there. find does NOT return an array or any > other kind > of enumerable. You can't use find without a block and you can't use its > return > value (which is always nil) in any way. > > HTH, > Sebastian That means to say that I cant have an each, because Find does not return an array? So does it mean to say that I'll need not have each at all? Do i do it this way then? Find.find($source) do |file| src1 << file unless $file_exception[i].any? do |x| /#{x}/i =~ File.basename(file) end end #src1 = $file_exception[i].inject(Dir.glob(src)) {|result, ex|result.reject{|x| File.basename(x) =~ Regexp.new(ex, Regexp::IGNORECASE)}} else src1 = $source end i = i + 1 Find.find(src1) do |file| file.each do |f| : : -- Posted via http://www.ruby-forum.com/.