]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
ruby 1.9: get rid of colons in case statements
authorfranz <Franz.Netykafka@runbox.com>
Mon, 15 Jun 2009 18:53:00 +0000 (20:53 +0200)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Wed, 26 Aug 2009 21:31:37 +0000 (23:31 +0200)
ruby 1.9 doesn't support colon as delimiter after when expression,
so we use newline as delimiter.

data/rbot/plugins/delicious.rb
data/rbot/plugins/markov.rb
data/rbot/plugins/weather.rb

index c2ab7d5d1625f763d39c9f5b56647b84f5b86472..53da34b41da15917003de9d2baa84d1879747dac 100644 (file)
@@ -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
index 1aa1a0b236d0e89610a7ffbfe090858b8cf0bb7f..c2ef3a961c86040ff996e7a11b681c8182a8250a 100755 (executable)
@@ -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 <mask or channel>; markov ignore remove <mask or channel>; markov ignore list")
index d8f7579c95c45cda0ce9d93480b164f4e260d116..cb0a2b186a955bdb61a5861c8ef30a8f71c35c45 100644 (file)
@@ -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}"