jpmobile 4.2.5 → 5.0.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -2
  3. data/jpmobile.gemspec +1 -2
  4. data/lib/jpmobile.rb +17 -7
  5. data/lib/jpmobile/configuration.rb +1 -1
  6. data/lib/jpmobile/encoding.rb +13 -19
  7. data/lib/jpmobile/{hook_action_controller.rb → fallback_view_selector.rb} +4 -6
  8. data/lib/jpmobile/filter.rb +13 -10
  9. data/lib/jpmobile/mobile/abstract_mobile.rb +2 -2
  10. data/lib/jpmobile/mobile/google_emoticon.rb +2 -2
  11. data/lib/jpmobile/mobile/smart_phone.rb +2 -2
  12. data/lib/jpmobile/mobile/unicode_emoticon.rb +2 -2
  13. data/lib/jpmobile/rack/filter.rb +36 -38
  14. data/lib/jpmobile/rack/mobile_carrier.rb +8 -10
  15. data/lib/jpmobile/rack/params_filter.rb +32 -34
  16. data/lib/jpmobile/rails.rb +17 -4
  17. data/lib/jpmobile/resolver.rb +2 -3
  18. data/lib/jpmobile/trans_sid.rb +58 -78
  19. data/lib/jpmobile/util.rb +0 -17
  20. data/lib/jpmobile/version.rb +1 -1
  21. data/lib/tasks/jpmobile_tasks.rake +31 -37
  22. data/spec/rack/jpmobile/android_spec.rb +2 -2
  23. data/spec/rack/jpmobile/au_spec.rb +17 -17
  24. data/spec/rack/jpmobile/black_berry_spec.rb +2 -2
  25. data/spec/rack/jpmobile/docomo_spec.rb +15 -15
  26. data/spec/rack/jpmobile/emoticon_spec.rb +57 -57
  27. data/spec/rack/jpmobile/filter_spec.rb +25 -25
  28. data/spec/rack/jpmobile/iphone_spec.rb +3 -3
  29. data/spec/rack/jpmobile/mobile_by_ua_spec.rb +3 -3
  30. data/spec/rack/jpmobile/params_filter_spec.rb +10 -10
  31. data/spec/rack/jpmobile/softbank_spec.rb +9 -9
  32. data/spec/rack/jpmobile/willcom_spec.rb +6 -6
  33. data/spec/rack/jpmobile/windows_phone.rb +2 -2
  34. data/spec/rack_helper.rb +0 -1
  35. data/spec/unit/mail_spec.rb +1 -10
  36. data/spec/unit/util_spec.rb +42 -56
  37. data/test/rails/overrides/Gemfile.jpmobile +5 -3
  38. data/test/rails/overrides/app/controllers/filter_controller.rb +0 -1
  39. data/test/rails/overrides/app/controllers/filter_controller_base.rb +14 -9
  40. data/test/rails/overrides/app/controllers/hankaku_input_filter_controller.rb +2 -2
  41. data/test/rails/overrides/app/controllers/trans_sid_metal_controller.rb +0 -1
  42. data/test/rails/overrides/app/views/filter/text_template.html.erb +1 -0
  43. data/test/rails/overrides/spec/controllers/mobile_spec_controller_spec.rb +3 -3
  44. data/test/rails/overrides/spec/controllers/trans_sid_controller_spec.rb +2 -2
  45. data/test/rails/overrides/spec/features/filter_spec.rb +10 -9
  46. data/test/rails/overrides/spec/helpers/helpers_spec.rb +5 -3
  47. data/test/rails/overrides/spec/requests/docomo_spec.rb +6 -6
  48. data/test/rails/overrides/spec/requests/emobile_spec.rb +6 -6
  49. data/test/rails/overrides/spec/requests/pc_spec.rb +3 -3
  50. data/test/rails/overrides/spec/requests/softbank_emulator_spec.rb +4 -4
  51. data/test/rails/overrides/spec/requests/template_path_spec.rb +1 -1
  52. data/test/rails/overrides/spec/requests/trans_sid_spec.rb +7 -9
  53. metadata +12 -28
  54. data/lib/jpmobile/hook_action_dispatch.rb +0 -2
  55. data/lib/jpmobile/rack.rb +0 -14
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  require File.join(File.expand_path(File.dirname(__FILE__)), '../../rack_helper.rb')
3
3
 
4
- describe Jpmobile::Rack::Filter do
4
+ describe Jpmobile::Filter do
5
5
  include Rack::Test::Methods
6
6
  include Jpmobile::RackHelper
7
7
 
@@ -18,7 +18,7 @@ describe Jpmobile::Rack::Filter do
18
18
  "REQUEST_METHOD" => "GET",
19
19
  'HTTP_USER_AGENT' => 'DoCoMo/2.0 SH906i(c100;TB;W24H16)',
20
20
  'Content-Type' => 'text/html; charset=utf-8')
21
- res = Jpmobile::Rack::MobileCarrier.new(Jpmobile::Rack::Filter.new(UnitApplication.new(@utf8))).call(res)
21
+ res = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@utf8))).call(res)
22
22
  expect(res[1]['Content-Type']).to eq("text/html; charset=Shift_JIS")
23
23
  expect(response_body(res)).to eq(@sjis)
24
24
  end
@@ -30,7 +30,7 @@ describe Jpmobile::Rack::Filter do
30
30
  "REQUEST_METHOD" => "GET",
