diff options
author | franz <Franz.Netykafka@runbox.com> | 2009-06-15 20:53:00 +0200 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2009-08-26 23:31:37 +0200 |
commit | 569243919426748b824b24a0ab9d3594bc8cabf0 (patch) | |
tree | 67cab95ff4790bd1e2135ddb6e68373e78028735 | |
parent | 40c32ccb24cdaac307d4cf12646c3e869817a153 (diff) |
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.
-rw-r--r-- | data/rbot/plugins/delicious.rb | 4 | ||||
-rwxr-xr-x | data/rbot/plugins/markov.rb | 6 | ||||
-rw-r--r-- | 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 <mask or channel>; markov ignore remove <mask or channel>; 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}" |