Sha256: 643261506460d9bb2399109d3f2543711d6ba315cff00be37391472ece3fcb95

Contents?: true

Size: 558 Bytes

Versions: 2

Compression:

Stored size: 558 Bytes

Contents

require 'uri'
require 'json'
require 'redis'

require 'soulmate/helpers'
require 'soulmate/base'
require 'soulmate/matcher'
require 'soulmate/loader'

module Soulmate

  extend self

  MIN_COMPLETE = 2
  STOP_WORDS = ["vs", "at"]

  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

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
soulmate-0.0.1 lib/soulmate.rb
soulmate-0.0.0 lib/soulmate.rb