useragent_parser 0.0.4 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/config/regexes.yaml +829 -0
- data/lib/useragent_parser/parsers/device_parser.rb +38 -0
- data/lib/useragent_parser/parsers/os_parser.rb +39 -0
- data/lib/useragent_parser/{parser.rb → parsers/user_agent_parser.rb} +3 -7
- data/lib/useragent_parser/user_agent.rb +31 -9
- data/lib/useragent_parser/version.rb +1 -1
- data/lib/useragent_parser.rb +70 -29
- data/spec/fixtures/additional_os_tests.yaml +134 -0
- data/spec/fixtures/firefox_user_agent_strings.yaml +804 -804
- data/spec/fixtures/pgts_browser_list.yaml +37489 -37489
- data/spec/fixtures/test_device.yaml +31 -0
- data/spec/fixtures/test_user_agent_parser.yaml +216 -687
- data/spec/fixtures/test_user_agent_parser_os.yaml +346 -0
- data/spec/parsers/device_parser_spec.rb +18 -0
- data/spec/parsers/os_parser_spec.rb +35 -0
- data/spec/{useragent_parser → parsers}/useragent_parser_spec.rb +16 -20
- data/spec/user_agent_spec.rb +190 -0
- data/spec/useragent_parser_spec.rb +34 -0
- metadata +44 -21
- data/config/user_agent_parser.yaml +0 -259
- data/spec/useragent_parser/user_agent_spec.rb +0 -169
@@ -0,0 +1,31 @@
|
|
1
|
+
test_cases:
|
2
|
+
|
3
|
+
- user_agent_string: '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/7B367 Safari/531.21.10'
|
4
|
+
family: 'iPad'
|
5
|
+
is_mobile: True
|
6
|
+
is_spider: False
|
7
|
+
|
8
|
+
- user_agent_string: 'Mozilla/5.0 (iPod; U; CPU iPhone OS 4_3_2 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8H7 Safari/6533.18.5'
|
9
|
+
family: 'iPod'
|
10
|
+
is_mobile: True
|
11
|
+
is_spider: False
|
12
|
+
|
13
|
+
- user_agent_string: 'Mozilla/5.0 (iPhone; U; fr; CPU iPhone OS 4_2_1 like Mac OS X; fr) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148a Safari/6533.18.5'
|
14
|
+
family: 'iPhone'
|
15
|
+
is_mobile: True
|
16
|
+
is_spider: False
|
17
|
+
|
18
|
+
- user_agent_string: 'Mozilla/5.0 (Linux; U; Android 3.0.1; en-us; GT-P7510 Build/HRI83) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13'
|
19
|
+
family: 'GT-P7510'
|
20
|
+
is_mobile: True
|
21
|
+
is_spider: False
|
22
|
+
|
23
|
+
- user_agent_string: 'Mozilla/5.0 (PlayBook; U; RIM Tablet OS 1.0.0; en-US) AppleWebKit/534.8+ (KHTML, like Gecko) Version/0.0.1 Safari/534.8+'
|
24
|
+
family: 'Blackberry Playbook'
|
25
|
+
is_mobile: False
|
26
|
+
is_spider: False
|
27
|
+
|
28
|
+
- user_agent_string: 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)'
|
29
|
+
family: 'Spider'
|
30
|
+
is_mobile: False
|
31
|
+
is_spider: True
|