Sha256: 10635c89c82c2568f9abbe3fffb174412a5c1ce2c5476cd5a159a1222e4a4e8c

Contents?: true

Size: 916 Bytes

Versions: 17

Compression:

Stored size: 916 Bytes

Contents

# frozen_string_literal: true

module ThinkingSphinx::Middlewares; end

%w[
  middleware active_record_translator geographer glazier ids_only inquirer
  sphinxql stale_id_checker stale_id_filter valid_options
].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 = [ValidOptions, 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

17 entries across 17 versions & 1 rubygems

Version Path
thinking-sphinx-5.6.0 lib/thinking_sphinx/middlewares.rb
thinking-sphinx-5.5.1 lib/thinking_sphinx/middlewares.rb
thinking-sphinx-5.5.0 lib/thinking_sphinx/middlewares.rb
thinking-sphinx-5.4.0 lib/thinking_sphinx/middlewares.rb
thinking-sphinx-5.3.0 lib/thinking_sphinx/middlewares.rb
thinking-sphinx-5.2.1 lib/thinking_sphinx/middlewares.rb
thinking-sphinx-5.2.0 lib/thinking_sphinx/middlewares.rb
thinking-sphinx-5.1.0 lib/thinking_sphinx/middlewares.rb
thinking-sphinx-5.0.0 lib/thinking_sphinx/middlewares.rb
thinking-sphinx-4.4.1 lib/thinking_sphinx/middlewares.rb
thinking-sphinx-4.4.0 lib/thinking_sphinx/middlewares.rb
thinking-sphinx-4.3.2 lib/thinking_sphinx/middlewares.rb
thinking-sphinx-4.3.1 lib/thinking_sphinx/middlewares.rb
thinking-sphinx-4.3.0 lib/thinking_sphinx/middlewares.rb
thinking-sphinx-4.2.0 lib/thinking_sphinx/middlewares.rb
thinking-sphinx-4.1.0 lib/thinking_sphinx/middlewares.rb
thinking-sphinx-4.0.0 lib/thinking_sphinx/middlewares.rb