Sha256: d5676ffaa9fc788f357376a08002fa3780c70dabd737db5437210d6929989ef3

Contents?: true

Size: 1.05 KB

Versions: 9

Compression:

Stored size: 1.05 KB

Contents

require 'socket'
require 'timeout'

module Riddle #:nodoc:
  class ConnectionError < StandardError #:nodoc:
    #
  end
  
  def self.escape_pattern
    Thread.current[:riddle_escape_pattern] ||= /[\(\)\|\-!@~"&\/]/
  end
  
  def self.escape_pattern=(pattern)
    Thread.current[:riddle_escape_pattern] = pattern
  end
  
  def self.escape(string)
    string.gsub(escape_pattern) { |char| "\\#{char}" }
  end
  
  def self.loaded_version
    @@sphinx_version
  end
  
  def self.loaded_version=(version)
    @@sphinx_version = version
  end
  
  def self.version_warning
    return if loaded_version
    
    STDERR.puts %Q{
Riddle cannot detect Sphinx on your machine, and so can't determine which
version of Sphinx you are planning on using. Please use one of the following
lines after "require 'riddle'" to avoid this warning.

  require 'riddle/0.9.8'
  # or
  require 'riddle/0.9.9'

    }
  end
end

require 'riddle/auto_version'
require 'riddle/client'
require 'riddle/configuration'
require 'riddle/controller'

Riddle.loaded_version = nil
Riddle::AutoVersion.configure

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
skalee-thinking-sphinx-1.3.14.2 vendor/riddle/lib/riddle.rb
skalee-thinking-sphinx-1.3.14.1 vendor/riddle/lib/riddle.rb
riddle-1.0.11 lib/riddle.rb
riddle-1.0.10 lib/riddle.rb
riddle-1.0.9 lib/riddle.rb
riddle-1.0.8 lib/riddle.rb
riddle-1.0.7 lib/riddle.rb
riddle-1.0.6 lib/riddle.rb
riddle-1.0.5 lib/riddle.rb