jpmobile 5.2.3 → 6.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +1 -1
  3. data/.onkcop-config.yml +423 -0
  4. data/.rubocop.yml +8 -10
  5. data/.ruby-version +1 -1
  6. data/Gemfile +2 -2
  7. data/Gemfile.lock +155 -130
  8. data/README.md +2 -2
  9. data/jpmobile.gemspec +3 -1
  10. data/lib/jpmobile.rb +1 -0
  11. data/lib/jpmobile/emoticon.rb +6 -6
  12. data/lib/jpmobile/filter.rb +7 -2
  13. data/lib/jpmobile/hook_action_view.rb +4 -10
  14. data/lib/jpmobile/hook_test_request.rb +1 -1
  15. data/lib/jpmobile/mail.rb +3 -3
  16. data/lib/jpmobile/mobile/android.rb +1 -1
  17. data/lib/jpmobile/mobile/au.rb +2 -2
  18. data/lib/jpmobile/mobile/black_berry.rb +1 -1
  19. data/lib/jpmobile/mobile/ddipocket.rb +1 -1
  20. data/lib/jpmobile/mobile/docomo.rb +2 -2
  21. data/lib/jpmobile/mobile/emobile.rb +2 -2
  22. data/lib/jpmobile/mobile/ipad.rb +1 -1
  23. data/lib/jpmobile/mobile/iphone.rb +1 -1
  24. data/lib/jpmobile/mobile/softbank.rb +2 -2
  25. data/lib/jpmobile/mobile/vodafone.rb +2 -2
  26. data/lib/jpmobile/mobile/willcom.rb +2 -2
  27. data/lib/jpmobile/mobile/windows_phone.rb +1 -1
  28. data/lib/jpmobile/rails.rb +8 -6
  29. data/lib/jpmobile/resolver.rb +4 -37
  30. data/lib/jpmobile/session/active_record_store.rb +1 -1
  31. data/lib/jpmobile/session/mem_cache_store.rb +1 -1
  32. data/lib/jpmobile/trans_sid.rb +1 -1
  33. data/lib/jpmobile/util.rb +2 -2
  34. data/lib/jpmobile/version.rb +1 -1
  35. data/lib/tasks/jpmobile_tasks.rake +4 -4
  36. data/spec/rack/jpmobile/emoticon_spec.rb +48 -48
  37. data/spec/rack_helper.rb +1 -1
  38. data/spec/unit/receive_mail_spec.rb +9 -9
  39. data/spec/unit/util_spec.rb +4 -4
  40. data/test/rails/overrides/app/controllers/mobile_spec_controller.rb +1 -1
  41. data/test/rails/overrides/app/mailboxes/application_mailbox.rb +3 -0
  42. data/test/rails/overrides/app/mailboxes/mobile_mailer_mailbox.rb +5 -0
  43. data/test/rails/overrides/app/mailers/decorated_mailer.rb +1 -1
  44. data/test/rails/overrides/db/migrate/20201111033056_create_active_storage_tables.active_storage.rb +36 -0
  45. data/test/rails/overrides/db/migrate/20201111033057_create_action_mailbox_tables.action_mailbox.rb +14 -0
  46. data/test/rails/overrides/spec/controllers/hankaku_filter_controller_spec.rb +1 -1
  47. data/test/rails/overrides/spec/controllers/template_path_spec.rb +2 -0
  48. data/test/rails/overrides/spec/fixtures/{mobile_mailer → files/mobile_mailer}/au-attached.eml +0 -0
  49. data/test/rails/overrides/spec/fixtures/{mobile_mailer → files/mobile_mailer}/au-decomail.eml +0 -0
  50. data/test/rails/overrides/spec/fixtures/{mobile_mailer → files/mobile_mailer}/au-emoji.eml +0 -0
  51. data/test/rails/overrides/spec/fixtures/{mobile_mailer → files/mobile_mailer}/au-emoji2.eml +0 -0
  52. data/test/rails/overrides/spec/fixtures/{mobile_mailer → files/mobile_mailer}/au-emoji5.eml +0 -0
  53. data/test/rails/overrides/spec/fixtures/{mobile_mailer → files/mobile_mailer}/bounced-jp.eml +0 -0
  54. data/test/rails/overrides/spec/fixtures/{mobile_mailer → files/mobile_mailer}/docomo-emoji.eml +0 -0
  55. data/test/rails/overrides/spec/fixtures/{mobile_mailer → files/mobile_mailer}/docomo-gmail-sjis.eml +0 -0
  56. data/test/rails/overrides/spec/fixtures/{mobile_mailer → files/mobile_mailer}/docomo-jis.eml +0 -0
  57. data/{spec/unit/email-fixtures → test/rails/overrides/spec/fixtures/files/mobile_mailer}/iphone-message.eml +0 -0
  58. data/test/rails/overrides/spec/fixtures/{mobile_mailer → files/mobile_mailer}/no-from.eml +0 -0
  59. data/test/rails/overrides/spec/fixtures/{mobile_mailer → files/mobile_mailer}/non-jp.eml +0 -0
  60. data/test/rails/overrides/spec/fixtures/{mobile_mailer → files/mobile_mailer}/photo.jpg +0 -0
  61. data/test/rails/overrides/spec/fixtures/{mobile_mailer → files/mobile_mailer}/softbank-blank.eml +0 -0
  62. data/test/rails/overrides/spec/fixtures/{mobile_mailer → files/mobile_mailer}/softbank-emoji-utf8.eml +0 -0
  63. data/test/rails/overrides/spec/fixtures/{mobile_mailer → files/mobile_mailer}/softbank-emoji.eml +0 -0
  64. data/test/rails/overrides/spec/fixtures/{mobile_mailer → files/mobile_mailer}/softbank-gmail-sjis.eml +0 -0
  65. data/test/rails/overrides/spec/fixtures/{mobile_mailer → files/mobile_mailer}/softbank-gmail-utf8.eml +0 -0
  66. data/test/rails/overrides/spec/mailboxes/mobile_mailer_mailbox_spec.rb +265 -0
  67. data/test/rails/overrides/spec/mailers/mobile_mailer_spec.rb +0 -305
  68. data/test/rails/overrides/spec/requests/emobile_spec.rb +2 -2
  69. metadata +80 -42