31
31
  'HTTP_USER_AGENT' => 'DoCoMo/2.0 SH906i(c100;TB;W24H16)',
32
32
  'Content-Type' => 'application/xhtml+xml; charset=utf-8')
33
- res = Jpmobile::Rack::MobileCarrier.new(Jpmobile::Rack::Filter.new(UnitApplication.new(@utf8))).call(res)
33
+ res = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@utf8))).call(res)
34
34
  expect(res[1]['Content-Type']).to eq("application/xhtml+xml; charset=Shift_JIS")
35
35
  expect(response_body(res)).to eq(@sjis)
36
36
  end
@@ -41,7 +41,7 @@ describe Jpmobile::Rack::Filter do
41
41
  "REQUEST_METHOD" => "GET",
42
42
  'HTTP_USER_AGENT' => 'DoCoMo/2.0 SH906i(c100;TB;W24H16)',
43
43
  'Content-Type' => 'application/xml; charset=utf-8')
44
- res = Jpmobile::Rack::MobileCarrier.new(Jpmobile::Rack::Filter.new(UnitApplication.new(@utf8))).call(res)
44
+ res = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@utf8))).call(res)
45
45
  expect(res[1]['Content-Type']).to eq("application/xml; charset=utf-8")
46
46
  expect(response_body(res)).to eq(@utf8)
47
47
  end
@@ -52,7 +52,7 @@ describe Jpmobile::Rack::Filter do
52
52
  "REQUEST_METHOD" => "GET",
53
53
  'HTTP_USER_AGENT' => 'DoCoMo/2.0 SH906i(c100;TB;W24H16)',
54
54
  'Content-Type' => 'image/jpeg')
55
- res = Jpmobile::Rack::MobileCarrier.new(Jpmobile::Rack::Filter.new(UnitApplication.new(@utf8))).call(res)
55
+ res = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@utf8))).call(res)
56
56
  expect(res[1]['Content-Type']).to eq("image/jpeg")
57
57
  expect(response_body(res)).to eq(@utf8)
58
58
  end
@@ -63,7 +63,7 @@ describe Jpmobile::Rack::Filter do
63
63
  "REQUEST_METHOD" => "GET",
64
64
  'HTTP_USER_AGENT' => 'DoCoMo/2.0 SH906i(c100;TB;W24H16)',
65
65
  'Content-Type' => 'application/octet-stream')
66
- res = Jpmobile::Rack::MobileCarrier.new(Jpmobile::Rack::Filter.new(UnitApplication.new(@utf8))).call(res)
66
+ res = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@utf8))).call(res)
67
67
  expect(res[1]['Content-Type']).to eq("application/octet-stream")
68
68
  expect(response_body(res)).to eq(@utf8)
69
69
  end
@@ -74,7 +74,7 @@ describe Jpmobile::Rack::Filter do
74
74
  "REQUEST_METHOD" => "GET",
75
75
  'HTTP_USER_AGENT' => 'DoCoMo/2.0 SH906i(c100;TB;W24H16)',
76
76
  'Content-Type' => 'video/mpeg')
77
- res = Jpmobile::Rack::MobileCarrier.new(Jpmobile::Rack::Filter.new(UnitApplication.new(@utf8))).call(res)
77
+ res = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@utf8))).call(res)
78
78
  expect(res[1]['Content-Type']).to eq("video/mpeg")
79
79
  expect(response_body(res)).to eq(@utf8)
80
80
  end
@@ -88,7 +88,7 @@ describe Jpmobile::Rack::Filter do
88
88
  "REQUEST_METHOD" => "GET",
89
89
  'HTTP_USER_AGENT' => "KDDI-CA32 UP.Browser/6.2.0.7.3.129 (GUI) MMP/2.0",
90
90
  'Content-Type' => 'text/html; charset=utf-8')
91
- res = Jpmobile::Rack::MobileCarrier.new(Jpmobile::Rack::Filter.new(UnitApplication.new(@utf8))).call(res)
91
+ res = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@utf8))).call(res)
92
92
  expect(res[1]['Content-Type']).to eq("text/html; charset=Shift_JIS")
93
93
  expect(response_body(res)).to eq(@sjis)
94
94
  end
@@ -101,7 +101,7 @@ describe Jpmobile::Rack::Filter do
101
101
  "REQUEST_METHOD" => "GET",
102
102
  'HTTP_USER_AGENT' => "SoftBank/1.0/910T/TJ001/SN000000000000000 Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1",
103
103
  'Content-Type' => 'text/html; charset=utf-8')
104
- res = Jpmobile::Rack::MobileCarrier.new(Jpmobile::Rack::Filter.new(UnitApplication.new(@utf8))).call(res)
104
+ res = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@utf8))).call(res)
105
105
  expect(res[1]['Content-Type']).to eq("text/html; charset=utf-8")
106
106
  expect(response_body(res)).to eq(@utf8)
107
107
  end
@@ -113,11 +113,11 @@ describe Jpmobile::Rack::Filter do
113
113
  "REQUEST_METHOD" => "GET",
114
114
  'HTTP_USER_AGENT' => 'DoCoMo/2.0 SH906i(c100;TB;W24H16)',
115
115
  'Content-Type' => 'text/html; charset=utf-8')
