rss plugin: refactor select_nonempty
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Thu, 22 Jan 2009 16:12:54 +0000 (17:12 +0100)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Thu, 22 Jan 2009 16:34:25 +0000 (17:34 +0100)
commita4f819412afae636eee101aa3e627d5fc9fa30b5
tree88e711e8a97a1ee96bb9b2fc432a7d28edca2513
parent21ed1899d1515570c115d380559e7894414406f1
rss plugin: refactor select_nonempty

The plugin was using two distinct, rather horrible methods to pick one among
many fields of a given item.

We replace both methods with a new RSS::Element method that eval()s its
(String) arguments to return the first nonempty value.
data/rbot/plugins/rss.rb