Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: d4dc204c3e
Fetching contributors…

Cannot retrieve contributors at this time

46 lines (35 sloc) 0.756 kB
require 'uri'
require 'multi_json'
require 'redis'
require 'soulmate/version'
require 'soulmate/helpers'
require 'soulmate/base'
require 'soulmate/matcher'
require 'soulmate/loader'
module Soulmate
extend self
MIN_COMPLETE = 2
DEFAULT_STOP_WORDS = ["vs", "at", "the"]
def redis=(url)
@redis = nil
@redis_url = url
redis
end
def redis
@redis ||= (
url = URI(@redis_url || ENV["REDIS_URL"] || "redis://127.0.0.1:6379/0")
::Redis.new({
:host => url.host,
:port => url.port,
:db => url.path[1..-1],
:password => url.password
})
)
end
def stop_words
@stop_words ||= DEFAULT_STOP_WORDS
end
def stop_words=(arr)
@stop_words = Array(arr).flatten
end
end
Jump to Line
Something went wrong with that request. Please try again.