116
- res = Jpmobile::Rack::MobileCarrier.new(Jpmobile::Rack::Filter.new(UnitApplication.new('<input name="utf8" type="hidden" value="&#x2713;" />'))).call(req)
116
+ res = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new('<input name="utf8" type="hidden" value="&#x2713;" />'))).call(req)
117
117
  expect(res[1]['Content-Type']).to eq("text/html; charset=Shift_JIS")
118
118
  expect(response_body(res)).to eq(" ")
119
119
 
120
- res = Jpmobile::Rack::MobileCarrier.new(Jpmobile::Rack::Filter.new(UnitApplication.new('<input name="utf8" type="hidden" value="&#x2713;">'))).call(req)
120
+ res = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new('<input name="utf8" type="hidden" value="&#x2713;">'))).call(req)
121
121
  expect(res[1]['Content-Type']).to eq("text/html; charset=Shift_JIS")
122
122
  expect(response_body(res)).to eq(" ")
123
123
  end
@@ -128,11 +128,11 @@ describe Jpmobile::Rack::Filter do
128
128
  "REQUEST_METHOD" => "GET",
129
129
  'HTTP_USER_AGENT' => 'DoCoMo/2.0 SH906i(c100;TB;W24H16)',
130
130
  'Content-Type' => 'text/html; charset=utf-8')
131
- res = Jpmobile::Rack::MobileCarrier.new(Jpmobile::Rack::Filter.new(UnitApplication.new("<input name=\"utf8\" type=\"hidden\" value=\"#{[10003].pack("U")}\" />"))).call(req)
131
+ res = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new("<input name=\"utf8\" type=\"hidden\" value=\"#{[10003].pack("U")}\" />"))).call(req)
132
132
  expect(res[1]['Content-Type']).to eq("text/html; charset=Shift_JIS")
133
133
  expect(response_body(res)).to eq(" ")
134
134
 
135
- res = Jpmobile::Rack::MobileCarrier.new(Jpmobile::Rack::Filter.new(UnitApplication.new("<input name=\"utf8\" type=\"hidden\" value=\"#{[10003].pack("U")}\">"))).call(req)
135
+ res = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new("<input name=\"utf8\" type=\"hidden\" value=\"#{[10003].pack("U")}\">"))).call(req)
136
136
  expect(res[1]['Content-Type']).to eq("text/html; charset=Shift_JIS")
137
137
  expect(response_body(res)).to eq(" ")
138
138
  end
@@ -161,7 +161,7 @@ describe Jpmobile::Rack::Filter do
161
161
  "REQUEST_METHOD" => "GET",
162
162
  'HTTP_USER_AGENT' => 'DoCoMo/2.0 SH906i(c100;TB;W24H16)',
163
163
  'Content-Type' => 'text/html; charset=utf-8')
164
- res = Jpmobile::Rack::MobileCarrier.new(Jpmobile::Rack::Filter.new(UnitApplication.new(@utf8 + @emoji_docomo_cr))).call(res)
164
+ res = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@utf8 + @emoji_docomo_cr))).call(res)
165
165
  expect(response_body(res)).to eq(@sjis + @docomo_emoji)
166
166
  end
167
167
 
@@ -171,7 +171,7 @@ describe Jpmobile::Rack::Filter do
171
171
  "REQUEST_METHOD" => "GET",
172
172
  'HTTP_USER_AGENT' => 'DoCoMo/2.0 SH906i(c100;TB;W24H16)',
173
173
  'Content-Type' => 'text/html; charset=utf-8')
174
- res = Jpmobile::Rack::MobileCarrier.new(Jpmobile::Rack::Filter.new(UnitApplication.new(@utf8 + @emoji_docomo_utf8))).call(res)
174
+ res = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@utf8 + @emoji_docomo_utf8))).call(res)
175
175
  expect(response_body(res)).to eq(@sjis + @docomo_emoji)
176
176
  end
177
177
 
@@ -181,7 +181,7 @@ describe Jpmobile::Rack::Filter do
181
181
  "REQUEST_METHOD" => "GET",
182
182
  'HTTP_USER_AGENT' => 'DoCoMo/2.0 SH906i(c100;TB;W24H16)',
183
183
  'Content-Type' => 'text/html; charset=utf-8')
184
- res = Jpmobile::Rack::MobileCarrier.new(Jpmobile::Rack::Filter.new(UnitApplication.new(@utf8 + @emoji_au_utf8))).call(res)
184
+ res = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@utf8 + @emoji_au_utf8))).call(res)
185
185
  expect(response_body(res)).to eq(@sjis + @docomo_emoji)
186
186
  end
187
187
 
@@ -191,7 +191,7 @@ describe Jpmobile::Rack::Filter do
191
191
  "REQUEST_METHOD" => "GET",
192
192
  'HTTP_USER_AGENT' => 'DoCoMo/2.0 SH906i(c100;TB;W24H16)',
193
193
  'Content-Type' => 'text/html; charset=utf-8')
194
- res = Jpmobile::Rack::MobileCarrier.new(Jpmobile::Rack::Filter.new(UnitApplication.new(@utf8 + @emoji_softbank_utf8))).call(res)
194
+ res = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@utf8 + @emoji_softbank_utf8))).call(res)
195
195
  expect(response_body(res)).to eq(@sjis + @docomo_emoji)
196
196
  end
197
197
  end
@@ -203,7 +203,7 @@ describe Jpmobile::Rack::Filter do
203
203
  "REQUEST_METHOD" => "GET",
204
204
  'HTTP_USER_AGENT' => "KDDI-CA32 UP.Browser/6.2.0.7.3.129 (GUI) MMP/2.0",
