jpmobile 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. data/CHANGELOG +4 -0
  2. data/README.rdoc +29 -15
  3. data/Rakefile +3 -3
  4. data/lib/jpmobile/emoticon/conversion_table.rb +10 -9
  5. data/lib/jpmobile/emoticon.rb +14 -6
  6. data/lib/jpmobile/filter.rb +2 -9
  7. data/lib/jpmobile/helpers.rb +2 -0
  8. data/lib/jpmobile/hook_action_view.rb +5 -5
  9. data/lib/jpmobile/mobile/softbank.rb +2 -2
  10. data/lib/jpmobile/mobile/z_display_info_docomo.rb +577 -528
  11. data/lib/jpmobile/mobile/z_ip_addresses_au.rb +5 -1
  12. data/lib/jpmobile/mobile/z_ip_addresses_softbank.rb +2 -2
  13. data/lib/jpmobile/mobile/z_ip_addresses_willcom.rb +53 -13
  14. data/lib/jpmobile/trans_sid.rb +28 -14
  15. data/lib/jpmobile/version.rb +1 -1
  16. data/test/legacy/emoticon_test.rb +6 -0
  17. data/test/legacy/helpers_test.rb +6 -5
  18. data/test/rails/2.3.2/spec/controllers/trans_sid_spec.rb +99 -0
  19. data/test/rails/overrides/app/controllers/{application.rb → application_controller.rb} +0 -0
  20. data/test/rails/overrides/app/controllers/filter_controller.rb +1 -0
  21. data/test/rails/overrides/spec/controllers/filter_spec.rb +1 -0
  22. data/test/rails/overrides/spec/controllers/trans_sid_spec.rb +20 -2
  23. data/test/rails/rails_root/README +6 -19
  24. data/test/rails/rails_root/app/controllers/{application.rb → application_controller.rb} +0 -0
  25. data/test/rails/rails_root/app/controllers/trans_sid_controller.rb +4 -2
  26. data/test/rails/rails_root/app/views/filter/index.html.erb +0 -0
  27. data/test/rails/rails_root/app/views/hankaku_filter/index.html.erb +0 -0
  28. data/test/rails/rails_root/app/views/template_path/_partial.html.erb +1 -0
  29. data/test/rails/rails_root/app/views/template_path/_partial_mobile.html.erb +1 -0
  30. data/test/rails/rails_root/app/views/template_path/_partial_mobile_docomo.html.erb +1 -0
  31. data/test/rails/rails_root/app/views/template_path/partial.html.erb +2 -0
  32. data/test/rails/rails_root/config/boot.rb +2 -1
  33. data/test/rails/rails_root/config/environment.rb +15 -48
  34. data/test/rails/rails_root/config/environments/production.rb +11 -7
  35. data/test/rails/rails_root/config/environments/test.rb +6 -0
  36. data/test/rails/rails_root/config/initializers/backtrace_silencers.rb +7 -0
  37. data/test/rails/rails_root/config/initializers/new_rails_defaults.rb +4 -0
  38. data/test/rails/rails_root/config/initializers/session_store.rb +15 -0
  39. data/test/rails/rails_root/config/routes.rb +1 -1
  40. data/test/rails/rails_root/db/development.sqlite3 +0 -0
  41. data/test/rails/rails_root/db/seeds.rb +7 -0
  42. data/test/rails/rails_root/db/test.sqlite3 +0 -0
  43. data/test/rails/rails_root/doc/README_FOR_APP +2 -5
  44. data/test/rails/rails_root/log/development.log +9 -9
  45. data/test/rails/rails_root/log/test.log +198 -148
  46. data/test/rails/rails_root/public/500.html +0 -3
  47. data/test/rails/rails_root/public/index.html +1 -0
  48. data/test/rails/rails_root/script/about +2 -2
  49. data/test/rails/rails_root/script/console +1 -1
  50. data/test/rails/rails_root/script/dbconsole +1 -1
  51. data/test/rails/rails_root/script/destroy +1 -1
  52. data/test/rails/rails_root/script/generate +1 -1
  53. data/test/rails/rails_root/script/performance/benchmarker +1 -1
  54. data/test/rails/rails_root/script/performance/profiler +1 -1
  55. data/test/rails/rails_root/script/plugin +1 -1
  56. data/test/rails/rails_root/script/runner +1 -1
  57. data/test/rails/rails_root/script/server +1 -1
  58. data/test/rails/rails_root/spec/controllers/template_path_spec.rb +49 -19
  59. data/test/rails/rails_root/spec/controllers/trans_sid_spec.rb +11 -8
  60. data/test/rails/rails_root/test/test_helper.rb +1 -1
  61. data/test/rails/rails_root/vendor/plugins/jpmobile/MIT-LICENSE +2 -2
  62. data/test/rails/rails_root/vendor/plugins/jpmobile/README.rdoc +31 -15
  63. data/test/rails/rails_root/vendor/plugins/jpmobile/Rakefile +1 -1
  64. data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/emoticon.rb +3 -1
  65. data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/filter.rb +3 -10
  66. data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/helpers.rb +2 -0
  67. data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/hook_action_controller.rb +12 -0
  68. data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/hook_action_view.rb +79 -91
  69. data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/hook_request.rb +2 -10
  70. data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mobile/au.rb +9 -3
  71. data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mobile/softbank.rb +2 -2
  72. data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mobile/z_display_info_docomo.rb +577 -528
  73. data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mobile/z_ip_addresses_au.rb +5 -1
  74. data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mobile/z_ip_addresses_softbank.rb +2 -2
  75. data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mobile/z_ip_addresses_willcom.rb +53 -13
  76. data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/rack/auth.rb +55 -0
  77. data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/rack/combined_logger.rb +54 -0
  78. data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/rack/request.rb +7 -0
  79. data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/rack/trans_sid.rb +14 -0
  80. data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/trans_sid.rb +76 -65
  81. data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/version.rb +1 -1
  82. data/test/rails/rails_root/vendor/plugins/jpmobile/tasks/jpmobile_tasks.rake +26 -6
  83. data/test/rails/rails_root/vendor/plugins/jpmobile/tools/{update_display_info_docomo.rb → disabled_update_display_info_docomo.rb} +11 -6
  84. data/test/rails/rails_root/vendor/plugins/jpmobile/tools/generate_docomo_emoticon_table.rb +0 -1
  85. data/test/rails/rails_root/vendor/plugins/jpmobile/tools/generate_softbank_emoticon_table.rb +0 -1
  86. data/test/rails/rails_root/vendor/plugins/jpmobile/tools/update_ip_addresses_au.rb +4 -3
  87. data/test/rails/rails_root/vendor/plugins/jpmobile/tools/update_ip_addresses_willcom.rb +2 -2
  88. data/tools/{update_display_info_docomo.rb → disabled_update_display_info_docomo.rb} +11 -6
  89. data/tools/generate_docomo_emoticon_table.rb +0 -1
  90. data/tools/generate_softbank_emoticon_table.rb +0 -1
  91. data/tools/update_ip_addresses_au.rb +4 -3
  92. data/tools/update_ip_addresses_willcom.rb +2 -2
  93. metadata +65 -35
  94. data/test/rails/rails_root/public/dispatch.cgi +0 -10
  95. data/test/rails/rails_root/public/dispatch.fcgi +0 -24
  96. data/test/rails/rails_root/public/dispatch.rb +0 -10
  97. data/test/rails/rails_root/script/performance/request +0 -3
  98. data/test/rails/rails_root/script/process/inspector +0 -3
  99. data/test/rails/rails_root/script/process/reaper +0 -3
  100. data/test/rails/rails_root/script/process/spawner +0 -3
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.0.7
2
+
3
+ * Rails 2.3.8 対応など
4
+
1
5
  == 0.0.3x 2008-09-26
