lib/ferret_adapter/remote_index.rb in dm-ferret-adapter-0.9.11 vs lib/ferret_adapter/remote_index.rb in dm-ferret-adapter-0.10.0
- old
+ new
@@ -3,15 +3,13 @@
class FerretAdapter::RemoteIndex
class IndexNotFound < Exception; end
class SearchError < Exception; end
- attr_accessor :uri
+ def initialize(options)
+ @options = options
- def initialize(uri)
- @uri = uri
-
connect_to_remote_index
end
def add(doc)
@index.write [:add, DRb.uri, doc]
@@ -37,10 +35,10 @@
require "drb"
require "drb/unix"
require "rinda/tuplespace"
DRb.start_service
- tuple_space = DRb::DRbObject.new(nil, "drbunix://#{@uri.path}")
+ tuple_space = DRb::DRbObject.new(nil, "drbunix://#{@options[:path]}")
# This will throw Errno::ENOENT if the socket does not exist.
tuple_space.respond_to?(:write)
@index = Rinda::TupleSpaceProxy.new(tuple_space)