205
205
  'Content-Type' => 'text/html; charset=utf-8')
206
- res = Jpmobile::Rack::MobileCarrier.new(Jpmobile::Rack::Filter.new(UnitApplication.new(@utf8 + @emoji_au_cr))).call(res)
206
+ res = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@utf8 + @emoji_au_cr))).call(res)
207
207
  expect(response_body(res)).to eq(@sjis + @au_emoji)
208
208
  end
209
209
 
@@ -213,7 +213,7 @@ describe Jpmobile::Rack::Filter do
213
213
  "REQUEST_METHOD" => "GET",
214
214
  'HTTP_USER_AGENT' => "KDDI-CA32 UP.Browser/6.2.0.7.3.129 (GUI) MMP/2.0",
215
215
  'Content-Type' => 'text/html; charset=utf-8')
216
- res = Jpmobile::Rack::MobileCarrier.new(Jpmobile::Rack::Filter.new(UnitApplication.new(@utf8 + @emoji_docomo_utf8))).call(res)
216
+ res = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@utf8 + @emoji_docomo_utf8))).call(res)
217
217
  expect(response_body(res)).to eq(@sjis + @au_emoji)
218
218
  end
219
219
 
@@ -223,7 +223,7 @@ describe Jpmobile::Rack::Filter do
223
223
  "REQUEST_METHOD" => "GET",
224
224
  'HTTP_USER_AGENT' => "KDDI-CA32 UP.Browser/6.2.0.7.3.129 (GUI) MMP/2.0",
225
225
  'Content-Type' => 'text/html; charset=utf-8')
226
- res = Jpmobile::Rack::MobileCarrier.new(Jpmobile::Rack::Filter.new(UnitApplication.new(@utf8 + @emoji_au_utf8))).call(res)
226
+ res = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@utf8 + @emoji_au_utf8))).call(res)
227
227
  expect(response_body(res)).to eq(@sjis + @au_emoji)
228
228
  end
229
229
 
@@ -233,7 +233,7 @@ describe Jpmobile::Rack::Filter do
233
233
  "REQUEST_METHOD" => "GET",
234
234
  'HTTP_USER_AGENT' => "KDDI-CA32 UP.Browser/6.2.0.7.3.129 (GUI) MMP/2.0",
235
235
  'Content-Type' => 'text/html; charset=utf-8')
236
- res = Jpmobile::Rack::MobileCarrier.new(Jpmobile::Rack::Filter.new(UnitApplication.new(@utf8 + @emoji_softbank_utf8))).call(res)
236
+ res = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@utf8 + @emoji_softbank_utf8))).call(res)
237
237
  expect(response_body(res)).to eq(@sjis + @au_emoji)
238
238
  end
239
239
  end
@@ -245,7 +245,7 @@ describe Jpmobile::Rack::Filter do
245
245
  "REQUEST_METHOD" => "GET",
246
246
  'HTTP_USER_AGENT' => "SoftBank/1.0/910T/TJ001/SN000000000000000 Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1",
247
247
  'Content-Type' => 'text/html; charset=utf-8')
248
- res = Jpmobile::Rack::MobileCarrier.new(Jpmobile::Rack::Filter.new(UnitApplication.new(@utf8 + @emoji_softbank_cr))).call(res)
248
+ res = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@utf8 + @emoji_softbank_cr))).call(res)
249
249
  expect(response_body(res)).to eq(@utf8 + @softbank_emoji)
250
250
  end
251
251
 
@@ -255,7 +255,7 @@ describe Jpmobile::Rack::Filter do
255
255
  "REQUEST_METHOD" => "GET",
256
256
  'HTTP_USER_AGENT' => "SoftBank/1.0/910T/TJ001/SN000000000000000 Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1",
257
257
  'Content-Type' => 'text/html; charset=utf-8')
258
- res = Jpmobile::Rack::MobileCarrier.new(Jpmobile::Rack::Filter.new(UnitApplication.new(@utf8 + @emoji_docomo_utf8))).call(res)
258
+ res = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@utf8 + @emoji_docomo_utf8))).call(res)
259
259
  expect(response_body(res)).to eq(@utf8 + @softbank_emoji)
260
260
  end
261
261
 
@@ -265,7 +265,7 @@ describe Jpmobile::Rack::Filter do
265
265
  "REQUEST_METHOD" => "GET",
266
266
  'HTTP_USER_AGENT' => "SoftBank/1.0/910T/TJ001/SN000000000000000 Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1",
267
267
  'Content-Type' => 'text/html; charset=utf-8')
268
- res = Jpmobile::Rack::MobileCarrier.new(Jpmobile::Rack::Filter.new(UnitApplication.new(@utf8 + @emoji_au_utf8))).call(res)
268
+ res = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@utf8 + @emoji_au_utf8))).call(res)
269
269
  expect(response_body(res)).to eq(@utf8 + @softbank_emoji)
270
270
  end
271
271
 
@@ -275,7 +275,7 @@ describe Jpmobile::Rack::Filter do
275
275
  "REQUEST_METHOD" => "GET",
276
276
  'HTTP_USER_AGENT' => "SoftBank/1.0/910T/TJ001/SN000000000000000 Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1",
277
277
  'Content-Type' => 'text/html; charset=utf-8')
