
This Ruby gem is simple and comprehensive for parsing user agent strings with the help of BrowserScope's UA database.
The ua-parser database is included via git submodule. To update the database the submodule needs to be updated and the gem is re-released, the gem includes a user_agent_parser bin command which will read from standard input, and parse each line and prints the results.