diff options
author | Steve Kemp <steve@steve.org.uk> | 2012-11-26 10:57:34 +0000 |
---|---|---|
committer | Steve Kemp <steve@steve.org.uk> | 2012-11-26 10:57:34 +0000 |
commit | fd80dc9a045e9c939bfb722d2d74a0c379aa4ac8 (patch) | |
tree | 63ac95db8c4e063e3f4298db564a026f33d7ae23 | |
parent | 3a172585f303fb632a932501960c92629414b3e2 (diff) |
Ensure we can be loaded, even if there is no redis rubygem present.
-rw-r--r-- | lib/custodian/alerts/redis-state.rb | 11 |
1 files changed, 8 insertions, 3 deletions
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 |