278
- res = Jpmobile::Rack::MobileCarrier.new(Jpmobile::Rack::Filter.new(UnitApplication.new(@utf8 + @emoji_softbank_utf8))).call(res)
278
+ res = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@utf8 + @emoji_softbank_utf8))).call(res)
279
279
  expect(response_body(res)).to eq(@utf8 + @softbank_emoji)
280
280
  end
281
281
  end
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  require File.join(File.expand_path(File.dirname(__FILE__)), '../../rack_helper.rb')
3
3
 
4
- describe Jpmobile::Rack::MobileCarrier, "iphone" do
4
+ describe Jpmobile::MobileCarrier, "iphone" do
5
5
  include Rack::Test::Methods
6
6
 
7
7
  context "端末種別で" do
@@ -9,7 +9,7 @@ describe Jpmobile::Rack::MobileCarrier, "iphone" do
9
9
  res = Rack::MockRequest.env_for(
10
10
  'http://jpmobile-rails.org/',
11
11
  'HTTP_USER_AGENT' => 'Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; ja-jp) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16')
12
- env = Jpmobile::Rack::MobileCarrier.new(UnitApplication.new).call(res)[1]
12
+ env = Jpmobile::MobileCarrier.new(UnitApplication.new).call(res)[1]
13
13
 
14
14
  expect(env['rack.jpmobile'].class).to eq(Jpmobile::Mobile::Iphone)
15
15
  expect(env['rack.jpmobile'].position).to be_nil
@@ -24,7 +24,7 @@ describe Jpmobile::Rack::MobileCarrier, "iphone" do
24
24
  'http://jpmobile-rails.org/',
25
25
  'HTTP_USER_AGENT' => 'Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; ja-jp) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16',
26
26
  "REMOTE_ADDR"=>"202.179.204.1")
27
- env = Jpmobile::Rack::MobileCarrier.new(UnitApplication.new).call(res)[1]
27
+ env = Jpmobile::MobileCarrier.new(UnitApplication.new).call(res)[1]
28
28
 
29
29
  expect(env['rack.jpmobile'].valid_ip?).to be_falsey
30
30
  end
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  require File.join(File.expand_path(File.dirname(__FILE__)), '../../rack_helper.rb')
3
3
 
4
- describe Jpmobile::Rack::MobileCarrier do
4
+ describe Jpmobile::MobileCarrier do
5
5
  include Rack::Test::Methods
6
6
 
7
7
  [
@@ -28,7 +28,7 @@ describe Jpmobile::Rack::MobileCarrier do
28
28
  res = Rack::MockRequest.env_for(
29
29
  'http://jpmobile-rails.org/',
30
30
  'HTTP_USER_AGENT' => user_agent)
31
- env = Jpmobile::Rack::MobileCarrier.new(UnitApplication.new).call(res)[1]
31
+ env = Jpmobile::MobileCarrier.new(UnitApplication.new).call(res)[1]
32
32
  expect(env['rack.jpmobile'].class).to eq(carrier)
33
33
  end
34
34
  end
@@ -37,7 +37,7 @@ describe Jpmobile::Rack::MobileCarrier do
37
37
  res = Rack::MockRequest.env_for(
38
38
  'http://jpmobile-rails.org/',
39
39
  'HTTP_USER_AGENT' => 'Googlebot')
40
- env = Jpmobile::Rack::MobileCarrier.new(UnitApplication.new).call(res)[1]
40
+ env = Jpmobile::MobileCarrier.new(UnitApplication.new).call(res)[1]
41
41
  expect(env['rack.jpmobile']).to be_nil
42
42
  end
43
43
  end
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  require File.join(File.expand_path(File.dirname(__FILE__)), '../../rack_helper.rb')
3
3
 
4
- describe Jpmobile::Rack::ParamsFilter do
4
+ describe Jpmobile::ParamsFilter do
5
5
  include Rack::Test::Methods
6
6
  include Jpmobile::RackHelper
7
7
  include Jpmobile::Util
@@ -37,7 +37,7 @@ describe Jpmobile::Rack::ParamsFilter do
37
37
  'HTTP_USER_AGENT' => 'DoCoMo/2.0 SH906i(c100;TB;W24H16)',
38
38
  :input => @form_string)
39
39
 
40
- res = Jpmobile::Rack::MobileCarrier.new(Jpmobile::Rack::ParamsFilter.new(UnitApplication.new)).call(res)
40
+ res = Jpmobile::MobileCarrier.new(Jpmobile::ParamsFilter.new(UnitApplication.new)).call(res)
41
41
  req = Rack::Request.new(res[1])
42
42
  expect(req.params.size).to eq(4)
43
43
 
@@ -58,7 +58,7 @@ describe Jpmobile::Rack::ParamsFilter do
58
58
  'HTTP_USER_AGENT' => "KDDI-CA32 UP.Browser/6.2.0.7.3.129 (GUI) MMP/2.0",
59
59
  :input => @form_string)
60
60
 
61
- res = Jpmobile::Rack::MobileCarrier.new(Jpmobile::Rack::ParamsFilter.new(UnitApplication.new)).call(res)
61
+ res = Jpmobile::MobileCarrier.new(Jpmobile::ParamsFilter.new(UnitApplication.new)).call(res)
62
62
  req = Rack::Request.new(res[1])
63
63
  expect(req.params.size).to eq(4)
64
64
 
@@ -90,7 +90,7 @@ describe Jpmobile::Rack::ParamsFilter do
90
90
  'HTTP_USER_AGENT' => "SoftBank/1.0/910T/TJ001/SN000000000000000 Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1",
