diff options
author | Steve Kemp <steve@steve.org.uk> | 2015-03-09 13:19:15 +0000 |
---|---|---|
committer | Steve Kemp <steve@steve.org.uk> | 2015-03-09 13:19:15 +0000 |
commit | a22b8e96ead33b0f97ed5243dbad7f7b6cd5135d (patch) | |
tree | 3fe30365cc9d793c752653a59614b52009ef9336 /lib/custodian/settings.rb | |
parent | 7782df6020704f51ee2d6194d8d3b74f28a53401 (diff) |
Prefer single-quotes when you don't need interpolation.
So "foo" is less good than 'foo'.
Diffstat (limited to 'lib/custodian/settings.rb')
-rw-r--r-- | lib/custodian/settings.rb | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/lib/custodian/settings.rb b/lib/custodian/settings.rb index 1739495..c4b11cb 100644 --- a/lib/custodian/settings.rb +++ b/lib/custodian/settings.rb @@ -35,7 +35,7 @@ module Custodian # # Load the configuration file; called only once. # - def _load( file = "/etc/custodian/custodian.cfg" ) + def _load( file = '/etc/custodian/custodian.cfg' ) @parsed = true @settings = {} @@ -48,7 +48,7 @@ module Custodian # # Load and "parse" the key=value content. # - File.open( file, "r" ).each_line do |line| + File.open( file, 'r' ).each_line do |line| next if line.nil? || line =~ /^#/ if line =~ /^(.*)=(.*)$/ key = $1.dup @@ -148,7 +148,7 @@ module Custodian def queue_type _load unless( _loaded? ) - @settings['queue_type'] || "redis" + @settings['queue_type'] || 'redis' end @@ -159,7 +159,7 @@ module Custodian def log_file _load unless( _loaded? ) - @settings['log_file'] || "custodian-dequeue.log" + @settings['log_file'] || 'custodian-dequeue.log' end @@ -169,7 +169,7 @@ module Custodian def alerter _load unless( _loaded? ) - @settings['alerter'] || "file" + @settings['alerter'] || 'file' end @@ -179,7 +179,7 @@ module Custodian def alert_source _load unless( _loaded? ) - @settings['alert_source'] || "Custodian" + @settings['alert_source'] || 'Custodian' end @@ -208,14 +208,14 @@ module Custodian # otherwise per-test defaults. case alert - when "smtp" - "root" - when "mauve" - "alert.bytemark.co.uk" - when "file" - "alerts.log" - when "redis" - "127.0.0.1:6379" + when 'smtp' + 'root' + when 'mauve' + 'alert.bytemark.co.uk' + when 'file' + 'alerts.log' + when 'redis' + '127.0.0.1:6379' else nil end |