@@ -1 +1 @@
1
- 2.5.1
1
+ 2.7.2
data/Gemfile CHANGED
@@ -3,5 +3,5 @@ source 'https://rubygems.org'
3
3
  # Specify your gem's dependencies in jpmobile.gemspec
4
4
  gemspec
5
5
 
6
- gem 'onkcop', require: false
7
- gem 'rubocop', require: false
6
+ gem 'rubocop', '0.79.0', require: false
7
+ gem 'rubocop-performance', '1.5.2', require: false
@@ -1,193 +1,218 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- jpmobile (5.2.2)
4
+ jpmobile (6.0.0)
5
5
  mail (~> 2.7.0)
6
+ rexml
7
+ scanf
6
8
 
7
9
  GEM
8
10
  remote: https://rubygems.org/
9
11
  specs:
10
- actioncable (5.2.2)
11
- actionpack (= 5.2.2)
12
+ actioncable (6.1.0)
13
+ actionpack (= 6.1.0)
14
+ activesupport (= 6.1.0)
12
15
  nio4r (~> 2.0)
13
16
  websocket-driver (>= 0.6.1)
14
- actionmailer (5.2.2)
15
- actionpack (= 5.2.2)
16
- actionview (= 5.2.2)
17
- activejob (= 5.2.2)
17
+ actionmailbox (6.1.0)
18
+ actionpack (= 6.1.0)
19
+ activejob (= 6.1.0)
20
+ activerecord (= 6.1.0)
21
+ activestorage (= 6.1.0)
22
+ activesupport (= 6.1.0)
23
+ mail (>= 2.7.1)
24
+ actionmailer (6.1.0)
25
+ actionpack (= 6.1.0)
26
+ actionview (= 6.1.0)
27
+ activejob (= 6.1.0)
28
+ activesupport (= 6.1.0)
18
29
  mail (~> 2.5, >= 2.5.4)