91
91
  :input => @form_string)
92
92
 
93
- res = Jpmobile::Rack::MobileCarrier.new(Jpmobile::Rack::ParamsFilter.new(UnitApplication.new)).call(res)
93
+ res = Jpmobile::MobileCarrier.new(Jpmobile::ParamsFilter.new(UnitApplication.new)).call(res)
94
94
  req = Rack::Request.new(res[1])
95
95
  expect(req.params.size).to eq(4)
96
96
 
@@ -117,7 +117,7 @@ describe Jpmobile::Rack::ParamsFilter do
117
117
  'HTTP_USER_AGENT' => 'DoCoMo/2.0 SH906i(c100;TB;W24H16)',
118
118
  :input => form_string)
119
119
 
120
- res = Jpmobile::Rack::MobileCarrier.new(Jpmobile::Rack::ParamsFilter.new(UnitApplication.new)).call(res)
120
+ res = Jpmobile::MobileCarrier.new(Jpmobile::ParamsFilter.new(UnitApplication.new)).call(res)
121
121
  req = Rack::Request.new(res[1])
122
122
  expect(req.params.size).to eq(2)
123
123
 
@@ -138,7 +138,7 @@ describe Jpmobile::Rack::ParamsFilter do
138
138
  'HTTP_USER_AGENT' => "KDDI-CA32 UP.Browser/6.2.0.7.3.129 (GUI) MMP/2.0",
139
139
  :input => form_string)
140
140
 
141
- res = Jpmobile::Rack::MobileCarrier.new(Jpmobile::Rack::ParamsFilter.new(UnitApplication.new)).call(res)
141
+ res = Jpmobile::MobileCarrier.new(Jpmobile::ParamsFilter.new(UnitApplication.new)).call(res)
142
142
  req = Rack::Request.new(res[1])
143
143
  expect(req.params.size).to eq(2)
144
144
 
@@ -159,7 +159,7 @@ describe Jpmobile::Rack::ParamsFilter do
159
159
  'HTTP_USER_AGENT' => "SoftBank/1.0/910T/TJ001/SN000000000000000 Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1",
160
160
  :input => form_string)
161
161
 
162
- res = Jpmobile::Rack::MobileCarrier.new(Jpmobile::Rack::ParamsFilter.new(UnitApplication.new)).call(res)
162
+ res = Jpmobile::MobileCarrier.new(Jpmobile::ParamsFilter.new(UnitApplication.new)).call(res)
163
163
  req = Rack::Request.new(res[1])
164
164
  expect(req.params.size).to eq(2)
165
165
 
@@ -182,7 +182,7 @@ describe Jpmobile::Rack::ParamsFilter do
182
182
  'HTTP_USER_AGENT' => "SoftBank/1.0/910T/TJ001/SN000000000000000 Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1",
183
183
  :input => form_string)
184
184
 
185
- res = Jpmobile::Rack::MobileCarrier.new(Jpmobile::Rack::ParamsFilter.new(UnitApplication.new)).call(res)
185
+ res = Jpmobile::MobileCarrier.new(Jpmobile::ParamsFilter.new(UnitApplication.new)).call(res)
186
186
  req = Rack::Request.new(res[1])
187
187
  expect(req.params.size).to eq(1)
188
188
 
@@ -203,7 +203,7 @@ describe Jpmobile::Rack::ParamsFilter do
203
203
  'HTTP_USER_AGENT' => "KDDI-CA32 UP.Browser/6.2.0.7.3.129 (GUI) MMP/2.0",
204
204
  :input => form_string)
205
205
 
206
- res = Jpmobile::Rack::MobileCarrier.new(Jpmobile::Rack::ParamsFilter.new(UnitApplication.new)).call(res)
206
+ res = Jpmobile::MobileCarrier.new(Jpmobile::ParamsFilter.new(UnitApplication.new)).call(res)
207
207
  req = Rack::Request.new(res[1])
208
208
  expect(req.params.size).to eq(0)
209
209
 
@@ -224,7 +224,7 @@ describe Jpmobile::Rack::ParamsFilter do
224
224
  'HTTP_USER_AGENT' => "KDDI-CA32 UP.Browser/6.2.0.7.3.129 (GUI) MMP/2.0",
225
225
  :input => form_string)
226
226
 
227
- res = Jpmobile::Rack::MobileCarrier.new(Jpmobile::Rack::ParamsFilter.new(UnitApplication.new)).call(res)
227
+ res = Jpmobile::MobileCarrier.new(Jpmobile::ParamsFilter.new(UnitApplication.new)).call(res)
228
228
  req = Rack::Request.new(res[1])
229
229
  expect(req.params.size).to eq(0)
230
230
 
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  require File.join(File.expand_path(File.dirname(__FILE__)), '../../rack_helper.rb')
3
3
 
4
- describe Jpmobile::Rack::MobileCarrier, "softbank" do
4
+ describe Jpmobile::MobileCarrier, "softbank" do
5
5
  include Rack::Test::Methods
6
6
 
7
7
  context "端末種別で" do
@@ -9,7 +9,7 @@ describe Jpmobile::Rack::MobileCarrier, "softbank" do
9
9
  res = Rack::MockRequest.env_for(
10
10
  'http://jpmobile-rails.org/',
11
11
  'HTTP_USER_AGENT' => "SoftBank/1.0/910T/TJ001/SN000000000000000 Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1")
