mobileesp_converted 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -106,7 +106,7 @@ fun! s:ConvertKeywords()
106
106
  endfun
107
107
 
108
108
  fun! s:ConvertClassDefinitions()
109
- %s/public class/class/
109
+ %s/public class UAgentInfo/class UserAgentInfo/
110
110
  endfun
111
111
 
112
112
  fun! s:ConvertConstantDefinitions()
@@ -208,7 +208,7 @@ endfun
208
208
 
209
209
  fun! s:WrapIntoModule()
210
210
  normal gg
211
- call search("class UAgentInfo")
211
+ call search("class UserAgentInfo")
212
212
  exe "normal Omodule MobileESPConverted\e"
213
213
  normal G
214
214
  exe "normal oend\e"
@@ -1,5 +1,5 @@
1
1
  require "mobileesp_converted/version"
2
- require "mobileesp_converted/u_agent_info"
2
+ require "mobileesp_converted/user_agent_info"
3
3
 
4
4
  module MobileESPConverted
5
5
  end
@@ -68,7 +68,7 @@
68
68
 
69
69
  =end
70
70
  module MobileESPConverted
71
- class UAgentInfo
71
+ class UserAgentInfo
72
72
 
73
73
 
74
74
  attr_reader :user_agent
@@ -1,3 +1,3 @@
1
1
  module MobileESPConverted
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -1,10 +1,10 @@
1
1
  require_relative '../spec_helper'
2
2
 
3
3
  module MobileESPConverted
4
- class UAgentInfoSpec < MiniTest::Spec
5
- describe UAgentInfo do
4
+ class UserAgentInfoSpec < MiniTest::Spec
5
+ describe UserAgentInfo do
6
6
  it "categorizes iPhone/Safari" do
7
- uai = UAgentInfo.new("Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7", "text/html")
7
+ uai = UserAgentInfo.new("Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7", "text/html")
8
8
  uai.is_tier_tablet.must_equal false
9
9
  uai.is_tier_iphone.must_equal true
10
10
  uai.is_tier_rich_css.must_equal false
@@ -16,7 +16,7 @@ module MobileESPConverted
16
16
  end
17
17
 
18
18
  it "categorizes iPad/Safari" do
19
- uai = UAgentInfo.new("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", "text/html")
19
+ uai = UserAgentInfo.new("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", "text/html")
20
20
  uai.detect_ipad.must_equal true
21
21
  uai.is_iphone.must_equal false
22
22
  uai.is_tier_tablet.must_equal true
@@ -31,7 +31,7 @@ module MobileESPConverted
31
31
 
32
32
  it "categorizes Android phone / Android Browser" do
33
33
  # UA string for Google Nexus S
34
- uai = UAgentInfo.new("Mozilla/5.0 (Linux; U; Android 2.3.4; fr-fr; Nexus S Build/GRJ22) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1", "text/html")
34
+ uai = UserAgentInfo.new("Mozilla/5.0 (Linux; U; Android 2.3.4; fr-fr; Nexus S Build/GRJ22) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1", "text/html")
35
35
  uai.is_tier_tablet.must_equal false
36
36
  uai.is_tier_iphone.must_equal true
37
37
  uai.is_tier_rich_css.must_equal false
@@ -44,7 +44,7 @@ module MobileESPConverted
44
44
 
45
45
  it "categorizes Android tablet / Android Browser" do
46
46
  # UA string for Motorola Xoom
47
- uai = UAgentInfo.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")
47
+ 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")
48
48
  uai.is_tier_tablet.must_equal true
49
49
  uai.is_tier_iphone.must_equal false
50
50
  uai.is_tier_rich_css.must_equal false
@@ -57,7 +57,7 @@ module MobileESPConverted
57
57
 
58
58
  it "categorizes Android / Opera Mobile" do
59
59
  # Opera Mobile 12
60
- uai = UAgentInfo.new("Opera/9.80 (Android 2.2.2; Linux; Opera Mobi/ADR-1202231246; U; en) Presto/2.10.254 Version/12.00", "text/html")
60
+ 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")
61
61
  uai.is_tier_tablet.must_equal false