19
30
  rails-dom-testing (~> 2.0)
20
- actionpack (5.2.2)
21
- actionview (= 5.2.2)
22
- activesupport (= 5.2.2)
23
- rack (~> 2.0)
31
+ actionpack (6.1.0)
32
+ actionview (= 6.1.0)
33
+ activesupport (= 6.1.0)
34
+ rack (~> 2.0, >= 2.0.9)
24
35
  rack-test (>= 0.6.3)
25
36
  rails-dom-testing (~> 2.0)
26
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
27
- actionview (5.2.2)
28
- activesupport (= 5.2.2)
37
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
38
+ actiontext (6.1.0)
39
+ actionpack (= 6.1.0)
40
+ activerecord (= 6.1.0)
41
+ activestorage (= 6.1.0)
42
+ activesupport (= 6.1.0)
43
+ nokogiri (>= 1.8.5)
44
+ actionview (6.1.0)
45
+ activesupport (= 6.1.0)
29
46
  builder (~> 3.1)
30
47
  erubi (~> 1.4)
31
48
  rails-dom-testing (~> 2.0)
32
- rails-html-sanitizer (~> 1.0, >= 1.0.3)
33
- activejob (5.2.2)
34
- activesupport (= 5.2.2)
49
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
50
+ activejob (6.1.0)
51
+ activesupport (= 6.1.0)
35
52
  globalid (>= 0.3.6)
36
- activemodel (5.2.2)
37
- activesupport (= 5.2.2)
38
- activerecord (5.2.2)
39
- activemodel (= 5.2.2)
40
- activesupport (= 5.2.2)
41
- arel (>= 9.0)
42
- activestorage (5.2.2)
43
- actionpack (= 5.2.2)
44
- activerecord (= 5.2.2)
53
+ activemodel (6.1.0)
54
+ activesupport (= 6.1.0)
55
+ activerecord (6.1.0)
56
+ activemodel (= 6.1.0)
57
+ activesupport (= 6.1.0)
58
+ activestorage (6.1.0)
59
+ actionpack (= 6.1.0)
60
+ activejob (= 6.1.0)
61
+ activerecord (= 6.1.0)
62
+ activesupport (= 6.1.0)
45
63
  marcel (~> 0.3.1)
46
- activesupport (5.2.2)
64
+ mimemagic (~> 0.3.2)
65
+ activesupport (6.1.0)
47
66
  concurrent-ruby (~> 1.0, >= 1.0.2)
48
- i18n (>= 0.7, < 2)
49
- minitest (~> 5.1)
50
- tzinfo (~> 1.1)
51
- addressable (2.5.2)
52
- public_suffix (>= 2.0.2, < 4.0)
53
- arel (9.0.0)
54
- ast (2.4.0)
55
- builder (3.2.3)
56
- capybara (3.0.1)
67
+ i18n (>= 1.6, < 2)
68
+ minitest (>= 5.1)
69
+ tzinfo (~> 2.0)
70
+ zeitwerk (~> 2.3)
71
+ addressable (2.7.0)
72
+ public_suffix (>= 2.0.2, < 5.0)
73
+ ast (2.4.1)
74
+ builder (3.2.4)
75
+ capybara (3.34.0)
57
76
  addressable
58
77
  mini_mime (>= 0.1.3)
59
78
  nokogiri (~> 1.8)
60
79
  rack (>= 1.6.0)
61
80
  rack-test (>= 0.6.3)
62
- xpath (~> 3.0)
63
- capybara-webkit (1.15.0)
81
+ regexp_parser (~> 1.5)
82
+ xpath (~> 3.2)
83
+ capybara-webkit (1.15.1)
64
84
  capybara (>= 2.3, < 4.0)
