detecting bots by user-agent in rails

First i thought using the browser-gem and browser.bot? would give me the correct answer. But somehow it did not work. So i am now using this litte snippet to detect bots.

1class BotDetection
2 
3  def self.bot?(agent)
4    matches = nil
5    matches = agent.match(/(facebook|postrank|voyager|twitterbot|googlebot|slurp|butterfly|pycurl|tweetmemebot|metauri|evrinid|reddit|digg|sitebot|msnbot|robot)/mi) if agent
6    return (agent.nil? or matches)
7   end
8 
9end

In my Base-Controller:

1def bot_request?
2  uAgent = request.env["HTTP_USER_AGENT"]
3  if(uAgent.nil?)
4    false
5  else
6    BotDetection.bot?(uAgent)
7  end
8end

A list of user-agents may be found at http://www.user-agents.org/