kevinelliott / agent_orange

Parse and process User Agents like a secret one
126 stars 36 forks source link

Added support for is_mobile? returning true on Google's mobile web #26

Closed twobitlabs closed 12 years ago

twobitlabs commented 12 years ago

Google has both desktop and mobile crawlers:

https://developers.google.com/webmasters/smartphone-sites/googlebot-mobile

This change makes it so is_mobile? returns true AND is_bot? returns true for the Google smartphone crawler and includes specs for both the desktop and mobile user agent. I opted to stay backwards compatible for the standard Google crawler user agent so that is_computer? continues to return false.

twobitlabs commented 12 years ago

This one should do the trick. I've updated the rspec tests as well. I'm getting a failure on the spec

AgentOrange::UserAgent checking with real browsers list should parse browsers from list

but that one is failing for me on master too so it's nothing introduced by this pull request.

kevinelliott commented 12 years ago

Nice job. Looks great @thuss and @twobitlabs. Merging.