Sha256: 68c233a84e9334b5d17283ab224a1ab65ac2e7d106fb2ca2351b289ad9b9c265

Contents?: true

Size: 965 Bytes

Versions: 2

Compression:

Stored size: 965 Bytes

Contents

# add this directory to the load path if it hasn't already been added

require File.join(File.dirname(__FILE__), 'mash') unless defined?(Mash)

unless Hash.respond_to?(:to_mash)
  class Hash
    def to_mash
      Mash.new(self)
    end
  end
end

require 'rubygems'
require 'rsolr'

module RSolr::Ext
  
  autoload :Client, 'rsolr-ext/client.rb'
  autoload :Doc, 'rsolr-ext/doc.rb'
  autoload :Request, 'rsolr-ext/request.rb'
  autoload :Response, 'rsolr-ext/response.rb'
  autoload :Model, 'rsolr-ext/model.rb'
  
  def self.version
    @version ||= File.read(File.join(File.dirname(__FILE__), '..', 'VERSION'))
  end
  
  VERSION = self.version
  
  # modify the RSolr::Client (provides #find and #luke methods)
  RSolr::Client.class_eval do
    include RSolr::Ext::Client
  end
  
  # this is for backward compatibility: RSolr::Ext.connect
  # recommended way is to just use RSolr.connect
  def self.connect *args, &blk
    RSolr.connect *args, &blk
  end
  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rsolr-ext-1.0.0 lib/rsolr-ext.rb
rsolr-ext-0.12.1 lib/rsolr-ext.rb