summaryrefslogtreecommitdiff
path: root/lib/custodian/alerts/redis-state.rb
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2015-03-09 13:19:15 +0000
committerSteve Kemp <steve@steve.org.uk>2015-03-09 13:19:15 +0000
commita22b8e96ead33b0f97ed5243dbad7f7b6cd5135d (patch)
tree3fe30365cc9d793c752653a59614b52009ef9336 /lib/custodian/alerts/redis-state.rb
parent7782df6020704f51ee2d6194d8d3b74f28a53401 (diff)
Prefer single-quotes when you don't need interpolation.
So "foo" is less good than 'foo'.
Diffstat (limited to 'lib/custodian/alerts/redis-state.rb')
-rw-r--r--lib/custodian/alerts/redis-state.rb42
1 files changed, 21 insertions, 21 deletions
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