jpmobile 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README +32 -10
- data/Rakefile +8 -8
- data/doc/classes/ActionController.html +120 -0
- data/doc/classes/ActionController/AbstractRequest.html +118 -0
- data/doc/classes/ActionController/CgiRequest.html +160 -0
- data/doc/classes/ActionView.html +101 -0
- data/doc/classes/DatumConv.html +324 -0
- data/doc/classes/Jpmobile/Display.html +333 -0
- data/doc/classes/Jpmobile/Emoticon.html +467 -0
- data/doc/classes/Jpmobile/Filter.html +120 -0
- data/doc/classes/Jpmobile/Filter/ApplyOnlyForMobile.html +172 -0
- data/doc/classes/Jpmobile/Filter/Base.html +269 -0
- data/doc/classes/Jpmobile/Filter/Emoticon.html +118 -0
- data/doc/classes/Jpmobile/Filter/Emoticon/Inner.html +184 -0
- data/doc/classes/Jpmobile/Filter/Emoticon/Outer.html +207 -0
- data/doc/classes/Jpmobile/Filter/FilterTable.html +178 -0
- data/doc/classes/Jpmobile/Filter/HankakuKana.html +126 -0
- data/doc/classes/Jpmobile/Filter/Sjis.html +271 -0
- data/doc/classes/Jpmobile/Helpers.html +588 -0
- data/doc/classes/Jpmobile/Mobile.html +150 -0
- data/doc/classes/Jpmobile/Mobile/AbstractMobile.html +389 -0
- data/doc/classes/Jpmobile/Mobile/Au.html +420 -0
- data/doc/classes/Jpmobile/Mobile/Ddipocket.html +138 -0
- data/doc/classes/Jpmobile/Mobile/Docomo.html +411 -0
- data/doc/classes/Jpmobile/Mobile/Emobile.html +183 -0
- data/doc/classes/Jpmobile/Mobile/Jphone.html +212 -0
- data/doc/classes/Jpmobile/Mobile/Softbank.html +344 -0
- data/doc/classes/Jpmobile/Mobile/Vodafone.html +176 -0
- data/doc/classes/Jpmobile/Mobile/Willcom.html +211 -0
- data/doc/classes/Jpmobile/Position.html +384 -0
- data/doc/classes/Jpmobile/RequestWithMobile.html +263 -0
- data/doc/created.rid +1 -0
- data/doc/files/CHANGELOG.html +110 -0
- data/doc/files/README.html +455 -0
- data/doc/files/lib/jpmobile/datum_conv_rb.html +110 -0
- data/doc/files/lib/jpmobile/emoticon/au_rb.html +124 -0
- data/doc/files/lib/jpmobile/emoticon/conversion_table_rb.html +124 -0
- data/doc/files/lib/jpmobile/emoticon/docomo_rb.html +119 -0
- data/doc/files/lib/jpmobile/emoticon/softbank_rb.html +119 -0
- data/doc/files/lib/jpmobile/emoticon/z_combine_rb.html +101 -0
- data/doc/files/lib/jpmobile/emoticon_rb.html +101 -0
- data/doc/files/lib/jpmobile/filter_rb.html +115 -0
- data/doc/files/lib/jpmobile/helpers_rb.html +105 -0
- data/doc/files/lib/jpmobile/hook_abstract_request_rb.html +108 -0
- data/doc/files/lib/jpmobile/hook_action_controller_rb.html +101 -0
- data/doc/files/lib/jpmobile/hook_action_view_rb.html +110 -0
- data/doc/files/lib/jpmobile/mobile/abstract_mobile_rb.html +108 -0
- data/doc/files/lib/jpmobile/mobile/au_rb.html +112 -0
- data/doc/files/lib/jpmobile/mobile/display_rb.html +111 -0
- data/doc/files/lib/jpmobile/mobile/docomo_rb.html +105 -0
- data/doc/files/lib/jpmobile/mobile/emobile_rb.html +105 -0
- data/doc/files/lib/jpmobile/mobile/softbank_rb.html +115 -0
- data/doc/files/lib/jpmobile/mobile/willcom_rb.html +108 -0
- data/doc/files/lib/jpmobile/mobile/z_display_info_docomo_rb.html +114 -0
- data/doc/files/lib/jpmobile/mobile/z_ip_addresses_au_rb.html +114 -0
- data/doc/files/lib/jpmobile/mobile/z_ip_addresses_docomo_rb.html +124 -0
- data/doc/files/lib/jpmobile/mobile/z_ip_addresses_emobile_rb.html +111 -0
- data/doc/files/lib/jpmobile/mobile/z_ip_addresses_softbank_rb.html +124 -0
- data/doc/files/lib/jpmobile/mobile/z_ip_addresses_willcom_rb.html +114 -0
- data/doc/files/lib/jpmobile/position_rb.html +105 -0
- data/doc/files/lib/jpmobile/request_with_mobile_rb.html +111 -0
- data/doc/files/lib/jpmobile/trans_sid_rb.html +118 -0
- data/doc/files/lib/jpmobile/version_rb.html +101 -0
- data/doc/files/lib/jpmobile_rb.html +101 -0
- data/doc/fr_class_index.html +55 -0
- data/doc/fr_file_index.html +58 -0
- data/doc/fr_method_index.html +134 -0
- data/doc/index.html +24 -0
- data/doc/rdoc-style.css +208 -0
- data/lib/jpmobile.rb +32 -1
- data/lib/jpmobile/emoticon.rb +18 -0
- data/lib/jpmobile/emoticon/au.rb +643 -0
- data/lib/jpmobile/filter.rb +5 -1
- data/lib/jpmobile/helpers.rb +9 -1
- data/lib/jpmobile/hook_abstract_request.rb +3 -24
- data/lib/jpmobile/hook_action_controller.rb +2 -2
- data/lib/jpmobile/hook_action_view.rb +41 -8
- data/lib/jpmobile/mobile/abstract_mobile.rb +18 -12
- data/lib/jpmobile/mobile/au.rb +11 -5
- data/lib/jpmobile/mobile/docomo.rb +27 -11
- data/lib/jpmobile/mobile/emobile.rb +15 -0
- data/lib/jpmobile/mobile/softbank.rb +11 -7
- data/lib/jpmobile/mobile/willcom.rb +5 -2
- data/lib/jpmobile/mobile/z_display_info_docomo.rb +343 -219
- data/lib/jpmobile/mobile/z_ip_addresses_au.rb +4 -1
- data/lib/jpmobile/mobile/z_ip_addresses_docomo.rb +10 -0
- data/lib/jpmobile/mobile/z_ip_addresses_emobile.rb +10 -0
- data/lib/jpmobile/mobile/{z_ip_addresses.rb → z_ip_addresses_softbank.rb} +2 -13
- data/lib/jpmobile/mobile/z_ip_addresses_willcom.rb +20 -1
- data/lib/jpmobile/position.rb +2 -2
- data/lib/jpmobile/request_with_mobile.rb +44 -0
- data/lib/jpmobile/trans_sid.rb +52 -14
- data/lib/jpmobile/version.rb +1 -1
- data/test/au_test.rb +94 -63
- data/test/autoload_test.rb +49 -0
- data/test/docomo_test.rb +92 -59
- data/test/emoticon_functional_test.rb +30 -3
- data/test/filter_test.rb +0 -64
- data/test/helper.rb +8 -1
- data/test/helpers_test.rb +14 -13
- data/test/softbank_test.rb +113 -85
- data/test/willcom_test.rb +30 -20
- data/tools/generate_au_emoticon_table.rb +12 -3
- data/tools/update_display_info_docomo.rb +0 -0
- data/tools/update_ip_addresses_au.rb +1 -1
- data/tools/update_ip_addresses_willcom.rb +1 -1
- metadata +135 -54
- data/test/filter_functional_test.rb +0 -146
@@ -1,17 +1,20 @@
|
|
1
1
|
#!/usr/bin/ruby
|
2
2
|
|
3
3
|
# http://www.au.kddi.com/ezfactory/tec/spec/pdf/typeD.pdf から生成
|
4
|
+
# - OSXのpreviewで開き、すべてを選択してコピーし、テキストファイルに落とす
|
5
|
+
# - http://moriq.tdiary.net/20070212.html#p01
|
6
|
+
# などの手段によって生成する。
|
4
7
|
|
5
8
|
table = []
|
6
9
|
open("au.txt") do |f|
|
7
10
|
f.each do |l|
|
8
|
-
l.chomp!
|
11
|
+
l.chomp!
|
9
12
|
l.scan( /(([0-9A-F] )+)/ ) do |s|
|
10
13
|
s = s[0].gsub!(/ /, "")
|
11
14
|
next if s.size < 16
|
12
15
|
out = s[s.size-16,16]
|
13
|
-
table << [0,4,8].map{|i| out[i,4]}
|
14
|
-
end
|
16
|
+
table << a = [0,4,8,12].map{|i| out[i,4]}
|
17
|
+
end
|
15
18
|
end
|
16
19
|
end
|
17
20
|
|
@@ -22,4 +25,10 @@ open(File.dirname(__FILE__)+"/../lib/jpmobile/emoticon/au.rb","w") do |f|
|
|
22
25
|
end
|
23
26
|
f.puts "}.freeze"
|
24
27
|
f.puts "Jpmobile::Emoticon::AU_UNICODE_TO_SJIS = Jpmobile::Emoticon::AU_SJIS_TO_UNICODE.invert.freeze"
|
28
|
+
# EmailJIS -> UNICODE
|
29
|
+
f.puts "Jpmobile::Emoticon::AU_EMAILJIS_TO_UNICODE = {"
|
30
|
+
table.each do |a|
|
31
|
+
f.puts " 0x%s=>0x%s," % [a[2],a[1]]
|
32
|
+
end
|
33
|
+
f.puts "}.freeze"
|
25
34
|
end
|
File without changes
|
@@ -15,5 +15,5 @@ src.scan(/(\d+[..]\d+[..]\d+[..]\d+).*?(\/\d+)/m) {|a,b|
|
|
15
15
|
# 書き出し
|
16
16
|
open("lib/jpmobile/mobile/z_ip_addresses_au.rb","w") do |f|
|
17
17
|
f.puts "Jpmobile::Mobile::Au::IP_ADDRESSES = "
|
18
|
-
f.puts ips.pretty_inspect
|
18
|
+
f.puts "#{ips.pretty_inspect.chomp }.map {|ip| IPAddr.new(ip) }"
|
19
19
|
end
|
@@ -12,5 +12,5 @@ ips = src.scan(/(\d+\.\d+\.\d+\.\d+\/\d+)/).flatten
|
|
12
12
|
# 書き出し
|
13
13
|
open("lib/jpmobile/mobile/z_ip_addresses_willcom.rb","w") do |f|
|
14
14
|
f.puts "Jpmobile::Mobile::Willcom::IP_ADDRESSES ="
|
15
|
-
f.puts ips.pretty_inspect
|
15
|
+
f.puts "#{ips.pretty_inspect.chomp }.map {|ip| IPAddr.new(ip) }"
|
16
16
|
end
|
metadata
CHANGED
@@ -1,42 +1,123 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.9.4
|
3
|
-
specification_version: 1
|
4
2
|
name: jpmobile
|
5
3
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.0.
|
7
|
-
date: 2007-10-23 00:00:00 +09:00
|
8
|
-
summary: A Rails plugin for Japanese mobile-phones
|
9
|
-
require_paths:
|
10
|
-
- lib
|
11
|
-
email: dara@shidara.net
|
12
|
-
homepage: http://jpmobile.rubyforge.org
|
13
|
-
rubyforge_project: jpmobile
|
14
|
-
description: A Rails plugin for Japanese mobile-phones
|
15
|
-
autorequire: jpmobile
|
16
|
-
default_executable:
|
17
|
-
bindir: bin
|
18
|
-
has_rdoc: true
|
19
|
-
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
20
|
-
requirements:
|
21
|
-
- - ">"
|
22
|
-
- !ruby/object:Gem::Version
|
23
|
-
version: 0.0.0
|
24
|
-
version:
|
4
|
+
version: 0.0.3
|
25
5
|
platform: ruby
|
26
|
-
signing_key:
|
27
|
-
cert_chain:
|
28
|
-
post_install_message:
|
29
6
|
authors:
|
30
7
|
- dara
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2008-07-23 00:00:00 +09:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: actionpack
|
17
|
+
type: :runtime
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 2.1.0
|
24
|
+
version:
|
25
|
+
description: A Rails plugin for Japanese mobile-phones
|
26
|
+
email: dara@shidara.net
|
27
|
+
executables: []
|
28
|
+
|
29
|
+
extensions: []
|
30
|
+
|
31
|
+
extra_rdoc_files:
|
32
|
+
- README
|
33
|
+
- CHANGELOG
|
31
34
|
files:
|
32
35
|
- README
|
33
36
|
- CHANGELOG
|
34
37
|
- Rakefile
|
38
|
+
- doc/classes
|
39
|
+
- doc/classes/ActionController
|
40
|
+
- doc/classes/ActionController/AbstractRequest.html
|
41
|
+
- doc/classes/ActionController/CgiRequest.html
|
42
|
+
- doc/classes/ActionController.html
|
43
|
+
- doc/classes/ActionView.html
|
44
|
+
- doc/classes/DatumConv.html
|
45
|
+
- doc/classes/Jpmobile
|
46
|
+
- doc/classes/Jpmobile/Display.html
|
47
|
+
- doc/classes/Jpmobile/Emoticon.html
|
48
|
+
- doc/classes/Jpmobile/Filter
|
49
|
+
- doc/classes/Jpmobile/Filter/ApplyOnlyForMobile.html
|
50
|
+
- doc/classes/Jpmobile/Filter/Base.html
|
51
|
+
- doc/classes/Jpmobile/Filter/Emoticon
|
52
|
+
- doc/classes/Jpmobile/Filter/Emoticon/Inner.html
|
53
|
+
- doc/classes/Jpmobile/Filter/Emoticon/Outer.html
|
54
|
+
- doc/classes/Jpmobile/Filter/Emoticon.html
|
55
|
+
- doc/classes/Jpmobile/Filter/FilterTable.html
|
56
|
+
- doc/classes/Jpmobile/Filter/HankakuKana.html
|
57
|
+
- doc/classes/Jpmobile/Filter/Sjis.html
|
58
|
+
- doc/classes/Jpmobile/Filter.html
|
59
|
+
- doc/classes/Jpmobile/Helpers.html
|
60
|
+
- doc/classes/Jpmobile/Mobile
|
61
|
+
- doc/classes/Jpmobile/Mobile/AbstractMobile.html
|
62
|
+
- doc/classes/Jpmobile/Mobile/Au.html
|
63
|
+
- doc/classes/Jpmobile/Mobile/Ddipocket.html
|
64
|
+
- doc/classes/Jpmobile/Mobile/Docomo.html
|
65
|
+
- doc/classes/Jpmobile/Mobile/Emobile.html
|
66
|
+
- doc/classes/Jpmobile/Mobile/Jphone.html
|
67
|
+
- doc/classes/Jpmobile/Mobile/Softbank.html
|
68
|
+
- doc/classes/Jpmobile/Mobile/Vodafone.html
|
69
|
+
- doc/classes/Jpmobile/Mobile/Willcom.html
|
70
|
+
- doc/classes/Jpmobile/Mobile.html
|
71
|
+
- doc/classes/Jpmobile/Position.html
|
72
|
+
- doc/classes/Jpmobile/RequestWithMobile.html
|
73
|
+
- doc/created.rid
|
74
|
+
- doc/files
|
75
|
+
- doc/files/CHANGELOG.html
|
76
|
+
- doc/files/lib
|
77
|
+
- doc/files/lib/jpmobile
|
78
|
+
- doc/files/lib/jpmobile/datum_conv_rb.html
|
79
|
+
- doc/files/lib/jpmobile/emoticon
|
80
|
+
- doc/files/lib/jpmobile/emoticon/au_rb.html
|
81
|
+
- doc/files/lib/jpmobile/emoticon/conversion_table_rb.html
|
82
|
+
- doc/files/lib/jpmobile/emoticon/docomo_rb.html
|
83
|
+
- doc/files/lib/jpmobile/emoticon/softbank_rb.html
|
84
|
+
- doc/files/lib/jpmobile/emoticon/z_combine_rb.html
|
85
|
+
- doc/files/lib/jpmobile/emoticon_rb.html
|
86
|
+
- doc/files/lib/jpmobile/filter_rb.html
|
87
|
+
- doc/files/lib/jpmobile/helpers_rb.html
|
88
|
+
- doc/files/lib/jpmobile/hook_abstract_request_rb.html
|
89
|
+
- doc/files/lib/jpmobile/hook_action_controller_rb.html
|
90
|
+
- doc/files/lib/jpmobile/hook_action_view_rb.html
|
91
|
+
- doc/files/lib/jpmobile/mobile
|
92
|
+
- doc/files/lib/jpmobile/mobile/abstract_mobile_rb.html
|
93
|
+
- doc/files/lib/jpmobile/mobile/au_rb.html
|
94
|
+
- doc/files/lib/jpmobile/mobile/display_rb.html
|
95
|
+
- doc/files/lib/jpmobile/mobile/docomo_rb.html
|
96
|
+
- doc/files/lib/jpmobile/mobile/emobile_rb.html
|
97
|
+
- doc/files/lib/jpmobile/mobile/softbank_rb.html
|
98
|
+
- doc/files/lib/jpmobile/mobile/willcom_rb.html
|
99
|
+
- doc/files/lib/jpmobile/mobile/z_display_info_docomo_rb.html
|
100
|
+
- doc/files/lib/jpmobile/mobile/z_ip_addresses_au_rb.html
|
101
|
+
- doc/files/lib/jpmobile/mobile/z_ip_addresses_docomo_rb.html
|
102
|
+
- doc/files/lib/jpmobile/mobile/z_ip_addresses_emobile_rb.html
|
103
|
+
- doc/files/lib/jpmobile/mobile/z_ip_addresses_softbank_rb.html
|
104
|
+
- doc/files/lib/jpmobile/mobile/z_ip_addresses_willcom_rb.html
|
105
|
+
- doc/files/lib/jpmobile/position_rb.html
|
106
|
+
- doc/files/lib/jpmobile/request_with_mobile_rb.html
|
107
|
+
- doc/files/lib/jpmobile/trans_sid_rb.html
|
108
|
+
- doc/files/lib/jpmobile/version_rb.html
|
109
|
+
- doc/files/lib/jpmobile_rb.html
|
110
|
+
- doc/files/README.html
|
111
|
+
- doc/fr_class_index.html
|
112
|
+
- doc/fr_file_index.html
|
113
|
+
- doc/fr_method_index.html
|
114
|
+
- doc/index.html
|
115
|
+
- doc/rdoc-style.css
|
35
116
|
- test/au_test.rb
|
117
|
+
- test/autoload_test.rb
|
36
118
|
- test/docomo_test.rb
|
37
119
|
- test/emoticon_functional_test.rb
|
38
120
|
- test/emoticon_test.rb
|
39
|
-
- test/filter_functional_test.rb
|
40
121
|
- test/filter_test.rb
|
41
122
|
- test/helper.rb
|
42
123
|
- test/helpers_test.rb
|
@@ -61,13 +142,17 @@ files:
|
|
61
142
|
- lib/jpmobile/mobile/au.rb
|
62
143
|
- lib/jpmobile/mobile/display.rb
|
63
144
|
- lib/jpmobile/mobile/docomo.rb
|
145
|
+
- lib/jpmobile/mobile/emobile.rb
|
64
146
|
- lib/jpmobile/mobile/softbank.rb
|
65
147
|
- lib/jpmobile/mobile/willcom.rb
|
66
148
|
- lib/jpmobile/mobile/z_display_info_docomo.rb
|
67
|
-
- lib/jpmobile/mobile/z_ip_addresses.rb
|
68
149
|
- lib/jpmobile/mobile/z_ip_addresses_au.rb
|
150
|
+
- lib/jpmobile/mobile/z_ip_addresses_docomo.rb
|
151
|
+
- lib/jpmobile/mobile/z_ip_addresses_emobile.rb
|
152
|
+
- lib/jpmobile/mobile/z_ip_addresses_softbank.rb
|
69
153
|
- lib/jpmobile/mobile/z_ip_addresses_willcom.rb
|
70
154
|
- lib/jpmobile/position.rb
|
155
|
+
- lib/jpmobile/request_with_mobile.rb
|
71
156
|
- lib/jpmobile/trans_sid.rb
|
72
157
|
- lib/jpmobile/version.rb
|
73
158
|
- lib/jpmobile.rb
|
@@ -79,8 +164,9 @@ files:
|
|
79
164
|
- tools/update_display_info_docomo.rb
|
80
165
|
- tools/update_ip_addresses_au.rb
|
81
166
|
- tools/update_ip_addresses_willcom.rb
|
82
|
-
|
83
|
-
|
167
|
+
has_rdoc: true
|
168
|
+
homepage: http://jpmobile.rubyforge.org
|
169
|
+
post_install_message:
|
84
170
|
rdoc_options:
|
85
171
|
- --quiet
|
86
172
|
- --title
|
@@ -93,31 +179,26 @@ rdoc_options:
|
|
93
179
|
- --inline-source
|
94
180
|
- --exclude
|
95
181
|
- ^(examples|extras)/
|
96
|
-
|
97
|
-
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
182
|
+
require_paths:
|
183
|
+
- lib
|
184
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
185
|
+
requirements:
|
186
|
+
- - ">="
|
187
|
+
- !ruby/object:Gem::Version
|
188
|
+
version: "0"
|
189
|
+
version:
|
190
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - ">="
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: "0"
|
195
|
+
version:
|
103
196
|
requirements: []
|
104
197
|
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
- !ruby/object:Gem::Version
|
113
|
-
version: 1.12.5
|
114
|
-
version:
|
115
|
-
- !ruby/object:Gem::Dependency
|
116
|
-
name: hpricot
|
117
|
-
version_requirement:
|
118
|
-
version_requirements: !ruby/object:Gem::Version::Requirement
|
119
|
-
requirements:
|
120
|
-
- - ">="
|
121
|
-
- !ruby/object:Gem::Version
|
122
|
-
version: "0.4"
|
123
|
-
version:
|
198
|
+
rubyforge_project: jpmobile
|
199
|
+
rubygems_version: 1.2.0
|
200
|
+
signing_key:
|
201
|
+
specification_version: 2
|
202
|
+
summary: A Rails plugin for Japanese mobile-phones
|
203
|
+
test_files: []
|
204
|
+
|
@@ -1,146 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__)+'/helper'
|
2
|
-
|
3
|
-
class FilterTestControllerBase < ActionController::Base
|
4
|
-
def abracadabra
|
5
|
-
render :text=>"アブラカダブラ"
|
6
|
-
end
|
7
|
-
def query
|
8
|
-
@q = params[:q]
|
9
|
-
render :text=>@q
|
10
|
-
end
|
11
|
-
def binary
|
12
|
-
send_data "アブラカダブラ"
|
13
|
-
end
|
14
|
-
def xhtml
|
15
|
-
response.content_type = "application/xhtml+xml"
|
16
|
-
render :text=>"アブラカダブラ"
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
class FilterTestController < FilterTestControllerBase
|
21
|
-
mobile_filter
|
22
|
-
end
|
23
|
-
|
24
|
-
class HankakuFilterTestController < FilterTestControllerBase
|
25
|
-
mobile_filter :hankaku=>true
|
26
|
-
end
|
27
|
-
|
28
|
-
class FilterFunctionalTestOutput < Test::Unit::TestCase
|
29
|
-
def setup
|
30
|
-
init FilterTestController
|
31
|
-
end
|
32
|
-
def test_docomo
|
33
|
-
user_agent "DoCoMo/2.0 SH902i(c100;TB;W24H12)"
|
34
|
-
get :abracadabra
|
35
|
-
assert_equal "Shift_JIS", @response.charset
|
36
|
-
assert_equal "\203A\203u\203\211\203J\203_\203u\203\211", @response.body # "アブラカダブラ", 全角, Shift_JIS
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
class HankakuFilterFunctionalTestOutput < Test::Unit::TestCase
|
41
|
-
def setup
|
42
|
-
init HankakuFilterTestController
|
43
|
-
end
|
44
|
-
def test_pc
|
45
|
-
get :abracadabra
|
46
|
-
assert_equal "utf-8", @response.charset
|
47
|
-
assert_equal "アブラカダブラ", @response.body
|
48
|
-
end
|
49
|
-
def test_docomo_binary
|
50
|
-
user_agent "DoCoMo/2.0 SH902i(c100;TB;W24H12)"
|
51
|
-
get :binary
|
52
|
-
assert_equal "アブラカダブラ", @response.body
|
53
|
-
end
|
54
|
-
def test_docomo_xhtml
|
55
|
-
user_agent "DoCoMo/2.0 SH902i(c100;TB;W24H12)"
|
56
|
-
get :xhtml
|
57
|
-
assert_equal "Shift_JIS", @response.charset
|
58
|
-
assert_equal "\261\314\336\327\266\300\336\314\336\327", @response.body # "アブラカダブラ", 半角, Shift_JIS
|
59
|
-
end
|
60
|
-
def test_docomo
|
61
|
-
user_agent "DoCoMo/2.0 SH902i(c100;TB;W24H12)"
|
62
|
-
get :abracadabra
|
63
|
-
assert_equal "Shift_JIS", @response.charset
|
64
|
-
assert_equal "\261\314\336\327\266\300\336\314\336\327", @response.body # "アブラカダブラ", 半角, Shift_JIS
|
65
|
-
end
|
66
|
-
def test_jphone
|
67
|
-
user_agent "J-PHONE/3.0/V301D"
|
68
|
-
get :abracadabra
|
69
|
-
assert_equal "Shift_JIS", @response.charset
|
70
|
-
assert_equal "\261\314\336\327\266\300\336\314\336\327", @response.body # "アブラカダブラ", 半角, Shift_JIS
|
71
|
-
end
|
72
|
-
def test_au
|
73
|
-
user_agent "KDDI-CA32 UP.Browser/6.2.0.7.3.129 (GUI) MMP/2.0"
|
74
|
-
get :abracadabra
|
75
|
-
assert_equal "Shift_JIS", @response.charset
|
76
|
-
assert_equal "\261\314\336\327\266\300\336\314\336\327", @response.body # "アブラカダブラ", 半角, Shift_JIS
|
77
|
-
end
|
78
|
-
def test_softbank
|
79
|
-
user_agent "SoftBank/1.0/910T/TJ001/SN000000000000000 Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1"
|
80
|
-
get :abracadabra
|
81
|
-
assert_equal "utf-8", @response.charset
|
82
|
-
assert_equal "アブラカダブラ", @response.body
|
83
|
-
end
|
84
|
-
def test_vodafone
|
85
|
-
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"
|
86
|
-
get :abracadabra
|
87
|
-
assert_equal "utf-8", @response.charset
|
88
|
-
assert_equal "アブラカダブラ", @response.body
|
89
|
-
end
|
90
|
-
end
|
91
|
-
|
92
|
-
class FilterFunctionalTestInput < Test::Unit::TestCase
|
93
|
-
def setup
|
94
|
-
init FilterTestController
|
95
|
-
end
|
96
|
-
def test_docomo
|
97
|
-
user_agent "DoCoMo/2.0 SH902i(c100;TB;W24H12)"
|
98
|
-
get :query, :q=>"アブラカダブラ".tosjis
|
99
|
-
assert_equal "アブラカダブラ", assigns["q"]
|
100
|
-
get :query, :q=>"\261\314\336\327\266\300\336\314\336\327"
|
101
|
-
assert_equal "アブラカダブラ", assigns["q"]
|
102
|
-
end
|
103
|
-
end
|
104
|
-
|
105
|
-
class HankakuFilterFunctionalTestInput < Test::Unit::TestCase
|
106
|
-
def setup
|
107
|
-
init HankakuFilterTestController
|
108
|
-
end
|
109
|
-
def test_pc
|
110
|
-
get :query, :q=>"アブラカダブラ"
|
111
|
-
assert_equal "アブラカダブラ", assigns["q"]
|
112
|
-
end
|
113
|
-
def test_docomo
|
114
|
-
user_agent "DoCoMo/2.0 SH902i(c100;TB;W24H12)"
|
115
|
-
get :query, :q=>"アブラカダブラ".tosjis
|
116
|
-
assert_equal "アブラカダブラ", assigns["q"]
|
117
|
-
get :query, :q=>"\261\314\336\327\266\300\336\314\336\327"
|
118
|
-
assert_equal "アブラカダブラ", assigns["q"]
|
119
|
-
end
|
120
|
-
def test_jphone
|
121
|
-
user_agent "J-PHONE/3.0/V301D"
|
122
|
-
get :query, :q=>"アブラカダブラ".tosjis
|
123
|
-
assert_equal "アブラカダブラ", assigns["q"]
|
124
|
-
get :query, :q=>"\261\314\336\327\266\300\336\314\336\327"
|
125
|
-
assert_equal "アブラカダブラ", assigns["q"]
|
126
|
-
end
|
127
|
-
def test_au
|
128
|
-
user_agent "KDDI-CA32 UP.Browser/6.2.0.7.3.129 (GUI) MMP/2.0"
|
129
|
-
get :query, :q=>"アブラカダブラ".tosjis
|
130
|
-
assert_equal "アブラカダブラ", assigns["q"]
|
131
|
-
get :query, :q=>"\261\314\336\327\266\300\336\314\336\327"
|
132
|
-
assert_equal "アブラカダブラ", assigns["q"]
|
133
|
-
end
|
134
|
-
def test_softbank
|
135
|
-
user_agent "SoftBank/1.0/910T/TJ001/SN000000000000000 Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1"
|
136
|
-
get :query, :q=>"アブラカダブラ"
|
137
|
-
assert_equal "アブラカダブラ", assigns["q"]
|
138
|
-
get :query, :q=>"アブラカダブラ"
|
139
|
-
assert_equal "アブラカダブラ", assigns["q"]
|
140
|
-
end
|
141
|
-
def test_vodafone
|
142
|
-
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"
|
143
|
-
get :query, :q=>"アブラカダブラ"
|
144
|
-
assert_equal "アブラカダブラ", assigns["q"]
|
145
|
-
end
|
146
|
-
end
|