2
6
 
3
7
  * メールアドレスからキャリアを判定する機能追加
data/README.rdoc CHANGED
@@ -16,12 +16,18 @@
16
16
 
17
17
  == インストール
18
18
  Rails の Version に応じて選択してください。
19
+ === Rails 2.3.3, 2.3.4, 2.3.5, 2.3.6, 2.3.7, 2.3.8
20
+ 開発版:
21
+ % ./script/plugin install git://github.com/darashi/jpmobile.git
22
+
19
23
  === Rails 2.3.2
20
24
  ==== pluginとしてインストールする場合
21
25
 
22
- リリース版:
23
- % ./script/plugin install git://github.com/darashi/jpmobile.git -r 'tag x.x.x'
24
- (x.x.xはバージョン)
26
+ リリース版: (Version 0.0.6)
27
+ % git clone git://github.com/darashi/jpmobile.git vendor/plugins/jpmobile
28
+ % cd vendor/plugins/jpmobile
29
+ % git checkout 0.0.6
30
+ % rm -rf .git
25
31
 
26
32
  開発版:
27
33
  % ./script/plugin install git://github.com/darashi/jpmobile.git
@@ -37,7 +43,10 @@ RAILS_ROOT/config/environment.rb の Rails::Initializer.run do |config| 〜 end
37
43
 
