From fd80dc9a045e9c939bfb722d2d74a0c379aa4ac8 Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Mon, 26 Nov 2012 10:57:34 +0000 Subject: Ensure we can be loaded, even if there is no redis rubygem present. --- lib/custodian/alerts/redis-state.rb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'lib/custodian/alerts') diff --git a/lib/custodian/alerts/redis-state.rb b/lib/custodian/alerts/redis-state.rb index 0c0b6a0..1b57b2e 100644 --- a/lib/custodian/alerts/redis-state.rb +++ b/lib/custodian/alerts/redis-state.rb @@ -1,7 +1,4 @@ -require 'rubygems' -require 'redis' - # # The redis-alerter. @@ -35,6 +32,14 @@ module Custodian # the redis connection. # def initialize( obj ) + + begin + require 'rubygems' + require 'redis' + rescue LoadError + raise "ERROR Loading redis rubygem!" + end + @test = obj @redis = Redis.new end -- cgit v1.2.1