65
85
  json
66
- coderay (1.1.2)
67
- concurrent-ruby (1.1.3)
68
- crass (1.0.4)
69
- diff-lcs (1.3)
70
- erubi (1.7.1)
71
- geokit (1.11.0)
72
- git (1.3.0)
73
- globalid (0.4.1)
86
+ coderay (1.1.3)
87
+ concurrent-ruby (1.1.7)
88
+ crass (1.0.6)
89
+ diff-lcs (1.4.4)
90
+ erubi (1.10.0)
91
+ geokit (1.13.1)
92
+ git (1.7.0)
93
+ rchardet (~> 1.8)
94
+ globalid (0.4.2)
74
95
  activesupport (>= 4.2.0)
75
96
  hpricot (0.8.6)
76
- i18n (1.1.1)
97
+ i18n (1.8.5)
77
98
  concurrent-ruby (~> 1.0)
78
- json (2.1.0)
79
- loofah (2.2.3)
99
+ jaro_winkler (1.5.4)
100
+ json (2.3.1)
101
+ loofah (2.8.0)
80
102
  crass (~> 1.0.2)
81
103
  nokogiri (>= 1.5.9)
82
104
  mail (2.7.1)
83
105
  mini_mime (>= 0.1.1)
84
106
  marcel (0.3.3)
85
107
  mimemagic (~> 0.3.2)
86
- method_source (0.9.2)
87
- mimemagic (0.3.2)
88
- mini_mime (1.0.1)
89
- mini_portile2 (2.3.0)
90
- minitest (5.11.3)
91
- nio4r (2.3.1)
92
- nokogiri (1.8.5)
93
- mini_portile2 (~> 2.3.0)
94
- onkcop (0.53.0.0)
95
- rubocop (~> 0.53.0)
96
- rubocop-rspec (>= 1.24.0)
97
- parallel (1.12.1)
98
- parser (2.5.0.5)
99
- ast (~> 2.4.0)
100
- powerpack (0.1.1)
101
- pry (0.11.3)
102
- coderay (~> 1.1.0)
103
- method_source (~> 0.9.0)
104
- public_suffix (3.0.2)
105
- rack (2.0.6)
108
+ method_source (1.0.0)
109
+ mimemagic (0.3.5)
110
+ mini_mime (1.0.2)
111
+ mini_portile2 (2.4.0)
112
+ minitest (5.14.2)
113
+ nio4r (2.5.4)
114
+ nokogiri (1.10.10)
115
+ mini_portile2 (~> 2.4.0)
116
+ parallel (1.20.1)
117
+ parser (2.7.2.0)
118
+ ast (~> 2.4.1)
119
+ pry (0.13.1)
120
+ coderay (~> 1.1)
121
+ method_source (~> 1.0)
122
+ public_suffix (4.0.6)
123
+ rack (2.2.3)
106
124
  rack-test (1.1.0)
107
125
  rack (>= 1.0, < 3)
108
- rails (5.2.2)
109
- actioncable (= 5.2.2)
110
- actionmailer (= 5.2.2)
111
- actionpack (= 5.2.2)
112
- actionview (= 5.2.2)
113
- activejob (= 5.2.2)
114
- activemodel (= 5.2.2)
115
- activerecord (= 5.2.2)
116
- activestorage (= 5.2.2)
117
- activesupport (= 5.2.2)
118
- bundler (>= 1.3.0)
119
- railties (= 5.2.2)
126
+ rails (6.1.0)
127
+ actioncable (= 6.1.0)
128
+ actionmailbox (= 6.1.0)
129
+ actionmailer (= 6.1.0)
130
+ actionpack (= 6.1.0)
131
+ actiontext (= 6.1.0)
132
+ actionview (= 6.1.0)
133
+ activejob (= 6.1.0)
134
+ activemodel (= 6.1.0)
135
+ activerecord (= 6.1.0)
136
+ activestorage (= 6.1.0)
137
+ activesupport (= 6.1.0)
138
+ bundler (>= 1.15.0)
139
+ railties (= 6.1.0)
120
140
  sprockets-rails (>= 2.0.0)
