Sha256: 26aae0d27affe777ae4da48e4465f65eab67a12f08cade9ef7f19de7872750c8

Contents?: true

Size: 859 Bytes

Versions: 7

Compression:

Stored size: 859 Bytes

Contents

module ThinkingSphinx::Middlewares; end

%w[middleware active_record_translator geographer glazier ids_only inquirer
   sphinxql stale_id_checker stale_id_filter utf8].each do |middleware|
  require "thinking_sphinx/middlewares/#{middleware}"
end

module ThinkingSphinx::Middlewares
  def self.use(builder, middlewares)
    middlewares.each { |m| builder.use m }
  end

  BASE_MIDDLEWARES = [SphinxQL, Geographer, Inquirer]

  DEFAULT = ::Middleware::Builder.new do
    use StaleIdFilter
    ThinkingSphinx::Middlewares.use self, BASE_MIDDLEWARES
    use ActiveRecordTranslator
    use StaleIdChecker
    use Glazier
  end

  RAW_ONLY = ::Middleware::Builder.new do
    ThinkingSphinx::Middlewares.use self, BASE_MIDDLEWARES
  end

  IDS_ONLY = ::Middleware::Builder.new do
    ThinkingSphinx::Middlewares.use self, BASE_MIDDLEWARES
    use IdsOnly
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
thinking-sphinx-3.3.0 lib/thinking_sphinx/middlewares.rb
thinking-sphinx-3.2.0 lib/thinking_sphinx/middlewares.rb
thinking-sphinx-3.1.4 lib/thinking_sphinx/middlewares.rb
thinking-sphinx-3.1.3 lib/thinking_sphinx/middlewares.rb
thinking-sphinx-3.1.2 lib/thinking_sphinx/middlewares.rb
thinking-sphinx-3.1.1 lib/thinking_sphinx/middlewares.rb
thinking-sphinx-3.1.0 lib/thinking_sphinx/middlewares.rb