62
62
  uai.is_tier_iphone.must_equal true
63
63
  uai.is_tier_rich_css.must_equal false
@@ -70,7 +70,7 @@ module MobileESPConverted
70
70
  end
71
71
 
72
72
  it "categorizes Linux/Chrome" do
73
- uai = UAgentInfo.new("Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.46 Safari/535.11", "text/html")
73
+ uai = UserAgentInfo.new("Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.46 Safari/535.11", "text/html")
74
74
  uai.is_tier_tablet.must_equal false
75
75
  uai.is_tier_iphone.must_equal false
76
76
  uai.is_tier_rich_css.must_equal false
@@ -83,7 +83,7 @@ module MobileESPConverted
83
83
 
84
84
  it "categorizes Windows/IE" do
85
85
  # IE 9 on Windows 7
86
- uai = UAgentInfo.new("Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; Media Center PC 6.0; InfoPath.3; MS-RTC LM 8; Zune 4.7)", "text/html")
86
+ uai = UserAgentInfo.new("Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; Media Center PC 6.0; InfoPath.3; MS-RTC LM 8; Zune 4.7)", "text/html")
87
87
  uai.is_tier_tablet.must_equal false
88
88
  uai.is_tier_iphone.must_equal false
89
89
  uai.is_tier_rich_css.must_equal false
@@ -96,7 +96,7 @@ module MobileESPConverted
96
96
 
97
97
  it "categorizes Mac/Safari" do
98
98
  # Safari 5 on Snow Leopard
99
- uai = UAgentInfo.new("Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; de-at) AppleWebKit/533.21.1 (KHTML, like Gecko) Version/5.0.5 Safari/533.21.1", "text/html")
99
+ uai = UserAgentInfo.new("Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; de-at) AppleWebKit/533.21.1 (KHTML, like Gecko) Version/5.0.5 Safari/533.21.1", "text/html")
100
100
  uai.is_tier_tablet.must_equal false
101
101
  uai.is_tier_iphone.must_equal false
102
102
  uai.is_tier_rich_css.must_equal false
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mobileesp_converted
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -14,7 +14,7 @@ date: 2012-03-12 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: pry
17
- requirement: &22740900 !ruby/object:Gem::Requirement
17
+ requirement: &23808700 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: '0'
23
23
  type: :development
24
24
  prerelease: false
25
- version_requirements: *22740900
25
+ version_requirements: *23808700
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: minitest
28
- requirement: &22740460 !ruby/object:Gem::Requirement
28
+ requirement: &23808240 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,7 +33,7 @@ dependencies:
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
- version_requirements: *22740460
36
+ version_requirements: *23808240
37
37
  description: Autoconverted version (from Java to Ruby) of MobileESP library.
38
38
  email:
39
39
  - jistr@jistr.com
@@ -48,10 +48,10 @@ files:
48
48
  - convert_to_ruby.vim
49
49
  - java_source/UAgentInfo.java
50
50
  - lib/mobileesp_converted.rb
51
- - lib/mobileesp_converted/u_agent_info.rb
51
+ - lib/mobileesp_converted/user_agent_info.rb
52
52
  - lib/mobileesp_converted/version.rb
53
53
  - mobileesp_converted.gemspec
54
- - spec/mobileesp_converted/u_agent_info_spec.rb
54
+ - spec/mobileesp_converted/user_agent_info_spec.rb
55
55
  - spec/spec_helper.rb
56
56
  homepage: http://github.com/jistr/mobileesp_converted
57
57
  licenses: []
@@ -67,7 +67,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
67
67
  version: '0'
68
68
  segments:
69
69
  - 0
70
- hash: 3561921582123639498
70
+ hash: 595848370185603424
71
71
  required_rubygems_version: !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
@@ -76,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
76
  version: '0'
77
77
  segments:
78
78
  - 0
79
- hash: 3561921582123639498
79
+ hash: 595848370185603424
80
80
  requirements: []
81
81
  rubyforge_project:
82
82
  rubygems_version: 1.8.11