121
141
  rails-dom-testing (2.0.3)
122
142
  activesupport (>= 4.2.0)
123
143
  nokogiri (>= 1.6)
124
- rails-html-sanitizer (1.0.4)
125
- loofah (~> 2.2, >= 2.2.2)
126
- railties (5.2.2)
127
- actionpack (= 5.2.2)
128
- activesupport (= 5.2.2)
144
+ rails-html-sanitizer (1.3.0)
145
+ loofah (~> 2.3)
146
+ railties (6.1.0)
147
+ actionpack (= 6.1.0)
148
+ activesupport (= 6.1.0)
129
149
  method_source
130
150
  rake (>= 0.8.7)
131
- thor (>= 0.19.0, < 2.0)
151
+ thor (~> 1.0)
132
152
  rainbow (3.0.0)
133
- rake (12.3.1)
134
- rspec (3.7.0)
135
- rspec-core (~> 3.7.0)
136
- rspec-expectations (~> 3.7.0)
137
- rspec-mocks (~> 3.7.0)
138
- rspec-core (3.7.1)
139
- rspec-support (~> 3.7.0)
140
- rspec-expectations (3.7.0)
153
+ rake (13.0.1)
154
+ rchardet (1.8.0)
155
+ regexp_parser (1.8.2)
156
+ rexml (3.2.4)
157
+ rspec (3.10.0)
158
+ rspec-core (~> 3.10.0)
159
+ rspec-expectations (~> 3.10.0)
160
+ rspec-mocks (~> 3.10.0)
161
+ rspec-core (3.10.0)
162
+ rspec-support (~> 3.10.0)
163
+ rspec-expectations (3.10.0)
141
164
  diff-lcs (>= 1.2.0, < 2.0)
142
- rspec-support (~> 3.7.0)
143
- rspec-its (1.2.0)
165
+ rspec-support (~> 3.10.0)
166
+ rspec-its (1.3.0)
144
167
  rspec-core (>= 3.0.0)
145
168
  rspec-expectations (>= 3.0.0)
146
- rspec-mocks (3.7.0)
169
+ rspec-mocks (3.10.0)
147
170
  diff-lcs (>= 1.2.0, < 2.0)
148
- rspec-support (~> 3.7.0)
149
- rspec-rails (3.7.2)
150
- actionpack (>= 3.0)
151
- activesupport (>= 3.0)
152
- railties (>= 3.0)
153
- rspec-core (~> 3.7.0)
154
- rspec-expectations (~> 3.7.0)
155
- rspec-mocks (~> 3.7.0)
156
- rspec-support (~> 3.7.0)
157
- rspec-support (3.7.1)
158
- rubocop (0.53.0)
171
+ rspec-support (~> 3.10.0)
172
+ rspec-rails (4.0.1)
173
+ actionpack (>= 4.2)
174
+ activesupport (>= 4.2)
175
+ railties (>= 4.2)
176
+ rspec-core (~> 3.9)
177
+ rspec-expectations (~> 3.9)
178
+ rspec-mocks (~> 3.9)
179
+ rspec-support (~> 3.9)
180
+ rspec-support (3.10.0)
181
+ rubocop (0.79.0)
182
+ jaro_winkler (~> 1.5.1)
159
183
  parallel (~> 1.10)
160
- parser (>= 2.5)
161
- powerpack (~> 0.1)
184
+ parser (>= 2.7.0.1)
162
185
  rainbow (>= 2.2.2, < 4.0)
163
186
  ruby-progressbar (~> 1.7)
