toolmantim/user_agent_parser — pull request #2 by jnunemaker (2013-01-06 19:23:10+00:00)
Title: Ruby 1.8.7 Support

First I added support for 1.8.7. All that was needed was to upgrade the regexes.yaml file and tweak a few things.

Backwards compatibility change: versions are now strings. 1) This saves conversion. If you need them as numbers, simply call to_i. 2) It simplifies 1.8.7/1.9.x support. The parsing of strings to integers consistently was kind of a pain. Simply using strings made it way easier. 3) Most importantly, I feel this is more consistent. Because some version parts end up as strings (3pre, etc.), it is kind of hard to know if you are dealing with a string or an integer. With this change, you know. You will always have a string and if you want a number, all you need to do is convert it.

Consistency: The other changes I made were with regards to consistency -- of parenthesis, of newlines, of variable names, etc.

I'm happy to just use my fork if you feel I went a little overboard, but I thought I would send a pull request in case you were interested.

Thanks for the work of getting this all setup and working. It really wasn't too hard to get it to do what I needed to and this is far more accurate than the gem I'm using now.

Oh, also, the builds are all passing:
https://travis-ci.org/jnunemaker/user_agent_parser