38
44
  === Rails 2.2.x 以前
39
45
  リリース版:
40
- % ./script/plugin install git://github.com/darashi/jpmobile.git -r 'tag 0.0.5'
46
+ % git clone git://github.com/darashi/jpmobile.git vendor/plugins/jpmobile
47
+ % cd vendor/plugins/jpmobile
48
+ % git checkout 0.0.5
49
+ % rm -rf .git
41
50
 
42
51
  == 使用例
43
52
 
@@ -159,6 +168,13 @@ trans_sid を使用する際には、例えば config/initializers/session_store
159
168
  このとき ApplicationController において protect_from_forgery の :secret を指定するか、
160
169
  あるいは protect_from_forgery を解除する必要があるでしょう。
161
170
 
171
+ また、
172
+ link_to "hoge", "/controller/action/id"
173
+ のようにリンク先を直接指定するとセッションIDは付加されません。
174
+ link_to "hoge", :controller => "controller", :action => "action", :id => "id"
175
+ のように指定する必要があります。
176
+
177
+
162
178
  === 端末の画面サイズ
163
179
  request.mobile.display で Jpmobile::Display クラスのインスタンスが返る。
164
180
  画面幅 <%= request.mobile.display.width %>
@@ -203,25 +219,23 @@ mobile_filterを有効にすると以下の処理が自動で行われる。
203
219
 
204
220
  == テストに必要なgemパッケージ
205
221
  テストを実行するためには以下のgemパッケージが必要です。
206
- * rails
207
- * rack
222
+ * rails (include rack)
223
+ * sqlite3-ruby
224
+ * test-unit (= 1.2.3)
208
225
  * hpricot
209
226
  * rspec
210
227
  * rspec-rails
211
- * spec-fixtures
228
+ * rspec-fixture
229
+ * mocha
212
230
 
213
231
  == リンク
214
- * Project Website: http://jpmobile-rails.org
215
- * RDoc Documentation: http://jpmobile.rubyforge.org/rdoc
216
- * GitHub: http://github.com/darashi/jpmobile/
217
- * RubyForge Project Page: http://rubyforge.org/projects/jpmobile
218
- * Mailing List: http://groups.google.com/group/jpmobile
219
- * IRC Channel #jpmobile@freenode.net
232
+
233
+ * http://jpmobile-rails.org
220
234
 
221
235
  == 作者
222
236
 
223
- Copyright 2006 (c) Yohji Shidara, under MIT License.
237
+ Copyright 2006-2010 (c) Yoji Shidara, under MIT License.
224
238
 
225
- Yohji Shidara <dara@shidara.net>
239
+ Yoji Shidara <dara@shidara.net>
226
240
 
227
241
  http://d.hatena.ne.jp/darashi
data/Rakefile CHANGED
@@ -64,9 +64,9 @@ spec =
64
64
  s.bindir = "bin"
65
65
  s.require_path = "lib"
66
66
 
67
- s.add_runtime_dependency('actionpack', '>=2.3.2')
68
- s.add_development_dependency('rspec', '>=1.1.12')
69
- s.add_development_dependency('rspec-rails', '>=1.1.12')
67
+ s.add_runtime_dependency('actionpack', '>=2.3.8')
68
+ s.add_development_dependency('rspec', '>=1.3.0')
69
+ s.add_development_dependency('rspec-rails', '>=1.3.2')
70
70
  s.add_development_dependency('rspec-fixture', '>=0.0.2')
71
71
 
72
72
  s.files = %w(README.rdoc CHANGELOG Rakefile) +