164
- unicode-display_width (~> 1.0, >= 1.0.1)
165
- rubocop-rspec (1.25.0)
166
- rubocop (>= 0.53.0)
167
- ruby-progressbar (1.9.0)
168
- sprockets (3.7.2)
187
+ unicode-display_width (>= 1.4.0, < 1.7)
188
+ rubocop-performance (1.5.2)
189
+ rubocop (>= 0.71.0)
190
+ ruby-progressbar (1.10.1)
191
+ scanf (1.0.0)
192
+ sprockets (4.0.2)
169
193
  concurrent-ruby (~> 1.0)
170
194
  rack (> 1, < 3)
171
- sprockets-rails (3.2.1)
195
+ sprockets-rails (3.2.2)
172
196
  actionpack (>= 4.0)
173
197
  activesupport (>= 4.0)
174
198
  sprockets (>= 3.0.0)
175
- sqlite3 (1.3.13)
199
+ sqlite3 (1.4.2)
176
200
  sqlite3-ruby (1.3.3)
177
201
  sqlite3 (>= 1.3.3)
178
- thor (0.20.3)
179
- thread_safe (0.3.6)
180
- tzinfo (1.2.5)
181
- thread_safe (~> 0.1)
182
- unicode-display_width (1.3.0)
183
- websocket-driver (0.7.0)
202
+ thor (1.0.1)
203
+ tzinfo (2.0.3)
204
+ concurrent-ruby (~> 1.0)
205
+ unicode-display_width (1.6.1)
206
+ websocket-driver (0.7.3)
184
207
  websocket-extensions (>= 0.1.0)
185
- websocket-extensions (0.1.3)
186
- xpath (3.0.0)
208
+ websocket-extensions (0.1.5)
209
+ xpath (3.2.0)
187
210
  nokogiri (~> 1.8)
211
+ zeitwerk (2.4.2)
188
212
 
189
213
  PLATFORMS
190
214
  ruby
215
+ x86_64-darwin-19
191
216
 
192
217
  DEPENDENCIES
193
218
  capybara-webkit
@@ -195,14 +220,14 @@ DEPENDENCIES
195
220
  git
196
221
  hpricot
197
222
  jpmobile!
198
- onkcop
199
223
  pry
200
- rails (~> 5.2.0)
224
+ rails (~> 6.1.0)
201
225
  rspec
202
226
  rspec-its
203
227
  rspec-rails
204
- rubocop
228
+ rubocop (= 0.79.0)
229
+ rubocop-performance (= 1.5.2)
205
230
  sqlite3-ruby
206
231
 
207
232
  BUNDLED WITH
208
- 1.16.4
233
+ 2.2.2
data/README.md CHANGED
@@ -316,7 +316,7 @@ end
316
316
 
317
317
  ```ruby
318
318
  <%= get_position_link_to("位置情報を取得する", :action=>:gps) %>
319
- ```ruby
319
+ ```
320
320
 
321
321
  ### セッションIDの付与(Trans SID)
322
322
  #### Cookie非対応携帯だけに付与する
@@ -353,7 +353,7 @@ Rails.application.config.session_options = {:cookie_only => false}
353
353
 
354
354
  ```ruby
355
355
  link_to "hoge", "/controller/action/id"
356
- ```ruby
356
+ ```
357
357
 
358
358
  のようにリンク先を直接指定するとセッションIDは付加されません。
359
359
 
@@ -17,12 +17,14 @@ Gem::Specification.new do |gem|
17
17
  gem.require_paths = ['lib']
18
18
 
19
19
  gem.add_dependency 'mail', '~> 2.7.0'
20
+ gem.add_dependency 'scanf'
21
+ gem.add_dependency 'rexml'
20
22
  gem.add_development_dependency 'capybara-webkit'
21
23
  gem.add_development_dependency 'geokit'
22
24
  gem.add_development_dependency 'git'
23
25
  gem.add_development_dependency 'hpricot'
24
26
  gem.add_development_dependency 'pry'
