Sha256: 4387018fedeb76eae238ab6125d6fd1b4f3bb278322f7cbe4c872e771a57f52e
Contents?: true
Size: 736 Bytes
Versions: 2
Compression:
Stored size: 736 Bytes
Contents
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 || "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
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
soulmate-0.1.1 | lib/soulmate.rb |
soulmate-0.1.0 | lib/soulmate.rb |