Spy vs Spy

Intelligent User Agent parsing for the future! Now in Black & White

This is user agent parsing with lots and lots of tests. And accurate results. Its awesome

Usage

>> require 'spy-vs-spy'
>> agent = SOC::SpyVsSpy.new("Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)")
<< #<SoldierOfCode::SpyVsSpy:0x100351a28 @version.major="5", @agent="Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)", @identifier="", @product_token="Mozilla/4.0 ", @mobile=["iPhone", "iPod", "BlackBerry", "Android", "HTC-", "LG", "Motorola", "Nokia", "Treo", "Pre/", "Samsung", "SonyEricsson"], @renderer="", @browser="MSIE", @engine="", @version.minor="5", @ostype="Windows", @platform="Desktop", @detail="(compatible; MSIE 5.5; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)">
>> agent.browser
<< "MSIE"
>> agent.version.to_s
<< "5.5"
>> agent.version.major
>> "5"