25
- gem.add_development_dependency 'rails', '~> 5.2.0'
27
+ gem.add_development_dependency 'rails', '~> 6.1.0'
26
28
  gem.add_development_dependency 'rspec'
27
29
  gem.add_development_dependency 'rspec-its'
28
30
  gem.add_development_dependency 'rspec-rails'
@@ -14,6 +14,7 @@ module Jpmobile
14
14
  autoload :Encoding, 'jpmobile/encoding'
15
15
  autoload :Version, 'jpmobile/version'
16
16
  autoload :DatumConv, 'jpmobile/datum_conv'
17
+ autoload :Helpers, 'jpmobile/helpers'
17
18
 
18
19
  # autoload mobile classes
19
20
  module Mobile
@@ -41,7 +41,7 @@ module Jpmobile
41
41
  # +str+ のなかでDoCoMo絵文字をUnicode数値文字参照に置換した文字列を返す。
42
42
  def self.external_to_unicodecr_docomo(str)
43
43
  str.gsub(DOCOMO_SJIS_REGEXP) do |match|
44
- sjis = match.unpack('n').first
44
+ sjis = match.unpack1('n')
45
45
  unicode = DOCOMO_SJIS_TO_UNICODE[sjis]
46
46
  unicode ? ('&#x%04x;' % unicode) : match
47
47
  end
@@ -50,7 +50,7 @@ module Jpmobile
50
50
  # +str+ のなかでau絵文字をUnicode数値文字参照に置換した文字列を返す。
51
51
  def self.external_to_unicodecr_au(str)
52
52
  str.gsub(AU_SJIS_REGEXP) do |match|
53
- sjis = match.unpack('n').first
53
+ sjis = match.unpack1('n')
54
54
  unicode = AU_SJIS_TO_UNICODE[sjis]
55
55
  unicode ? ('&#x%04x;' % unicode) : match
56
56
  end
@@ -61,7 +61,7 @@ module Jpmobile
61
61
  str = Jpmobile::Util.ascii_8bit(in_str)
62
62
  str.gsub(Jpmobile::Util.jis_string_regexp) do |jis_string|
63
63
  jis_string.gsub(/[\x21-\x7e]{2}/) do |match|
64
- jis = match.unpack('n').first
64
+ jis = match.unpack1('n')
65
65
  unicode = AU_EMAILJIS_TO_UNICODE[jis]
66
66
  unicode ? Jpmobile::Util.ascii_8bit("\x1b\x28\x42&#x%04x;\x1b\x24\x42" % unicode) : match
67
67
  end
@@ -72,7 +72,7 @@ module Jpmobile
72
72
  def self.external_to_unicodecr_softbank(str)
73
73
  # SoftBank Unicode
74
74
  str.gsub(SOFTBANK_UNICODE_REGEXP) do |match|
75
- unicode = match.unpack('U').first
75
+ unicode = match.unpack1('U')
76
76
  '&#x%04x;' % (unicode + 0x1000)
77
77
  end
78
78
  end
@@ -80,7 +80,7 @@ module Jpmobile
80
80
  def self.external_to_unicodecr_softbank_sjis(str)
81
81
  # SoftBank Shift_JIS
82
82
  str.gsub(SOFTBANK_SJIS_REGEXP) do |match|
83
- sjis = match.unpack('n').first
83
+ sjis = match.unpack1('n')
84
84
  unicode = SOFTBANK_SJIS_TO_UNICODE[sjis]
85
85
  '&#x%04x;' % (unicode + 0x1000)
86
86
  end
@@ -209,7 +209,7 @@ module Jpmobile
209
209
  # +str+ のなかでUTF-8で表記された絵文字をUnicode数値文字参照に置換する。
210
210
  def self.utf8_to_unicodecr(str)
211
211
  str.gsub(UTF8_REGEXP) do |match|
212
- '&#x%04x;' % match.unpack('U').first
212
+ '&#x%04x;' % match.unpack1('U')
213
213
  end
214
214
  end
215
215