]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
weather: use proper units text when using config option
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Mon, 26 Mar 2012 16:22:38 +0000 (18:22 +0200)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Mon, 26 Mar 2012 16:22:38 +0000 (18:22 +0200)
Previously, if units was false (no units specified), wu_units would
become "_false" instead of "_<whatever was in the config value>".

data/rbot/plugins/weather.rb

index 9d2b8aed5e3c368b49b62e30a3f6511d3fa8e4cd..36a5a88f4e78f4f15108c9bd1d32fd254e950214 100644 (file)
@@ -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