Browse files

Added android platform.

  • Loading branch information...
1 parent 5d8b0c6 commit 4a1ee3ab5a9df475040105e711f7d819d9ac9a90 @jnunemaker committed Jun 22, 2011
Showing with 3 additions and 0 deletions.
  1. +2 −0 lib/user_agent.rb
  2. +1 −0 spec/user_agents_spec.rb
View
2 lib/user_agent.rb
@@ -53,6 +53,7 @@ module Platform
Playstation = /playstation/i
Ipad = /ipad/i
Iphone = /iphone/i
+ Android = /android/i
end
def self.engine(string)
@@ -128,6 +129,7 @@ def self.platform(string)
case string
when Platform::Windows then :windows
when Platform::Mac then :macintosh
+ when Platform::Android then :android
when Platform::Linux then :linux
when Platform::Wii then :wii
when Platform::Playstation then :playstation
View
1 spec/user_agents_spec.rb
@@ -23,6 +23,7 @@ def test(name, version, platform, os, engine, engine_version, source)
test :safari, '4.0.4', :ipad, 'iPad OS 3.2', :webkit, '531.21.10', 'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10'
test :safari, '4.0.4', :ipad, 'iPad OS 3.2', :webkit, '531.21.10', 'Mozilla/5.0 (iPad; U; CPU iPhone OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10'
test :safari, '4.0', :iphone, 'iPhone OS 3.0', :webkit, '528.18', 'Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16'
+ test :safari, '4.0', :android, 'Linux', :webkit, '533.1', 'Mozilla/5.0 (Linux; U; Android 2.2; en-us; Nexus One Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1'
test :ie, '8.0', :windows, 'Windows 7', :msie, '8.0', 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.2; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)'
test :ie, '7.0b', :windows, 'Windows 2003', :msie, '7.0b', 'Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 5.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 3.0.04506.30)'
test :ie, '7.0', :windows, 'Windows XP', :msie, '7.0', 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.2)'

0 comments on commit 4a1ee3a

Please sign in to comment.