garaio/xapian_db — Issue #18: ResqueWriter isn't loaded
Author: javierv
Created: 2011-11-09 20:04:11+00:00
State: open

Hi, Gernot.

After commit 6600835ae2775622dc82c1bcb277130d8c7e28d2 resque isn't required, which is good, but I think a new problem has been introduced.

If you don't have beanstalk-client but try to use the resque writer (as in my case), the following code:

begin
require File.dirname(__FILE__) + '/xapian_db/index_writers/beanstalk_writer'
require File.dirname(__FILE__) + '/xapian_db/index_writers/resque_writer'
rescue LoadError
end

It throws an exception when requiring the beanstalk writer, so the line requiring the resque writer isn't loaded.

I'm no expert in LoadErrors, but separating the lines in two different begin...rescue seems to work.

Thanks!