@@ -1,3 +1,4 @@
1
+ # -*- coding: utf-8 -*-
1
2
  Jpmobile::Emoticon::CONVERSION_TABLE_TO_DOCOMO = {
2
3
  0xE63E=>0xE63E,
3
4
  0xE63F=>0xE63F,
@@ -417,7 +418,7 @@ Jpmobile::Emoticon::CONVERSION_TABLE_TO_DOCOMO = {
417
418
  0xE58A=>'[リンク]',
418
419
  0xE51F=>0xE685,
419
420
  0xE520=>0xE6D0,
420
- 0xE48E=>'%i1%%i2%',
421
+ 0xE48E=>'&#xE63E;&#xE63F;',
421
422
  0xE4B3=>0xE662,
422
423
  0xE4B4=>0xE6A3,
423
424
  0xE4C8=>'[サイコロ]',
@@ -740,7 +741,7 @@ Jpmobile::Emoticon::CONVERSION_TABLE_TO_DOCOMO = {
740
741
  0xEAF0=>'[サンタ]',
741
742
  0xEAF1=>0xE6B3,
742
743
  0xEAF2=>'[虹]',
743
- 0xEAF3=>'%i44%%i139%',
744
+ 0xEAF3=>'&#xE669;&#xE6EF;',
744
745
  0xEAF4=>0xE63E,
745
746
  0xEAF5=>0xE67C,
746
747
  0xEAF6=>'[デパート]',
@@ -1156,7 +1157,7 @@ Jpmobile::Emoticon::CONVERSION_TABLE_TO_DOCOMO = {
1156
1157
  0xF40F=>0xE723,
1157
1158
  0xF410=>0xE6F4,
1158
1159
  0xF411=>0xE72D,
1159
- 0xF412=>'%i140%%i1034%',
1160
+ 0xF412=>'&#xE6F0;&#xE72D;',
1160
1161
  0xF413=>0xE72E,
1161
1162
  0xF414=>0xE6F0,
1162
1163
  0xF415=>0xE6F0,
@@ -1185,7 +1186,7 @@ Jpmobile::Emoticon::CONVERSION_TABLE_TO_DOCOMO = {
1185
1186
  0xF449=>0xE63E,
1186
1187
  0xF44A=>0xE63E,
1187
1188
  0xF44B=>0xE6B3,
1188
- 0xF501=>'%i44%%i139%',
1189
+ 0xF501=>'&#xE669;&#xE6EF;',
1189
1190
  0xF502=>0xE67B,
1190
1191
  0xF503=>0xE67C,
1191
1192
  0xF507=>0xE677,
@@ -1394,7 +1395,7 @@ Jpmobile::Emoticon::CONVERSION_TABLE_TO_AU = {
1394
1395
  0xE71F=>0xE57A,
1395
1396
  0xE720=>0xEAC0,
1396
1397
  0xE721=>0xEAC5,
1397
- 0xE722=>'%e257%%e330%',
1398
+ 0xE722=>'&#xE471;&#xE5B1;',
1398
1399
  0xE723=>0xE5C6,
1399
1400
  0xE724=>0xEB5D,
1400
1401
  0xE725=>0xEAC9,
@@ -2728,7 +2729,7 @@ Jpmobile::Emoticon::CONVERSION_TABLE_TO_SOFTBANK = {
2728
2729
  0xE714=>'[ドア]',
2729
2730
  0xE715=>0xF12F,
2730
2731
  0xE716=>0xF00C,
2731
- 0xE717=>'%s103%%s340%',
2732
+ 0xE717=>'&#xF103;&#xF328;',
2732
2733
  0xE718=>'[レンチ]',
2733
2734
  0xE719=>0xF301,
2734
2735
  0xE71A=>0xF10E,
@@ -2739,7 +2740,7 @@ Jpmobile::Emoticon::CONVERSION_TABLE_TO_SOFTBANK = {
2739
2740
  0xE71F=>'[腕時計]',
2740
2741
  0xE720=>0xF403,
2741
2742
  0xE721=>0xF40A,
2742
- 0xE722=>'%s421%%s349%',
2743
+ 0xE722=>'&#xF331;&#xF415;',
2743
2744
  0xE723=>0xF108,
2744
2745
  0xE724=>0xF416,
2745
2746
  0xE725=>0xF40E,
@@ -2958,7 +2959,7 @@ Jpmobile::Emoticon::CONVERSION_TABLE_TO_SOFTBANK = {
2958
2959
  0xE58A=>'[リンク]',
2959
2960
  0xE51F=>0xF112,
2960
2961
  0xE520=>0xF00B,
2961
- 0xE48E=>'%s74%%s73%',
2962
+ 0xE48E=>'&#xF04A;&#xF049;',
2962
2963
  0xE4B3=>0xF01D,
2963
2964
  0xE4B4=>0xF01C,
2964
2965
  0xE4C8=>'[サイコロ]',
@@ -3414,7 +3415,7 @@ Jpmobile::Emoticon::CONVERSION_TABLE_TO_SOFTBANK = {
3414
3415
  0xEB75=>0xF327,
3415
3416
  0xEB76=>0xF523,
3416
3417
  0xEB77=>'[ジーンズ]',
3417
- 0xEB78=>'%s103%%s340%',
3418
+ 0xEB78=>'&#xF103;&#xF328;',
3418
3419
  0xEB79=>'↑↓',
3419
3420
  0xEB7A=>'⇔',
3420
3421
  0xEB7B=>'↑↓',
@@ -1,3 +1,6 @@
1
+ # -*- coding: utf-8 -*-
2
+ require 'nkf'
3
+
1
4
  module Jpmobile
2
5
  # 絵文字関連処理
3
6
  module Emoticon
@@ -11,10 +14,10 @@ module Jpmobile
11
14
  %w( CONVERSION_TABLE_TO_DOCOMO CONVERSION_TABLE_TO_AU CONVERSION_TABLE_TO_SOFTBANK ).each do |const|
12
15
  autoload const, 'jpmobile/emoticon/conversion_table'
13
16
  end
14
- %w(
15
- SJIS_TO_UNICODE UNICODE_TO_SJIS
16
- SJIS_REGEXP SOFTBANK_WEBCODE_REGEXP DOCOMO_SJIS_REGEXP AU_SJIS_REGEXP SOFTBANK_UNICODE_REGEXP
17
- EMOTICON_UNICODES UTF8_REGEXP
17
+ %w(
18
+ SJIS_TO_UNICODE UNICODE_TO_SJIS
19
+ SJIS_REGEXP SOFTBANK_WEBCODE_REGEXP DOCOMO_SJIS_REGEXP AU_SJIS_REGEXP SOFTBANK_UNICODE_REGEXP
20
+ EMOTICON_UNICODES UTF8_REGEXP
18
21
  ).each do |const|
19
22
  autoload const, 'jpmobile/emoticon/z_combine'
20
23
  end
@@ -94,8 +97,13 @@ module Jpmobile
94
97
  match
95
98
  end
96
99
  when String
97
- # 変換先がUnicodeで指定されている。
98
- to_sjis ? Kconv::kconv(converted, Kconv::SJIS, Kconv::UTF8) : converted
100
+ # 変換先が数値参照だと、再変換する
101
+ if converted.match(/&#x([0-9a-f]{4});/i)
102
+ self.unicodecr_to_external(converted, conversion_table, to_sjis)
103
+ else
104
+ # 変換先が文字列で指定されている。
105
+ to_sjis ? NKF.nkf('-m0 -x -Ws', converted) : converted
106
+ end
99
107
  when nil
100
108
  # 変換先が定義されていない。
101
109
  match
@@ -25,13 +25,8 @@ module Jpmobile
25
25
  module Filter
26
26
  # 文字コードフィルタのベースクラス。
27
27
  class Base
28
- def initialize
29
- @counter = 0 # render :component 時に多重で適用されるのを防ぐ
30
- end
31
28
  # 外部コードから内部コードに変換
32
29
  def before(controller)
33
- @counter += 1
34
- return unless @counter == 1
35
30
  if respond_to?(:to_internal) && apply_incoming?(controller)
36
31
  Util.deep_apply(controller.params) do |value|
37
32
  value = to_internal(value, controller)
@@ -40,8 +35,6 @@ module Jpmobile
40
35
  end
41
36
  # 内部コードから外部コードに変換
42
37
  def after(controller)
43
- @counter -= 1
44
- return unless @counter.zero?
45
38
  if respond_to?(:to_external) && apply_outgoing?(controller) && controller.response.body.is_a?(String)
46
39
  controller.response.body = to_external(controller.response.body, controller)
47
40
  after_after(controller) if respond_to? :after_after
@@ -117,8 +110,8 @@ module Jpmobile
117
110
  # 半角カナと全角カナのフィルタ
118
111
  class HankakuKana < FilterTable
119
112
  include ApplyOnlyForMobile
120
- @@internal = %w(ガ ギ グ ゲ ゴ ザ ジ ズ ゼ ゾ ダ ヂ ヅ デ ド バ ビ ブ ベ ボ パ ピ プ ペ ポ ヴ ア イ ウ エ オ カ キ ク ケ コ サ シ ス セ ソ タ チ ツ テ ト ナ ニ ヌ ネ ノ ハ ヒ フ ヘ ホ マ ミ ム メ モ ヤ ユ ヨ ラ リ ル レ ロ ワ ヲ ン ャ ュ ョ ァ ィ ゥ ェ ォ ッ ゛ ゜ ー ).freeze
121
- @@external = %w(ガ ギ グ ゲ ゴ ザ ジ ズ ゼ ゾ ダ ヂ ヅ デ ド バ ビ ブ ベ ボ パ ピ プ ペ ポ ヴ ア イ ウ エ オ カ キ ク ケ コ サ シ ス セ ソ タ チ ツ テ ト ナ ニ ヌ ネ ノ ハ ヒ フ ヘ ホ マ ミ ム メ モ ヤ ユ ヨ ラ リ ル レ ロ ワ ヲ ン ャ ュ ョ ァ ィ ゥ ェ ォ ッ ゙ ゚ ー).freeze
113
+ @@internal = %w(ガ ギ グ ゲ ゴ ザ ジ ズ ゼ ゾ ダ ヂ ヅ デ ド バ ビ ブ ベ ボ パ ピ プ ペ ポ ヴ ア イ ウ エ オ カ キ ク ケ コ サ シ ス セ ソ タ チ ツ テ ト ナ ニ ヌ ネ ノ ハ ヒ フ ヘ ホ マ ミ ム メ モ ヤ ユ ヨ ラ リ ル レ ロ ワ ヲ ン ャ ュ ョ ァ ィ ゥ ェ ォ ッ ゛ ゜ ー 。 「 」 、 ・).freeze
114
+ @@external = %w(ガ ギ グ ゲ ゴ ザ ジ ズ ゼ ゾ ダ ヂ ヅ デ ド バ ビ ブ ベ ボ パ ピ プ ペ ポ ヴ ア イ ウ エ オ カ キ ク ケ コ サ シ ス セ ソ タ チ ツ テ ト ナ ニ ヌ ネ ノ ハ ヒ フ ヘ ホ マ ミ ム メ モ ヤ ユ ヨ ラ リ ル レ ロ ワ ヲ ン ャ ュ ョ ァ ィ ゥ ェ ォ ッ ゙ ゚ ー 。 「 」 、 ・).freeze
122
115
  end
123
116
 
124
117
  # 絵文字変換フィルタ
@@ -63,6 +63,8 @@ module Jpmobile
63
63
  options[:only_path] = false
64
64
  posinfo = options.delete(:posinfo) || "1" # 基地局情報を元に測位した緯度経度情報を要求
65
65
  url = url_for(options)
66
+ else
67
+ posinfo = "1"
66
68
  end
67
69
  return "http://w1m.docomo.ne.jp/cp/iarea?ecode=OPENAREACODE&msn=OPENAREAKEY&posinfo=#{posinfo}&nl=#{CGI.escape(url)}"
68
70
  end
@@ -13,12 +13,12 @@ require 'action_view'
13
13
 
14
14
  # ActionView::Base を拡張して携帯からのアクセスの場合に携帯向けビューを優先表示する。
15
15
  # Vodafone携帯(request.mobile == Jpmobile::Mobile::Vodafone)の場合、
16
- # index_mobile_vodafone.rhtml
17
- # index_mobile_softbank.rhtml
18
- # index_mobile.rhtml
19
- # index.rhtml
16
+ # index_mobile_vodafone.html.erb
17
+ # index_mobile_softbank.html.erb
18
+ # index_mobile.html.erb
19
+ # index.html.erb
20
20
  # の順にテンプレートが検索される。
21
- # BUG: 現状、上記の例では index.rhtml が存在しない場合に振り分けが行われない
21
+ # BUG: 現状、上記の例では index.html.erb が存在しない場合に振り分けが行われない
22
22
  # (ダミーファイルを置くことで回避可能)。
23
23
 
24
24
  module ActionView
@@ -1,7 +1,7 @@
1
1
  # =SoftBank携帯電話
2
2
  # J-PHONE, Vodafoneを含む
3
3
 
4
- require 'kconv'
4
+ require 'nkf'
5
5
 
6
6
  module Jpmobile::Mobile
7
7
  # ==Softbank携帯電話
@@ -97,7 +97,7 @@ module Jpmobile::Mobile
97
97
  pos = Jpmobile::Position.new
98
98
  pos.lat = Jpmobile::Position.dms2deg($1,$2,$3)
99
99
  pos.lon = Jpmobile::Position.dms2deg($4,$5,$6)
100
- pos.options = {"address"=>CGI.unescape($7).toutf8}
100
+ pos.options = {"address"=>NKF.nkf("-m0 -Sw", CGI.unescape($7))}
101
101
  pos.tokyo2wgs84!
102
102
  return pos
103
103
  end