Sha256: 41b5b839d41a4634df3f25c0f15950e979119c6692791f2e60d541aae3ae46b3

Contents?: true

Size: 591 Bytes

Versions: 2

Compression:

Stored size: 591 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
  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.6 lib/soulmate.rb
soulmate-0.0.5 lib/soulmate.rb