Sha256: 9c7ee4b11a89db8627a59181443f83e982c8c3983d54554889a0e9f7ba294c0a

Contents?: true

Size: 701 Bytes

Versions: 13

Compression:

Stored size: 701 Bytes

Contents

require 'rubygems'
require 'json'
require 'rspec'
require 'redis'
require 'rack'
require 'rack/test'
require 'delorean'

ENV['RACK_ENV'] = "test"
ENV['FNORDMETRIC_ENV'] = 'test'

$: << ::File.expand_path('../../lib', __FILE__)
require "fnordmetric"
require "eventmachine"
require 'em-hiredis'

class RedisWrap

  def initialize(redis, callbackable=true)
    @redis = redis
    @callbackable = callbackable
  end

  def method_missing(m, *args)    
    @last_return = @redis.send(m, *args)
    if ENV["VERBOSE_REDIS"]
      puts ">> REDIS: #{m} #{args.join(" ")} => #{@last_return}" 
    end
    @callbackable ? self : @last_return
  end

  def callback(&block)
    block.call(*@last_return)
  end

end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
fnordmetric-0.6.2 spec/spec_helper.rb
fnordmetric-0.6.1 spec/spec_helper.rb
fnordmetric-0.6.0 spec/spec_helper.rb
fnordmetric-0.5.9 spec/spec_helper.rb
fnordmetric-0.5.8 spec/spec_helper.rb
fnordmetric-0.5.7 spec/spec_helper.rb
fnordmetric-0.5.6 spec/spec_helper.rb
fnordmetric-0.5.5 spec/spec_helper.rb
fnordmetric-0.5.4 spec/spec_helper.rb
fnordmetric-0.5.3 spec/spec_helper.rb
fnordmetric-0.5.2 spec/spec_helper.rb
fnordmetric-0.5.1 spec/spec_helper.rb
fnordmetric-0.5.0 spec/spec_helper.rb