summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2012-03-26 18:22:38 +0200
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2012-03-26 18:22:38 +0200
commite14bb61eeed956dda60f2e2ad3a3b9cc8667306a (patch)
tree711da88887b10049602225b424e1dd0c158694d4
parentc7b9d8dee7128b2fa1a3f0244c7005d7bef0b7a2 (diff)
weather: use proper units text when using config option
Previously, if units was false (no units specified), wu_units would become "_false" instead of "_<whatever was in the config value>".
-rw-r--r--data/rbot/plugins/weather.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/data/rbot/plugins/weather.rb b/data/rbot/plugins/weather.rb
index 9d2b8aed..36a5a88f 100644
--- a/data/rbot/plugins/weather.rb
+++ b/data/rbot/plugins/weather.rb
@@ -130,7 +130,9 @@ class WeatherPlugin < Plugin
wu_units = String.new
- case (units || @bot.config['weather.units']).to_sym
+ units = @bot.config['weather.units'] unless units
+
+ case units.to_sym
when :english, :metric
wu_units = "_#{units}"
when :both