jpmobile 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. data/CHANGELOG +4 -0
  2. data/README +8 -5
  3. data/Rakefile +6 -7
  4. data/lib/jpmobile.rb +12 -2
  5. data/lib/jpmobile/email.rb +19 -0
  6. data/lib/jpmobile/filter.rb +1 -15
  7. data/lib/jpmobile/helpers.rb +76 -34
  8. data/lib/jpmobile/hook_action_controller.rb +1 -0
  9. data/lib/jpmobile/hook_action_view.rb +79 -28
  10. data/lib/jpmobile/mobile/abstract_mobile.rb +13 -1
  11. data/lib/jpmobile/mobile/au.rb +2 -0
  12. data/lib/jpmobile/mobile/docomo.rb +3 -1
  13. data/lib/jpmobile/mobile/emobile.rb +2 -0
  14. data/lib/jpmobile/mobile/softbank.rb +7 -1
  15. data/lib/jpmobile/mobile/willcom.rb +4 -0
  16. data/lib/jpmobile/mobile/z_display_info_docomo.rb +85 -2
  17. data/lib/jpmobile/mobile/z_ip_addresses_au.rb +40 -25
  18. data/lib/jpmobile/mobile/z_ip_addresses_docomo.rb +3 -1
  19. data/lib/jpmobile/mobile/z_ip_addresses_willcom.rb +97 -76
  20. data/lib/jpmobile/position.rb +8 -2
  21. data/lib/jpmobile/request_with_mobile.rb +1 -1
  22. data/lib/jpmobile/util.rb +21 -0
  23. data/lib/jpmobile/version.rb +1 -1
  24. data/test/au_test.rb +1 -1
  25. data/tools/update_display_info_docomo.rb +1 -0
  26. data/tools/update_ip_addresses_willcom.rb +2 -1
  27. metadata +36 -82
  28. data/doc/classes/ActionController.html +0 -120
  29. data/doc/classes/ActionController/AbstractRequest.html +0 -118
  30. data/doc/classes/ActionController/CgiRequest.html +0 -160
  31. data/doc/classes/ActionView.html +0 -101
  32. data/doc/classes/DatumConv.html +0 -324
  33. data/doc/classes/Jpmobile/Display.html +0 -333
  34. data/doc/classes/Jpmobile/Emoticon.html +0 -467
  35. data/doc/classes/Jpmobile/Filter.html +0 -120
  36. data/doc/classes/Jpmobile/Filter/ApplyOnlyForMobile.html +0 -172
  37. data/doc/classes/Jpmobile/Filter/Base.html +0 -269
  38. data/doc/classes/Jpmobile/Filter/Emoticon.html +0 -118
  39. data/doc/classes/Jpmobile/Filter/Emoticon/Inner.html +0 -184
  40. data/doc/classes/Jpmobile/Filter/Emoticon/Outer.html +0 -207
  41. data/doc/classes/Jpmobile/Filter/FilterTable.html +0 -178
  42. data/doc/classes/Jpmobile/Filter/HankakuKana.html +0 -126
  43. data/doc/classes/Jpmobile/Filter/Sjis.html +0 -271
  44. data/doc/classes/Jpmobile/Helpers.html +0 -588
  45. data/doc/classes/Jpmobile/Mobile.html +0 -150
  46. data/doc/classes/Jpmobile/Mobile/AbstractMobile.html +0 -389
  47. data/doc/classes/Jpmobile/Mobile/Au.html +0 -420
  48. data/doc/classes/Jpmobile/Mobile/Ddipocket.html +0 -138
  49. data/doc/classes/Jpmobile/Mobile/Docomo.html +0 -411
  50. data/doc/classes/Jpmobile/Mobile/Emobile.html +0 -183
  51. data/doc/classes/Jpmobile/Mobile/Jphone.html +0 -212
  52. data/doc/classes/Jpmobile/Mobile/Softbank.html +0 -344
  53. data/doc/classes/Jpmobile/Mobile/Vodafone.html +0 -176
  54. data/doc/classes/Jpmobile/Mobile/Willcom.html +0 -211
  55. data/doc/classes/Jpmobile/Position.html +0 -384
  56. data/doc/classes/Jpmobile/RequestWithMobile.html +0 -263
  57. data/doc/created.rid +0 -1
  58. data/doc/files/CHANGELOG.html +0 -110
  59. data/doc/files/README.html +0 -455
  60. data/doc/files/lib/jpmobile/datum_conv_rb.html +0 -110
  61. data/doc/files/lib/jpmobile/emoticon/au_rb.html +0 -124
  62. data/doc/files/lib/jpmobile/emoticon/conversion_table_rb.html +0 -124
  63. data/doc/files/lib/jpmobile/emoticon/docomo_rb.html +0 -119
  64. data/doc/files/lib/jpmobile/emoticon/softbank_rb.html +0 -119
  65. data/doc/files/lib/jpmobile/emoticon/z_combine_rb.html +0 -101
  66. data/doc/files/lib/jpmobile/emoticon_rb.html +0 -101
  67. data/doc/files/lib/jpmobile/filter_rb.html +0 -115
  68. data/doc/files/lib/jpmobile/helpers_rb.html +0 -105
  69. data/doc/files/lib/jpmobile/hook_abstract_request_rb.html +0 -108
  70. data/doc/files/lib/jpmobile/hook_action_controller_rb.html +0 -101
  71. data/doc/files/lib/jpmobile/hook_action_view_rb.html +0 -110
  72. data/doc/files/lib/jpmobile/mobile/abstract_mobile_rb.html +0 -108
  73. data/doc/files/lib/jpmobile/mobile/au_rb.html +0 -112
  74. data/doc/files/lib/jpmobile/mobile/display_rb.html +0 -111
  75. data/doc/files/lib/jpmobile/mobile/docomo_rb.html +0 -105
  76. data/doc/files/lib/jpmobile/mobile/emobile_rb.html +0 -105
  77. data/doc/files/lib/jpmobile/mobile/softbank_rb.html +0 -115
  78. data/doc/files/lib/jpmobile/mobile/willcom_rb.html +0 -108
  79. data/doc/files/lib/jpmobile/mobile/z_display_info_docomo_rb.html +0 -114
  80. data/doc/files/lib/jpmobile/mobile/z_ip_addresses_au_rb.html +0 -114
  81. data/doc/files/lib/jpmobile/mobile/z_ip_addresses_docomo_rb.html +0 -124
  82. data/doc/files/lib/jpmobile/mobile/z_ip_addresses_emobile_rb.html +0 -111
  83. data/doc/files/lib/jpmobile/mobile/z_ip_addresses_softbank_rb.html +0 -124
  84. data/doc/files/lib/jpmobile/mobile/z_ip_addresses_willcom_rb.html +0 -114
  85. data/doc/files/lib/jpmobile/position_rb.html +0 -105
  86. data/doc/files/lib/jpmobile/request_with_mobile_rb.html +0 -111
  87. data/doc/files/lib/jpmobile/trans_sid_rb.html +0 -118
  88. data/doc/files/lib/jpmobile/version_rb.html +0 -101
  89. data/doc/files/lib/jpmobile_rb.html +0 -101
  90. data/doc/fr_class_index.html +0 -55
  91. data/doc/fr_file_index.html +0 -58
  92. data/doc/fr_method_index.html +0 -134
  93. data/doc/index.html +0 -24
  94. data/doc/rdoc-style.css +0 -208
