From a22b8e96ead33b0f97ed5243dbad7f7b6cd5135d Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Mon, 9 Mar 2015 13:19:15 +0000 Subject: Prefer single-quotes when you don't need interpolation. So "foo" is less good than 'foo'. --- lib/custodian/alerts/redis-state.rb | 42 ++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'lib/custodian/alerts/redis-state.rb') diff --git a/lib/custodian/alerts/redis-state.rb b/lib/custodian/alerts/redis-state.rb index f37cef2..27bb2c4 100644 --- a/lib/custodian/alerts/redis-state.rb +++ b/lib/custodian/alerts/redis-state.rb @@ -39,7 +39,7 @@ module Custodian @redis = Redis.new(:host => @target ) rescue - puts "ERROR Loading redis rubygem!" + puts 'ERROR Loading redis rubygem!' end @test = obj @@ -55,16 +55,16 @@ module Custodian return unless( @redis ) tmp = {} - tmp["time"] = Time.now.to_i - tmp["type"] = @test.get_type - tmp["target"] = @test.target - tmp["result"] = "RAISE" - tmp["reason"] = @test.error - tmp["test" ] = @test.to_s - tmp["class" ] = @test.class + tmp['time'] = Time.now.to_i + tmp['type'] = @test.get_type + tmp['target'] = @test.target + tmp['result'] = 'RAISE' + tmp['reason'] = @test.error + tmp['test' ] = @test.to_s + tmp['class' ] = @test.class - @redis.lpush( "recent-tests", tmp.to_json) - @redis.ltrim( "recent-tests", 0, 100 ) + @redis.lpush( 'recent-tests', tmp.to_json) + @redis.ltrim( 'recent-tests', 0, 100 ) end @@ -79,19 +79,19 @@ module Custodian tmp = {} - tmp["time"] = Time.now.to_i - tmp["type"] = @test.get_type - tmp["target"] = @test.target - tmp["result"] = "OK" - tmp["reason"] = "" - tmp["test" ] = @test.to_s - tmp["class" ] = @test.class - - @redis.lpush( "recent-tests", tmp.to_json) - @redis.ltrim( "recent-tests", 0, 100 ) + tmp['time'] = Time.now.to_i + tmp['type'] = @test.get_type + tmp['target'] = @test.target + tmp['result'] = 'OK' + tmp['reason'] = '' + tmp['test' ] = @test.to_s + tmp['class' ] = @test.class + + @redis.lpush( 'recent-tests', tmp.to_json) + @redis.ltrim( 'recent-tests', 0, 100 ) end - register_alert_type "redis" + register_alert_type 'redis' end end -- cgit v1.2.1