Adam Shelly
5/21/2008 5:43:00 AM
On Tue, May 20, 2008 at 9:31 PM, Clement Ow
<clement.ow@asia.bnpparibas.com> wrote:
> I get the following error when i execute my code:
>>>c:/ruby/lib/ruby/1.8/Find.rb:39:in `find': no block given (LocalJumpError)
>
> A snippet of my code is as follows:
>
> if $file_exception[i] != nil
> src1 = $file_exception[i].inject(Find.find(src)) {|result,
> ex|result.reject{|x| File.basename(x) =~ Regexp.new(ex,
> Regexp::IGNORECASE)}}
> Is there something wrong with my code at all? (maybe i overlooked
> something very simple)
The error message is telling you exactly what you overlooked: find
takes a block, not an argument.
You probably want Find.find{|val|val==src}
-Adam