@@ -1,333 +0,0 @@
1
- <?xml version="1.0" encoding=" UTF-8"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
- <head>
8
- <title>Class: Jpmobile::Display</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset= UTF-8" />
10
- <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
- <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
12
- <script type="text/javascript">
13
- // <![CDATA[
14
-
15
- function popupCode( url ) {
16
- window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
- }
18
-
19
- function toggleCode( id ) {
20
- if ( document.getElementById )
21
- elem = document.getElementById( id );
22
- else if ( document.all )
23
- elem = eval( "document.all." + id );
24
- else
25
- return false;
26
-
27
- elemStyle = elem.style;
28
-
29
- if ( elemStyle.display != "block" ) {
30
- elemStyle.display = "block"
31
- } else {
32
- elemStyle.display = "none"
33
- }
34
-
35
- return true;
36
- }
37
-
38
- // Make codeblocks hidden by default
39
- document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
-
41
- // ]]>
42
- </script>
43
-
44
- </head>
45
- <body>
46
-
47
-
48
-
49
- <div id="classHeader">
50
- <table class="header-table">
51
- <tr class="top-aligned-row">
52
- <td><strong>Class</strong></td>
53
- <td class="class-name-in-header">Jpmobile::Display</td>
54
- </tr>
55
- <tr class="top-aligned-row">
56
- <td><strong>In:</strong></td>
57
- <td>
58
- <a href="../../files/lib/jpmobile/mobile/display_rb.html">
59
- lib/jpmobile/mobile/display.rb
60
- </a>
61
- <br />
62
- </td>
63
- </tr>
64
-
65
- <tr class="top-aligned-row">
66
- <td><strong>Parent:</strong></td>
67
- <td>
68
- Object
69
- </td>
70
- </tr>
71
- </table>
72
- </div>
73
- <!-- banner header -->
74
-
75
- <div id="bodyContent">
76
-
77
-
78
-
79
- <div id="contextContent">
80
-
81
- <div id="description">
82
- <p>
83
- ディスプレイ情報
84
- </p>
85
-
86
- </div>
87
-
88
-
89
- </div>
90
-
91
- <div id="method-list">
92
- <h3 class="section-bar">Methods</h3>
93
-
94
- <div class="name-list">
95
- <a href="#M000106">browser_height</a>&nbsp;&nbsp;
96
- <a href="#M000105">browser_width</a>&nbsp;&nbsp;
97
- <a href="#M000101">color?</a>&nbsp;&nbsp;
98
- <a href="#M000102">colors</a>&nbsp;&nbsp;
99
- <a href="#M000108">height</a>&nbsp;&nbsp;
100
- <a href="#M000104">physical_height</a>&nbsp;&nbsp;
101
- <a href="#M000103">physical_width</a>&nbsp;&nbsp;
102
- <a href="#M000107">width</a>&nbsp;&nbsp;
103
- </div>
104
- </div>
105
-
106
- </div>
107
-
108
-
109
- <!-- if includes -->
110
-
111
- <div id="section">
112
-
113
-
114
-
115
-
116
-
117
-
118
-
119
-
120
- <!-- if method_list -->
121
- <div id="methods">
122
- <h3 class="section-bar">Public Instance methods</h3>
123
-
124
- <div id="method-M000106" class="method-detail">
125
- <a name="M000106"></a>
126
-
127
- <div class="method-heading">
128
- <a href="#M000106" class="method-signature">
129
- <span class="method-name">browser_height</span><span class="method-args">()</span>
130
- </a>
131
- </div>
132
-
133
- <div class="method-description">
134
- <p>
135
- ブラウザの画面高さを返す。不明の場合は <tt>nil</tt>。
136
- </p>
137
- <p><a class="source-toggle" href="#"
138
- onclick="toggleCode('M000106-source');return false;">[Source]</a></p>
139
- <div class="method-source-code" id="M000106-source">
140
- <pre>
141
- <span class="ruby-comment cmt"># File lib/jpmobile/mobile/display.rb, line 27</span>
142
- 27: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">browser_height</span>; <span class="ruby-ivar">@browser_height</span>; <span class="ruby-keyword kw">end</span>
143
- </pre>
144
- </div>
145
- </div>
146
- </div>
147
-
148
- <div id="method-M000105" class="method-detail">
149
- <a name="M000105"></a>
150
-
151
- <div class="method-heading">
152
- <a href="#M000105" class="method-signature">
153
- <span class="method-name">browser_width</span><span class="method-args">()</span>
154
- </a>
155
- </div>
156
-
157
- <div class="method-description">
158
- <p>
159
- ブラウザの画面幅を返す。不明の場合は <tt>nil</tt>。
160
- </p>
161
- <p><a class="source-toggle" href="#"
162
- onclick="toggleCode('M000105-source');return false;">[Source]</a></p>
163
- <div class="method-source-code" id="M000105-source">
164
- <pre>
165
- <span class="ruby-comment cmt"># File lib/jpmobile/mobile/display.rb, line 25</span>
166
- 25: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">browser_width</span>; <span class="ruby-ivar">@browser_width</span>; <span class="ruby-keyword kw">end</span>
167
- </pre>
168
- </div>
169
- </div>
170
- </div>
171
-
172
- <div id="method-M000101" class="method-detail">
173
- <a name="M000101"></a>
174
-
175
- <div class="method-heading">
176
- <a href="#M000101" class="method-signature">
177
- <span class="method-name">color?</span><span class="method-args">()</span>
178
- </a>
179
- </div>
180
-
181
- <div class="method-description">
182
- <p>
183
- 画面がカラーならば <tt>true</tt>、白黒ならば <tt>false</tt>
184
- を返す。不明の場合は <tt>nil</tt>。
185
- </p>
186
- <p><a class="source-toggle" href="#"
187
- onclick="toggleCode('M000101-source');return false;">[Source]</a></p>
188
- <div class="method-source-code" id="M000101-source">
189
- <pre>
190
- <span class="ruby-comment cmt"># File lib/jpmobile/mobile/display.rb, line 17</span>
191
- 17: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">color?</span>; <span class="ruby-ivar">@color_p</span>; <span class="ruby-keyword kw">end</span>
192
- </pre>
193
- </div>
194
- </div>
195
- </div>
196
-
197
- <div id="method-M000102" class="method-detail">
198
- <a name="M000102"></a>
199
-
200
- <div class="method-heading">
201
- <a href="#M000102" class="method-signature">
202
- <span class="method-name">colors</span><span class="method-args">()</span>
203
- </a>
204
- </div>
205
-
206
- <div class="method-description">
207
- <p>
208
- 画面の色数を返す。不明の場合は <tt>nil</tt>。
209
- </p>
210
- <p><a class="source-toggle" href="#"
211
- onclick="toggleCode('M000102-source');return false;">[Source]</a></p>
212
- <div class="method-source-code" id="M000102-source">
213
- <pre>
214
- <span class="ruby-comment cmt"># File lib/jpmobile/mobile/display.rb, line 19</span>
215
- 19: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">colors</span>; <span class="ruby-ivar">@colors</span>; <span class="ruby-keyword kw">end</span>
216
- </pre>
217
- </div>
218
- </div>
219
- </div>
220
-
221
- <div id="method-M000108" class="method-detail">
222
- <a name="M000108"></a>
223
-
224
- <div class="method-heading">
225
- <a href="#M000108" class="method-signature">
226
- <span class="method-name">height</span><span class="method-args">()</span>
227
- </a>
228
- </div>
229
-
230
- <div class="method-description">
231
- <p>
232
- 画面の高さを返す。ブラウザ画面の高さがわかる場合はそれを優先する。不明の場合は
233
- <tt>nil</tt>。
234
- </p>
235
- <p><a class="source-toggle" href="#"
236
- onclick="toggleCode('M000108-source');return false;">[Source]</a></p>
237
- <div class="method-source-code" id="M000108-source">
238
- <pre>
239
- <span class="ruby-comment cmt"># File lib/jpmobile/mobile/display.rb, line 31</span>
240
- 31: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">height</span>; <span class="ruby-identifier">browser_height</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">physical_height</span>; <span class="ruby-keyword kw">end</span>
241
- </pre>
242
- </div>
243
- </div>
244
- </div>
245
-
246
- <div id="method-M000104" class="method-detail">
247
- <a name="M000104"></a>
248
-
249
- <div class="method-heading">
250
- <a href="#M000104" class="method-signature">
251
- <span class="method-name">physical_height</span><span class="method-args">()</span>
252
- </a>
253
- </div>
254
-
255
- <div class="method-description">
256
- <p>
257
- ディスプレイの画面高さを返す。不明の場合は
258
- <tt>nil</tt>。
259
- </p>
260
- <p><a class="source-toggle" href="#"
261
- onclick="toggleCode('M000104-source');return false;">[Source]</a></p>
262
- <div class="method-source-code" id="M000104-source">
263
- <pre>
264
- <span class="ruby-comment cmt"># File lib/jpmobile/mobile/display.rb, line 23</span>
265
- 23: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">physical_height</span>; <span class="ruby-ivar">@physical_height</span>; <span class="ruby-keyword kw">end</span>
266
- </pre>
267
- </div>
268
- </div>
269
- </div>
270
-
271
- <div id="method-M000103" class="method-detail">
272
- <a name="M000103"></a>
273
-
274
- <div class="method-heading">
275
- <a href="#M000103" class="method-signature">
276
- <span class="method-name">physical_width</span><span class="method-args">()</span>
277
- </a>
278
- </div>
279
-
280
- <div class="method-description">
281
- <p>
282
- ディスプレイの画面幅を返す。不明の場合は
283
- <tt>nil</tt>。
284
- </p>
285
- <p><a class="source-toggle" href="#"
286
- onclick="toggleCode('M000103-source');return false;">[Source]</a></p>
287
- <div class="method-source-code" id="M000103-source">
288
- <pre>
289
- <span class="ruby-comment cmt"># File lib/jpmobile/mobile/display.rb, line 21</span>
290
- 21: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">physical_width</span>; <span class="ruby-ivar">@physical_width</span>; <span class="ruby-keyword kw">end</span>
291
- </pre>
292
- </div>
293
- </div>
294
- </div>
295
-
296
- <div id="method-M000107" class="method-detail">
297
- <a name="M000107"></a>
298
-
299
- <div class="method-heading">
300
- <a href="#M000107" class="method-signature">
301
- <span class="method-name">width</span><span class="method-args">()</span>
302
- </a>
303
- </div>
304
-
305
- <div class="method-description">
306
- <p>
307
- 画面の幅を返す。ブラウザ画面の幅がわかる場合はそれを優先する。不明の場合は
308
- <tt>nil</tt>。
309
- </p>
310
- <p><a class="source-toggle" href="#"
311
- onclick="toggleCode('M000107-source');return false;">[Source]</a></p>
312
- <div class="method-source-code" id="M000107-source">
313
- <pre>
314
- <span class="ruby-comment cmt"># File lib/jpmobile/mobile/display.rb, line 29</span>
315
- 29: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">width</span>; <span class="ruby-identifier">browser_width</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">physical_width</span>; <span class="ruby-keyword kw">end</span>
316
- </pre>
317
- </div>
318
- </div>
319
- </div>
320
-
321
-
322
- </div>
323
-
324
-
325
- </div>
326
-
327
-
328
- <div id="validator-badges">
329
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
330
- </div>
331
-
332
- </body>
333
- </html>
@@ -1,467 +0,0 @@
1
- <?xml version="1.0" encoding=" UTF-8"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
- <head>
8
- <title>Module: Jpmobile::Emoticon</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset= UTF-8" />
10
- <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
- <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
12
- <script type="text/javascript">
13
- // <![CDATA[
14
-
15
- function popupCode( url ) {
16
- window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
- }
18
-
19
- function toggleCode( id ) {
20
- if ( document.getElementById )
21
- elem = document.getElementById( id );
22
- else if ( document.all )
23
- elem = eval( "document.all." + id );
24
- else
25
- return false;
26
-
27
- elemStyle = elem.style;
28
-
29
- if ( elemStyle.display != "block" ) {
30
- elemStyle.display = "block"
31
- } else {
32
- elemStyle.display = "none"
33
- }
34
-
35
- return true;
36
- }
37
-
38
- // Make codeblocks hidden by default
39
- document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
-
41
- // ]]>
42
- </script>
43
-
44
- </head>
45
- <body>
46
-
47
-
48
-
49
- <div id="classHeader">
50
- <table class="header-table">
51
- <tr class="top-aligned-row">
52
- <td><strong>Module</strong></td>
53
- <td class="class-name-in-header">Jpmobile::Emoticon</td>
54
- </tr>
55
- <tr class="top-aligned-row">
56
- <td><strong>In:</strong></td>
57
- <td>
58
- <a href="../../files/lib/jpmobile/emoticon/z_combine_rb.html">
59
- lib/jpmobile/emoticon/z_combine.rb
60
- </a>
61
- <br />
62
- <a href="../../files/lib/jpmobile/emoticon_rb.html">
63
- lib/jpmobile/emoticon.rb
64
- </a>
65
- <br />
66
- </td>
67
- </tr>
68
-
69
- </table>
70
- </div>
71
- <!-- banner header -->
72
-
73
- <div id="bodyContent">
74
-
75
-
76
-
77
- <div id="contextContent">
78
-
79
- <div id="description">
80
- <p>
81
- 絵文字関連処理
82
- </p>
83
-
84
- </div>
85
-
86
-
87
- </div>
88
-
89
- <div id="method-list">
90
- <h3 class="section-bar">Methods</h3>
91
-
92
- <div class="name-list">
93
- <a href="#M000086">external_to_unicodecr_au</a>&nbsp;&nbsp;
94
- <a href="#M000085">external_to_unicodecr_docomo</a>&nbsp;&nbsp;
95
- <a href="#M000089">external_to_unicodecr_jphone</a>&nbsp;&nbsp;
96
- <a href="#M000087">external_to_unicodecr_softbank</a>&nbsp;&nbsp;
97
- <a href="#M000088">external_to_unicodecr_vodafone</a>&nbsp;&nbsp;
98
- <a href="#M000090">unicodecr_to_external</a>&nbsp;&nbsp;
99
- <a href="#M000091">unicodecr_to_utf8</a>&nbsp;&nbsp;
100
- <a href="#M000092">utf8_to_unicodecr</a>&nbsp;&nbsp;
101
- </div>
102
- </div>
103
-
104
- </div>
105
-
106
-
107
- <!-- if includes -->
108
-
109
- <div id="section">
110
-
111
-
112
- <div id="constants-list">
113
- <h3 class="section-bar">Constants</h3>
114
-
115
- <div class="name-list">
116
- <table summary="Constants">
117
- <tr class="top-aligned-row context-row">
118
- <td class="context-item-name">SJIS_TO_UNICODE</td>
119
- <td>=</td>
120
- <td class="context-item-value">{}</td>
121
- </tr>
122
- <tr class="top-aligned-row context-row">
123
- <td class="context-item-name">UNICODE_TO_SJIS</td>
124
- <td>=</td>
125
- <td class="context-item-value">SJIS_TO_UNICODE.invert.freeze</td>
126
- </tr>
127
- <tr class="top-aligned-row context-row">
128
- <td class="context-item-name">SJIS_REGEXP</td>
129
- <td>=</td>
130
- <td class="context-item-value">Regexp.union(*SJIS_TO_UNICODE.keys.map{|s| Regexp.compile(Regexp.escape([s].pack('n'),&quot;s&quot;),nil,'s')})</td>
131
- </tr>
132
- <tr class="top-aligned-row context-row">
133
- <td class="context-item-name">SOFTBANK_WEBCODE_REGEXP</td>
134
- <td>=</td>
135
- <td class="context-item-value">Regexp.union(*([/(?!)/n]+SOFTBANK_WEBCODE_TO_UNICODE.keys.map{|x| &quot;\x1b\x24#{x}\x0f&quot;}))</td>
136
- </tr>
137
- <tr class="top-aligned-row context-row">
138
- <td class="context-item-name">DOCOMO_SJIS_REGEXP</td>
139
- <td>=</td>
140
- <td class="context-item-value">Regexp.union(*DOCOMO_SJIS_TO_UNICODE.keys.map{|s| Regexp.compile(Regexp.escape([s].pack('n'),&quot;s&quot;),nil,'s')})</td>
141
- </tr>
142
- <tr class="top-aligned-row context-row">
143
- <td class="context-item-name">AU_SJIS_REGEXP</td>
144
- <td>=</td>
145
- <td class="context-item-value">Regexp.union(*AU_SJIS_TO_UNICODE.keys.map{|s| Regexp.compile(Regexp.escape([s].pack('n'),&quot;s&quot;),nil,'s')})</td>
146
- </tr>
147
- <tr class="top-aligned-row context-row">
148
- <td class="context-item-name">SOFTBANK_UNICODE_REGEXP</td>
149
- <td>=</td>
150
- <td class="context-item-value">Regexp.union(*SOFTBANK_UNICODE_TO_WEBCODE.keys.map{|x| [x].pack('U')}).freeze</td>
151
- </tr>
152
- <tr class="top-aligned-row context-row">
153
- <td class="context-item-name">EMOTICON_UNICODES</td>
154
- <td>=</td>
155
- <td class="context-item-value">UNICODE_TO_SJIS.keys|SOFTBANK_UNICODE_TO_WEBCODE.keys.map{|k|k+0x1000}</td>
156
- </tr>
157
- <tr class="top-aligned-row context-row">
158
- <td class="context-item-name">UTF8_REGEXP</td>
159
- <td>=</td>
160
- <td class="context-item-value">Regexp.union(*EMOTICON_UNICODES.map{|x| [x].pack('U')}).freeze</td>
161
- </tr>
162
- </table>
163
- </div>
164
- </div>
165
-
166
-
167
-
168
-
169
-
170
-
171
- <!-- if method_list -->
172
- <div id="methods">
173
- <h3 class="section-bar">Public Class methods</h3>
174
-
175
- <div id="method-M000086" class="method-detail">
176
- <a name="M000086"></a>
177
-
178
- <div class="method-heading">
179
- <a href="#M000086" class="method-signature">
180
- <span class="method-name">external_to_unicodecr_au</span><span class="method-args">(str)</span>
181
- </a>
182
- </div>
183
-
184
- <div class="method-description">
185
- <p>
186
- <tt>str</tt>
187
- のなかでDoCoMo絵文字をUnicode数値文字参照に置換した文字列を返す。
188
- </p>
189
- <p><a class="source-toggle" href="#"
190
- onclick="toggleCode('M000086-source');return false;">[Source]</a></p>
191
- <div class="method-source-code" id="M000086-source">
192
- <pre>
193
- <span class="ruby-comment cmt"># File lib/jpmobile/emoticon.rb, line 32</span>
194
- 32: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">external_to_unicodecr_au</span>(<span class="ruby-identifier">str</span>)
195
- 33: <span class="ruby-identifier">str</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-constant">AU_SJIS_REGEXP</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">match</span><span class="ruby-operator">|</span>
196
- 34: <span class="ruby-identifier">sjis</span> = <span class="ruby-identifier">match</span>.<span class="ruby-identifier">unpack</span>(<span class="ruby-value str">'n'</span>).<span class="ruby-identifier">first</span>
197
- 35: <span class="ruby-identifier">unicode</span> = <span class="ruby-constant">AU_SJIS_TO_UNICODE</span>[<span class="ruby-identifier">sjis</span>]
198
- 36: <span class="ruby-identifier">unicode</span> <span class="ruby-value">? </span>(<span class="ruby-value str">&quot;&amp;#x%04x;&quot;</span><span class="ruby-operator">%</span><span class="ruby-identifier">unicode</span>) <span class="ruby-operator">:</span> <span class="ruby-identifier">match</span>
199
- 37: <span class="ruby-keyword kw">end</span>
200
- 38: <span class="ruby-keyword kw">end</span>
201
- </pre>
202
- </div>
203
- </div>
204
- </div>
205
-
206
- <div id="method-M000085" class="method-detail">
207
- <a name="M000085"></a>
208
-
209
- <div class="method-heading">
210
- <a href="#M000085" class="method-signature">
211
- <span class="method-name">external_to_unicodecr_docomo</span><span class="method-args">(str)</span>
212
- </a>
213
- </div>
214
-
215
- <div class="method-description">
216
- <p>
217
- <tt>str</tt>
218
- のなかでDoCoMo絵文字をUnicode数値文字参照に置換した文字列を返す。
219
- </p>
220
- <p><a class="source-toggle" href="#"
221
- onclick="toggleCode('M000085-source');return false;">[Source]</a></p>
222
- <div class="method-source-code" id="M000085-source">
223
- <pre>
224
- <span class="ruby-comment cmt"># File lib/jpmobile/emoticon.rb, line 23</span>
225
- 23: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">external_to_unicodecr_docomo</span>(<span class="ruby-identifier">str</span>)
226
- 24: <span class="ruby-identifier">str</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-constant">DOCOMO_SJIS_REGEXP</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">match</span><span class="ruby-operator">|</span>
227
- 25: <span class="ruby-identifier">sjis</span> = <span class="ruby-identifier">match</span>.<span class="ruby-identifier">unpack</span>(<span class="ruby-value str">'n'</span>).<span class="ruby-identifier">first</span>
228
- 26: <span class="ruby-identifier">unicode</span> = <span class="ruby-constant">DOCOMO_SJIS_TO_UNICODE</span>[<span class="ruby-identifier">sjis</span>]
229
- 27: <span class="ruby-identifier">unicode</span> <span class="ruby-value">? </span>(<span class="ruby-value str">&quot;&amp;#x%04x;&quot;</span><span class="ruby-operator">%</span><span class="ruby-identifier">unicode</span>) <span class="ruby-operator">:</span> <span class="ruby-identifier">match</span>
230
- 28: <span class="ruby-keyword kw">end</span>
231
- 29: <span class="ruby-keyword kw">end</span>
232
- </pre>
233
- </div>
234
- </div>
235
- </div>
236
-
237
- <div id="method-M000089" class="method-detail">
238
- <a name="M000089"></a>
239
-
240
- <div class="method-heading">
241
- <a href="#M000089" class="method-signature">
242
- <span class="method-name">external_to_unicodecr_jphone</span><span class="method-args">(str)</span>
243
- </a>
244
- </div>
245
-
246
- <div class="method-description">
247
- <p>
248
- <tt>str</tt>のなかでWebcodeのSoftBank絵文字を(+0x1000だけシフトして)Unicode数値文字参照に変換した文字列を返す。
249
- </p>
250
- <p><a class="source-toggle" href="#"
251
- onclick="toggleCode('M000089-source');return false;">[Source]</a></p>
252
- <div class="method-source-code" id="M000089-source">
253
- <pre>
254
- <span class="ruby-comment cmt"># File lib/jpmobile/emoticon.rb, line 52</span>
255
- 52: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">external_to_unicodecr_jphone</span>(<span class="ruby-identifier">str</span>)
256
- 53: <span class="ruby-comment cmt"># SoftBank Webcode</span>
257
- 54: <span class="ruby-identifier">s</span> = <span class="ruby-identifier">str</span>.<span class="ruby-identifier">clone</span>
258
- 55: <span class="ruby-comment cmt"># 連続したエスケープコードが省略されている場合は切りはなす。</span>
259
- 56: <span class="ruby-identifier">s</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/\x1b\x24(.)(.+?)\x0f/</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">match</span><span class="ruby-operator">|</span>
260
- 57: <span class="ruby-identifier">a</span> = <span class="ruby-identifier">$1</span>
261
- 58: <span class="ruby-identifier">$2</span>.<span class="ruby-identifier">split</span>(<span class="ruby-regexp re">//</span>).<span class="ruby-identifier">map</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-node">&quot;\x1b\x24#{a}#{x}\x0f&quot;</span>}.<span class="ruby-identifier">join</span>(<span class="ruby-value str">''</span>)
262
- 59: <span class="ruby-keyword kw">end</span>
263
- 60: <span class="ruby-comment cmt"># Webcodeを変換</span>
264
- 61: <span class="ruby-identifier">s</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-constant">SOFTBANK_WEBCODE_REGEXP</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">match</span><span class="ruby-operator">|</span>
265
- 62: <span class="ruby-identifier">unicode</span> = <span class="ruby-constant">SOFTBANK_WEBCODE_TO_UNICODE</span>[<span class="ruby-identifier">match</span>[<span class="ruby-value">2</span>,<span class="ruby-value">2</span>]] <span class="ruby-operator">+</span> <span class="ruby-value">0x1000</span>
266
- 63: <span class="ruby-identifier">unicode</span> <span class="ruby-value">? </span>(<span class="ruby-value str">&quot;&amp;#x%04x;&quot;</span><span class="ruby-operator">%</span><span class="ruby-identifier">unicode</span>) <span class="ruby-operator">:</span> <span class="ruby-identifier">match</span>
267
- 64: <span class="ruby-keyword kw">end</span>
268
- 65: <span class="ruby-keyword kw">end</span>
269
- </pre>
270
- </div>
271
- </div>
272
- </div>
273
-
274
- <div id="method-M000087" class="method-detail">
275
- <a name="M000087"></a>
276
-
277
- <div class="method-heading">
278
- <a href="#M000087" class="method-signature">
279
- <span class="method-name">external_to_unicodecr_softbank</span><span class="method-args">(str)</span>
280
- </a>
281
- </div>
282
-
283
- <div class="method-description">
284
- <p>
285
- <tt>str</tt>のなかでUTF8のSoftBank絵文字を(+0x1000だけシフトして)Unicode数値文字参照に変換した文字列を返す。
286
- </p>
287
- <p><a class="source-toggle" href="#"
288
- onclick="toggleCode('M000087-source');return false;">[Source]</a></p>
289
- <div class="method-source-code" id="M000087-source">
290
- <pre>
291
- <span class="ruby-comment cmt"># File lib/jpmobile/emoticon.rb, line 41</span>
292
- 41: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">external_to_unicodecr_softbank</span>(<span class="ruby-identifier">str</span>)
293
- 42: <span class="ruby-comment cmt"># SoftBank Unicode</span>
294
- 43: <span class="ruby-identifier">str</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-constant">SOFTBANK_UNICODE_REGEXP</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">match</span><span class="ruby-operator">|</span>
295
- 44: <span class="ruby-identifier">unicode</span> = <span class="ruby-identifier">match</span>.<span class="ruby-identifier">unpack</span>(<span class="ruby-value str">'U'</span>).<span class="ruby-identifier">first</span>
296
- 45: <span class="ruby-value str">&quot;&amp;#x%04x;&quot;</span> <span class="ruby-operator">%</span> (<span class="ruby-identifier">unicode</span><span class="ruby-operator">+</span><span class="ruby-value">0x1000</span>)
297
- 46: <span class="ruby-keyword kw">end</span>
298
- 47: <span class="ruby-keyword kw">end</span>
299
- </pre>
300
- </div>
301
- </div>
302
- </div>
303
-
304
- <div id="method-M000088" class="method-detail">
305
- <a name="M000088"></a>
306
-
307
- <div class="method-heading">
308
- <a href="#M000088" class="method-signature">
309
- <span class="method-name">external_to_unicodecr_vodafone</span><span class="method-args">(str)</span>
310
- </a>
311
- </div>
312
-
313
- <div class="method-description">
314
- <p><a class="source-toggle" href="#"
315
- onclick="toggleCode('M000088-source');return false;">[Source]</a></p>
316
- <div class="method-source-code" id="M000088-source">
317
- <pre>
318
- <span class="ruby-comment cmt"># File lib/jpmobile/emoticon.rb, line 48</span>
319
- 48: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">external_to_unicodecr_vodafone</span>(<span class="ruby-identifier">str</span>)
320
- 49: <span class="ruby-identifier">external_to_unicodecr_softbank</span>(<span class="ruby-identifier">str</span>)
321
- 50: <span class="ruby-keyword kw">end</span>
322
- </pre>
323
- </div>
324
- </div>
325
- </div>
326
-
327
- <div id="method-M000090" class="method-detail">
328
- <a name="M000090"></a>
329
-
330
- <div class="method-heading">
331
- <a href="#M000090" class="method-signature">
332
- <span class="method-name">unicodecr_to_external</span><span class="method-args">(str, conversion_table=nil, to_sjis=true)</span>
333
- </a>
334
- </div>
335
-
336
- <div class="method-description">
337
- <p>
338
- <tt>str</tt>
339
- のなかでUnicode数値文字参照で表記された絵文字を携帯側エンコーディングに置換する。
340
- </p>
341
- <p>
342
- キャリア間の変換に <tt>conversion_table</tt>
343
- を使う。<tt>conversion_table</tt> に<tt>nil</tt>を与えると、
344
- キャリア間の変換は行わない。
345
- </p>
346
- <p>
347
- 携帯側エンコーディングがShift_JIS場合は <tt>to_sjis</tt> に
348
- <tt>true</tt> を指定する。 <tt>true</tt>
349
- を指定すると変換テーブルに文字列が指定されている場合にShift_JISで出力される。
350
- </p>
351
- <p><a class="source-toggle" href="#"
352
- onclick="toggleCode('M000090-source');return false;">[Source]</a></p>
353
- <div class="method-source-code" id="M000090-source">
354
- <pre>
355
- <span class="ruby-comment cmt"># File lib/jpmobile/emoticon.rb, line 74</span>
356
- 74: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">unicodecr_to_external</span>(<span class="ruby-identifier">str</span>, <span class="ruby-identifier">conversion_table</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">to_sjis</span>=<span class="ruby-keyword kw">true</span>)
357
- 75: <span class="ruby-identifier">str</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/&amp;#x([0-9a-f]{4});/i</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">match</span><span class="ruby-operator">|</span>
358
- 76: <span class="ruby-identifier">unicode</span> = <span class="ruby-identifier">$1</span>.<span class="ruby-identifier">scanf</span>(<span class="ruby-value str">&quot;%x&quot;</span>).<span class="ruby-identifier">first</span>
359
- 77: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">conversion_table</span>
360
- 78: <span class="ruby-identifier">converted</span> = <span class="ruby-identifier">conversion_table</span>[<span class="ruby-identifier">unicode</span>] <span class="ruby-comment cmt"># キャリア間変換</span>
361
- 79: <span class="ruby-keyword kw">else</span>
362
- 80: <span class="ruby-identifier">converted</span> = <span class="ruby-identifier">unicode</span> <span class="ruby-comment cmt"># 変換しない</span>
363
- 81: <span class="ruby-keyword kw">end</span>
364
- 82:
365
- 83: <span class="ruby-comment cmt"># 携帯側エンコーディングに変換する</span>
366
- 84: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">converted</span>
367
- 85: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">Integer</span>
368
- 86: <span class="ruby-comment cmt"># 変換先がUnicodeで指定されている。つまり対応する絵文字がある。</span>
369
- 87: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">sjis</span> = <span class="ruby-constant">UNICODE_TO_SJIS</span>[<span class="ruby-identifier">converted</span>]
370
- 88: [<span class="ruby-identifier">sjis</span>].<span class="ruby-identifier">pack</span>(<span class="ruby-value str">'n'</span>)
371
- 89: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">webcode</span> = <span class="ruby-constant">SOFTBANK_UNICODE_TO_WEBCODE</span>[<span class="ruby-identifier">converted</span><span class="ruby-operator">-</span><span class="ruby-value">0x1000</span>]
372
- 90: <span class="ruby-node">&quot;\x1b\x24#{webcode}\x0f&quot;</span>
373
- 91: <span class="ruby-keyword kw">else</span>
374
- 92: <span class="ruby-comment cmt"># キャリア変換テーブルに指定されていたUnicodeに対応する</span>
375
- 93: <span class="ruby-comment cmt"># 携帯側エンコーディングが見つからない(変換テーブルの不備の可能性あり)。</span>
376
- 94: <span class="ruby-identifier">match</span>
377
- 95: <span class="ruby-keyword kw">end</span>
378
- 96: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">String</span>
379
- 97: <span class="ruby-comment cmt"># 変換先がUnicodeで指定されている。</span>
380
- 98: <span class="ruby-identifier">to_sjis</span> <span class="ruby-value">? </span><span class="ruby-constant">Kconv</span><span class="ruby-operator">::</span><span class="ruby-identifier">kconv</span>(<span class="ruby-identifier">converted</span>, <span class="ruby-constant">Kconv</span><span class="ruby-operator">::</span><span class="ruby-constant">SJIS</span>, <span class="ruby-constant">Kconv</span><span class="ruby-operator">::</span><span class="ruby-constant">UTF8</span>) <span class="ruby-operator">:</span> <span class="ruby-identifier">converted</span>
381
- 99: <span class="ruby-keyword kw">when</span> <span class="ruby-keyword kw">nil</span>
382
- 100: <span class="ruby-comment cmt"># 変換先が定義されていない。</span>
383
- 101: <span class="ruby-identifier">match</span>
384
- 102: <span class="ruby-keyword kw">end</span>
385
- 103: <span class="ruby-keyword kw">end</span>
386
- 104: <span class="ruby-keyword kw">end</span>
387
- </pre>
388
- </div>
389
- </div>
390
- </div>
391
-
392
- <div id="method-M000091" class="method-detail">
393
- <a name="M000091"></a>
394
-
395
- <div class="method-heading">
396
- <a href="#M000091" class="method-signature">
397
- <span class="method-name">unicodecr_to_utf8</span><span class="method-args">(str)</span>
398
- </a>
399
- </div>
400
-
401
- <div class="method-description">
402
- <p>
403
- <tt>str</tt>
404
- のなかでUnicode数値文字参照で表記された絵文字をUTF-8に置換する。
405
- </p>
406
- <p><a class="source-toggle" href="#"
407
- onclick="toggleCode('M000091-source');return false;">[Source]</a></p>
408
- <div class="method-source-code" id="M000091-source">
409
- <pre>
410
- <span class="ruby-comment cmt"># File lib/jpmobile/emoticon.rb, line 106</span>
411
- 106: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">unicodecr_to_utf8</span>(<span class="ruby-identifier">str</span>)
412
- 107: <span class="ruby-identifier">str</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/&amp;#x([0-9a-f]{4});/i</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">match</span><span class="ruby-operator">|</span>
413
- 108: <span class="ruby-identifier">unicode</span> = <span class="ruby-identifier">$1</span>.<span class="ruby-identifier">scanf</span>(<span class="ruby-value str">&quot;%x&quot;</span>).<span class="ruby-identifier">first</span>
414
- 109: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">UNICODE_TO_SJIS</span>[<span class="ruby-identifier">unicode</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">SOFTBANK_UNICODE_TO_WEBCODE</span>[<span class="ruby-identifier">unicode</span><span class="ruby-operator">-</span><span class="ruby-value">0x1000</span>]
415
- 110: [<span class="ruby-identifier">unicode</span>].<span class="ruby-identifier">pack</span>(<span class="ruby-value str">'U'</span>)
416
- 111: <span class="ruby-keyword kw">else</span>
417
- 112: <span class="ruby-identifier">match</span>
418
- 113: <span class="ruby-keyword kw">end</span>
419
- 114: <span class="ruby-keyword kw">end</span>
420
- 115: <span class="ruby-keyword kw">end</span>
421
- </pre>
422
- </div>
423
- </div>
424
- </div>
425
-
426
- <div id="method-M000092" class="method-detail">
427
- <a name="M000092"></a>
428
-
429
- <div class="method-heading">
430
- <a href="#M000092" class="method-signature">
431
- <span class="method-name">utf8_to_unicodecr</span><span class="method-args">(str)</span>
432
- </a>
433
- </div>
434
-
435
- <div class="method-description">
436
- <p>
437
- <tt>str</tt>
438
- のなかでUTF-8で表記された絵文字をUnicode数値文字参照に置換する。
439
- </p>
440
- <p><a class="source-toggle" href="#"
441
- onclick="toggleCode('M000092-source');return false;">[Source]</a></p>
442
- <div class="method-source-code" id="M000092-source">
443
- <pre>
444
- <span class="ruby-comment cmt"># File lib/jpmobile/emoticon.rb, line 117</span>
445
- 117: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">utf8_to_unicodecr</span>(<span class="ruby-identifier">str</span>)
446
- 118: <span class="ruby-identifier">str</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-constant">UTF8_REGEXP</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">match</span><span class="ruby-operator">|</span>
447
- 119: <span class="ruby-value str">&quot;&amp;#x%04x;&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">match</span>.<span class="ruby-identifier">unpack</span>(<span class="ruby-value str">'U'</span>).<span class="ruby-identifier">first</span>
448
- 120: <span class="ruby-keyword kw">end</span>
449
- 121: <span class="ruby-keyword kw">end</span>
450
- </pre>
451
- </div>
452
- </div>
453
- </div>
454
-
455
-
456
- </div>
457
-
458
-
459
- </div>
460
-
461
-
462
- <div id="validator-badges">
463
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
464
- </div>
465
-
466
- </body>
467
- </html>