12
- env = Jpmobile::Rack::MobileCarrier.new(UnitApplication.new).call(res)[1]
12
+ env = Jpmobile::MobileCarrier.new(UnitApplication.new).call(res)[1]
13
13
 
14
14
  expect(env['rack.jpmobile'].class).to eq(Jpmobile::Mobile::Softbank)
15
15
  expect(env['rack.jpmobile'].position).to be_nil
@@ -26,7 +26,7 @@ describe Jpmobile::Rack::MobileCarrier, "softbank" do
26
26
  'http://jpmobile-rails.org/',
27
27
  'HTTP_USER_AGENT' => "SoftBank/1.0/910T/TJ001/SN000000000000000 Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1",
28
28
  "HTTP_X_JPHONE_UID" => "aaaaaaaaaaaaaaaa")
29
- env = Jpmobile::Rack::MobileCarrier.new(UnitApplication.new).call(res)[1]
29
+ env = Jpmobile::MobileCarrier.new(UnitApplication.new).call(res)[1]
30
30
 
31
31
  expect(env['rack.jpmobile'].serial_number).to eq("000000000000000")
32
32
  expect(env['rack.jpmobile'].x_jphone_uid).to eq("aaaaaaaaaaaaaaaa")
@@ -40,7 +40,7 @@ describe Jpmobile::Rack::MobileCarrier, "softbank" do
40
40
  res = Rack::MockRequest.env_for(
41
41
  'http://jpmobile-rails.org/',
42
42
  'HTTP_USER_AGENT' => "Vodafone/1.0/V903T/TJ001 Browser/VF-Browser/1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 Ext-J-Profile/JSCL-1.2.2 Ext-V-Profile/VSCL-2.0.0")
43
- env = Jpmobile::Rack::MobileCarrier.new(UnitApplication.new).call(res)[1]
43
+ env = Jpmobile::MobileCarrier.new(UnitApplication.new).call(res)[1]
44
44
 
45
45
  expect(env['rack.jpmobile'].class).to eq(Jpmobile::Mobile::Vodafone)
46
46
  expect(env['rack.jpmobile'].position).to be_nil
@@ -55,7 +55,7 @@ describe Jpmobile::Rack::MobileCarrier, "softbank" do
55
55
  'http://jpmobile-rails.org/',
56
56
  'HTTP_USER_AGENT' => "Vodafone/1.0/V903T/TJ001 Browser/VF-Browser/1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 Ext-J-Profile/JSCL-1.2.2 Ext-V-Profile/VSCL-2.0.0",
57
57
  "QUERY_STRING" => "pos=N43.3.18.42E141.21.1.88&geo=wgs84&x-acr=1")
58
- env = Jpmobile::Rack::MobileCarrier.new(UnitApplication.new).call(res)[1]
58
+ env = Jpmobile::MobileCarrier.new(UnitApplication.new).call(res)[1]
59
59
 
60
60
  expect(env['rack.jpmobile'].position.lat).to be_within(1e-7).of(43.05511667)
61
61
  expect(env['rack.jpmobile'].position.lon).to be_within(1e-7).of(141.3505222)
@@ -71,7 +71,7 @@ describe Jpmobile::Rack::MobileCarrier, "softbank" do
71
71
  'http://jpmobile-rails.org/',
72
72
  'HTTP_USER_AGENT' => "Vodafone/1.0/V903T/TJ001 Browser/VF-Browser/1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 Ext-J-Profile/JSCL-1.2.2 Ext-V-Profile/VSCL-2.0.0",
73
73
  "REMOTE_ADDR"=>"210.146.7.199")
74
- env = Jpmobile::Rack::MobileCarrier.new(UnitApplication.new).call(res)[1]
74
+ env = Jpmobile::MobileCarrier.new(UnitApplication.new).call(res)[1]
75
75
 
76
76
  expect(env['rack.jpmobile'].valid_ip?).to be_truthy
77
77
  end
@@ -81,7 +81,7 @@ describe Jpmobile::Rack::MobileCarrier, "softbank" do
81
81
  'http://jpmobile-rails.org/',
82
82
  'HTTP_USER_AGENT' => "Vodafone/1.0/V903T/TJ001 Browser/VF-Browser/1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 Ext-J-Profile/JSCL-1.2.2 Ext-V-Profile/VSCL-2.0.0",
83
83
  "REMOTE_ADDR"=>"127.0.0.1")
84
- env = Jpmobile::Rack::MobileCarrier.new(UnitApplication.new).call(res)[1]
84
+ env = Jpmobile::MobileCarrier.new(UnitApplication.new).call(res)[1]
85
85
 
86
86
  expect(env['rack.jpmobile'].valid_ip?).to be_falsey
87
87
  end
@@ -94,7 +94,7 @@ describe Jpmobile::Rack::MobileCarrier, "softbank" do
94
94
  'HTTP_USER_AGENT' => "Vodafone/1.0/V903T/TJ001 Browser/VF-Browser/1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 Ext-J-Profile/JSCL-1.2.2 Ext-V-Profile/VSCL-2.0.0",
95
95
  "HTTP_X_JPHONE_DISPLAY"=>"240*320",
96
96
  "HTTP_X_JPHONE_COLOR"=>"C262144")
97
- env = Jpmobile::Rack::MobileCarrier.new(UnitApplication.new).call(res)[1]
97
+ env = Jpmobile::MobileCarrier.new(UnitApplication.new).call(res)[1]
98
98
 
