mobileesp_converted 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/java_source/UAgentInfo.java +364 -241
- data/lib/mobileesp_converted/user_agent_info.rb +456 -300
- data/lib/mobileesp_converted/version.rb +1 -1
- data/spec/mobileesp_converted/user_agent_info_spec.rb +26 -0
- data/spec/spec_helper.rb +1 -1
- metadata +19 -5
- checksums.yaml +0 -7
@@ -42,6 +42,19 @@ module MobileESPConverted
|
|
42
42
|
uai.detect_android_tablet.must_equal false
|
43
43
|
end
|
44
44
|
|
45
|
+
it "categorizes Android 4 phone / Custom Android Browser" do
|
46
|
+
# UA string for Xiaomi Hongmi (Red Rice)
|
47
|
+
uai = UserAgentInfo.new("Mozilla/5.0 (Linux; U; Android 4.2.1; ru-ru; HM2013023 Build/JOP40D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30 XiaoMi/MiuiBrowser/1.0", "text/html")
|
48
|
+
uai.is_tier_tablet.must_equal false
|
49
|
+
uai.is_tier_iphone.must_equal true
|
50
|
+
uai.is_tier_rich_css.must_equal false
|
51
|
+
uai.is_tier_generic_mobile.must_equal false
|
52
|
+
uai.detect_iphone.must_equal false
|
53
|
+
uai.detect_ipad.must_equal false
|
54
|
+
uai.detect_android_phone.must_equal true
|
55
|
+
uai.detect_android_tablet.must_equal false
|
56
|
+
end
|
57
|
+
|
45
58
|
it "categorizes Android tablet / Android Browser" do
|
46
59
|
# UA string for Motorola Xoom
|
47
60
|
uai = UserAgentInfo.new("Mozilla/5.0 (Linux; U; Android 3.0; en-us; Xoom Build/HRI39) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13", "text/html")
|
@@ -55,6 +68,19 @@ module MobileESPConverted
|
|
55
68
|
uai.detect_android_tablet.must_equal true
|
56
69
|
end
|
57
70
|
|
71
|
+
it "categorizes Android tablet / Chrome Browser" do
|
72
|
+
# UA string for Chrome on Pipo M9 Pro
|
73
|
+
uai = UserAgentInfo.new("Mozilla/5.0 (Linux; Android 4.2.2; M9pro Build/JDQ39) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.59 Safari/537.36", "text/html")
|
74
|
+
uai.is_tier_tablet.must_equal true
|
75
|
+
uai.is_tier_iphone.must_equal false
|
76
|
+
uai.is_tier_rich_css.must_equal false
|
77
|
+
uai.is_tier_generic_mobile.must_equal false
|
78
|
+
uai.detect_iphone.must_equal false
|
79
|
+
uai.detect_ipad.must_equal false
|
80
|
+
uai.detect_android_phone.must_equal false
|
81
|
+
uai.detect_android_tablet.must_equal true
|
82
|
+
end
|
83
|
+
|
58
84
|
it "categorizes Android / Opera Mobile" do
|
59
85
|
# Opera Mobile 12
|
60
86
|
uai = UserAgentInfo.new("Opera/9.80 (Android 2.2.2; Linux; Opera Mobi/ADR-1202231246; U; en) Presto/2.10.254 Version/12.00", "text/html")
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mobileesp_converted
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Anthony Hand
|
@@ -9,11 +10,12 @@ authors:
|
|
9
10
|
autorequire:
|
10
11
|
bindir: bin
|
11
12
|
cert_chain: []
|
12
|
-
date: 2013-
|
13
|
+
date: 2013-12-13 00:00:00.000000000 Z
|
13
14
|
dependencies:
|
14
15
|
- !ruby/object:Gem::Dependency
|
15
16
|
name: pry
|
16
17
|
requirement: !ruby/object:Gem::Requirement
|
18
|
+
none: false
|
17
19
|
requirements:
|
18
20
|
- - '>='
|
19
21
|
- !ruby/object:Gem::Version
|
@@ -21,6 +23,7 @@ dependencies:
|
|
21
23
|
type: :development
|
22
24
|
prerelease: false
|
23
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
24
27
|
requirements:
|
25
28
|
- - '>='
|
26
29
|
- !ruby/object:Gem::Version
|
@@ -28,6 +31,7 @@ dependencies:
|
|
28
31
|
- !ruby/object:Gem::Dependency
|
29
32
|
name: rake
|
30
33
|
requirement: !ruby/object:Gem::Requirement
|
34
|
+
none: false
|
31
35
|
requirements:
|
32
36
|
- - '>='
|
33
37
|
- !ruby/object:Gem::Version
|
@@ -35,6 +39,7 @@ dependencies:
|
|
35
39
|
type: :development
|
36
40
|
prerelease: false
|
37
41
|
version_requirements: !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
38
43
|
requirements:
|
39
44
|
- - '>='
|
40
45
|
- !ruby/object:Gem::Version
|
@@ -42,6 +47,7 @@ dependencies:
|
|
42
47
|
- !ruby/object:Gem::Dependency
|
43
48
|
name: minitest
|
44
49
|
requirement: !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
45
51
|
requirements:
|
46
52
|
- - '>='
|
47
53
|
- !ruby/object:Gem::Version
|
@@ -49,6 +55,7 @@ dependencies:
|
|
49
55
|
type: :development
|
50
56
|
prerelease: false
|
51
57
|
version_requirements: !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
52
59
|
requirements:
|
53
60
|
- - '>='
|
54
61
|
- !ruby/object:Gem::Version
|
@@ -75,26 +82,33 @@ files:
|
|
75
82
|
- spec/spec_helper.rb
|
76
83
|
homepage: http://github.com/jistr/mobileesp_converted
|
77
84
|
licenses: []
|
78
|
-
metadata: {}
|
79
85
|
post_install_message:
|
80
86
|
rdoc_options: []
|
81
87
|
require_paths:
|
82
88
|
- lib
|
83
89
|
required_ruby_version: !ruby/object:Gem::Requirement
|
90
|
+
none: false
|
84
91
|
requirements:
|
85
92
|
- - '>='
|
86
93
|
- !ruby/object:Gem::Version
|
87
94
|
version: '0'
|
95
|
+
segments:
|
96
|
+
- 0
|
97
|
+
hash: 1514305537178076459
|
88
98
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
99
|
+
none: false
|
89
100
|
requirements:
|
90
101
|
- - '>='
|
91
102
|
- !ruby/object:Gem::Version
|
92
103
|
version: '0'
|
104
|
+
segments:
|
105
|
+
- 0
|
106
|
+
hash: 1514305537178076459
|
93
107
|
requirements: []
|
94
108
|
rubyforge_project:
|
95
|
-
rubygems_version:
|
109
|
+
rubygems_version: 1.8.25
|
96
110
|
signing_key:
|
97
|
-
specification_version:
|
111
|
+
specification_version: 3
|
98
112
|
summary: Provides device type detection based on HTTP request headers.
|
99
113
|
test_files:
|
100
114
|
- spec/mobileesp_converted/user_agent_info_spec.rb
|
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: ae03f87cff961def76b56962aed73db48528bfdf
|
4
|
-
data.tar.gz: cdf5ec3c048d83806ef0c2e500303e8548088c3f
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: 106ae85a5e1761016ddebc15c5079f431be7383e08a5e06a1df7b7f7ca3023ac7c288376b771f48b2d507aaea5667658010a9b28f2f8260bc96c51c12ff39cc3
|
7
|
-
data.tar.gz: 6dcf2c98ae3f5c3b0203d4604f5b7ab3bcc7d6c7c219bad4825fe599589d6060265d6fcf3e3fbd0c996b1b8fa28a7a1390d5c69463181efa4a8a26dbb0932d98
|