Top Level Namespace

Defined Under Namespace

Modules: Metacosm

Constant Summary collapse

CONN_POOL =
5
REDIS_PUB =
ConnectionPool.new(size: CONN_POOL) do
  if ENV['REDISTOGO_URL']
    puts "---> using redis to go!"
    uri = URI.parse(ENV["REDISTOGO_URL"])
    puts "---> parsed uri: #{uri}"
    Redis.new(:host => uri.host, :port => uri.port, :password => uri.password, :thread_safe => true)
  else
    puts "---> using default redis settings..."
    Redis.new
  end
end
REDIS_SUB =
ConnectionPool.new(size: CONN_POOL) do
  if ENV['REDISTOGO_URL']
    puts "---> using redis to go!"
    uri = URI.parse(ENV["REDISTOGO_URL"])
    puts "---> parsed uri: #{uri}"
    Redis.new(:host => uri.host, :port => uri.port, :password => uri.password, :thread_safe => true)
  else
    puts "---> using default redis settings..."
    Redis.new
  end
end

Instance Method Summary collapse

Instance Method Details

#hash_diff(h1, other) ⇒ Object



1
2
3
4
5
# File 'lib/metacosm/support/spec_harness.rb', line 1

def hash_diff(h1,other)
  h1.dup.
    delete_if { |k, v| other[k] == v }.
    merge!(other.dup.delete_if { |k, v| h1.has_key?(k) })
end