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 | 3106dab23b7a7832b339182390c2452a78134bcb (patch) | |
tree | 2ae13a5848308fcb7719afed2ed78083c091cd62 /lib/custodian/alerts/redis-state.rb | |
parent | f6b134149b469751d318cc1bbd72d29b735d3acb (diff) |
Ensure we can be loaded, even if there is no redis rubygem present.
Diffstat (limited to 'lib/custodian/alerts/redis-state.rb')
-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 |