From 569243919426748b824b24a0ab9d3594bc8cabf0 Mon Sep 17 00:00:00 2001 From: franz Date: Mon, 15 Jun 2009 20:53:00 +0200 Subject: [PATCH] ruby 1.9: get rid of colons in case statements ruby 1.9 doesn't support colon as delimiter after when expression, so we use newline as delimiter. --- data/rbot/plugins/delicious.rb | 4 ++-- data/rbot/plugins/markov.rb | 6 +++--- data/rbot/plugins/weather.rb | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/data/rbot/plugins/delicious.rb b/data/rbot/plugins/delicious.rb index c2ab7d5d..53da34b4 100644 --- a/data/rbot/plugins/delicious.rb +++ b/data/rbot/plugins/delicious.rb @@ -78,10 +78,10 @@ class DeliciousPlugin < Plugin tags.tr(',', ' ').split(/\s+/).each do |t| if t.sub!(/^!/, '') case t - when 'nolog', 'no-log', 'dont-log', 'dontlog', 'skip': + when 'nolog', 'no-log', 'dont-log', 'dontlog', 'skip' debug "skipping #{url} on user request" return - when 'private', 'unshared', 'not-shared', 'notshared', 'hide': + when 'private', 'unshared', 'not-shared', 'notshared', 'hide' debug "hiding #{url} on user request" opts[:shared] = 'no' end diff --git a/data/rbot/plugins/markov.rb b/data/rbot/plugins/markov.rb index 1aa1a0b2..c2ef3a96 100755 --- a/data/rbot/plugins/markov.rb +++ b/data/rbot/plugins/markov.rb @@ -388,7 +388,7 @@ class MarkovPlugin < Plugin action = params[:action] user = params[:option] case action - when 'remove': + when 'remove' if @bot.config['markov.ignore'].include? user s = @bot.config['markov.ignore'] s.delete user @@ -397,7 +397,7 @@ class MarkovPlugin < Plugin else m.reply _("not found in list") end - when 'add': + when 'add' if user if @bot.config['markov.ignore'].include?(user) m.reply _("%{u} already in list") % { :u => user } @@ -408,7 +408,7 @@ class MarkovPlugin < Plugin else m.reply _("give the name of a person or channel to ignore") end - when 'list': + when 'list' m.reply _("I'm ignoring %{ignored}") % { :ignored => @bot.config['markov.ignore'].join(", ") } else m.reply _("have markov ignore the input from a hostmask or a channel. usage: markov ignore add ; markov ignore remove ; markov ignore list") diff --git a/data/rbot/plugins/weather.rb b/data/rbot/plugins/weather.rb index d8f7579c..cb0a2b18 100644 --- a/data/rbot/plugins/weather.rb +++ b/data/rbot/plugins/weather.rb @@ -35,9 +35,9 @@ class CurrentConditions end rescue OpenURI::HTTPError => e case e - when /304/: + when /304/ @iscached = true - when /404/: + when /404/ raise "Data for #{@station} not found" else raise "Error retrieving data: #{e}" -- 2.39.2