class DRb::DRbObject

def self.with_friend(uri) # :nodoc:

:nodoc:
Given the +uri+ of another host executes the block provided.
def self.with_friend(uri) # :nodoc:
  friend = DRb.fetch_server(uri)
  return yield() unless friend
  save = Thread.current['DRb']
  Thread.current['DRb'] = { 'server' => friend }
  return yield
ensure
  Thread.current['DRb'] = save if friend
end