99
99
  expect(env['rack.jpmobile'].display.width).to eq(240)
100
100
  expect(env['rack.jpmobile'].display.height).to eq(320)
@@ -108,7 +108,7 @@ describe Jpmobile::Rack::MobileCarrier, "softbank" do
108
108
  res = Rack::MockRequest.env_for(
109
109
  'http://jpmobile-rails.org/',
110
110
  'HTTP_USER_AGENT' => "Vodafone/1.0/V903T/TJ001 Browser/VF-Browser/1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 Ext-J-Profile/JSCL-1.2.2 Ext-V-Profile/VSCL-2.0.0")
111
- env = Jpmobile::Rack::MobileCarrier.new(UnitApplication.new).call(res)[1]
111
+ env = Jpmobile::MobileCarrier.new(UnitApplication.new).call(res)[1]
112
112
 
113
113
  expect(env['rack.jpmobile'].display.width).to be_nil
114
114
  expect(env['rack.jpmobile'].display.height).to be_nil
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  require File.join(File.expand_path(File.dirname(__FILE__)), '../../rack_helper.rb')
3
3
 
4
- describe Jpmobile::Rack::MobileCarrier, "willcom" do
4
+ describe Jpmobile::MobileCarrier, "willcom" do
5
5
  include Rack::Test::Methods
6
6
 
7
7
  context "端末種別で" do
@@ -9,7 +9,7 @@ describe Jpmobile::Rack::MobileCarrier, "willcom" do
9
9
  res = Rack::MockRequest.env_for(
10
10
  'http://jpmobile-rails.org/',
11
11
  'HTTP_USER_AGENT' => "Mozilla/3.0(WILLCOM;KYOCERA/WX310K/2;1.2.2.16.000000/0.1/C100) Opera 7.0")
12
- env = Jpmobile::Rack::MobileCarrier.new(UnitApplication.new).call(res)[1]
12
+ env = Jpmobile::MobileCarrier.new(UnitApplication.new).call(res)[1]
13
13
 
14
14
  expect(env['rack.jpmobile'].class).to eq(Jpmobile::Mobile::Willcom)
15
15
  expect(env['rack.jpmobile'].position).to be_nil
@@ -21,7 +21,7 @@ describe Jpmobile::Rack::MobileCarrier, "willcom" do
21
21
  res = Rack::MockRequest.env_for(
22
22
  'http://jpmobile-rails.org/',
23
23
  'HTTP_USER_AGENT' => "Mozilla/3.0(DDIPOCKET;KYOCERA/AH-K3001V/1.8.2.71.000000/0.1/C100) Opera 7.0")
24
- env = Jpmobile::Rack::MobileCarrier.new(UnitApplication.new).call(res)[1]
24
+ env = Jpmobile::MobileCarrier.new(UnitApplication.new).call(res)[1]
25
25
 
26
26
  expect(env['rack.jpmobile'].class).to eq(Jpmobile::Mobile::Ddipocket)
27
27
  expect(env['rack.jpmobile'].position).to be_nil
@@ -36,7 +36,7 @@ describe Jpmobile::Rack::MobileCarrier, "willcom" do
36
36
  'http://jpmobile-rails.org/',
37
37
  'HTTP_USER_AGENT' => "Mozilla/3.0(WILLCOM;KYOCERA/WX310K/2;1.2.2.16.000000/0.1/C100) Opera 7.0",
38
38
  "QUERY_STRING" => "pos=N43.04.34.049E141.21.03.279")
39
- env = Jpmobile::Rack::MobileCarrier.new(UnitApplication.new).call(res)[1]
39
+ env = Jpmobile::MobileCarrier.new(UnitApplication.new).call(res)[1]
40
40
 
41
41
  expect(env['rack.jpmobile'].position.lat).to be_within(1e-4).of(43.078568)
42
42
  expect(env['rack.jpmobile'].position.lon).to be_within(1e-4).of(141.347223)
@@ -49,7 +49,7 @@ describe Jpmobile::Rack::MobileCarrier, "willcom" do
49
49
  'http://jpmobile-rails.org/',
50
50
  'HTTP_USER_AGENT' => "Mozilla/3.0(WILLCOM;KYOCERA/WX310K/2;1.2.2.16.000000/0.1/C100) Opera 7.0",
51
51
  "REMOTE_ADDR" => "61.198.142.1")
52
- env = Jpmobile::Rack::MobileCarrier.new(UnitApplication.new).call(res)[1]
52
+ env = Jpmobile::MobileCarrier.new(UnitApplication.new).call(res)[1]
53
53
 
54
54
  expect(env['rack.jpmobile'].valid_ip?).to be_truthy
55
55
  end
@@ -59,7 +59,7 @@ describe Jpmobile::Rack::MobileCarrier, "willcom" do
59
59
  'http://jpmobile-rails.org/',
60
60
  'HTTP_USER_AGENT' => "Mozilla/3.0(WILLCOM;KYOCERA/WX310K/2;1.2.2.16.000000/0.1/C100) Opera 7.0",
61
61
  "REMOTE_ADDR" => "127.0.0.1")
62
- env = Jpmobile::Rack::MobileCarrier.new(UnitApplication.new).call(res)[1]
62
+ env = Jpmobile::MobileCarrier.new(UnitApplication.new).call(res)[1]
63
63
 
64
64
  expect(env['rack.jpmobile'].valid_ip?).to be_falsey
65
65
  end