jpmobile 5.0.1 → 5.2.0

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 (62) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +1 -2
  3. data/.rubocop.yml +17 -3
  4. data/.ruby-version +1 -0
  5. data/Gemfile +1 -0
  6. data/Gemfile.lock +128 -118
  7. data/Rakefile +0 -1
  8. data/circle.yml +1 -1
  9. data/jpmobile.gemspec +9 -7
  10. data/lib/jpmobile/docomo_guid.rb +1 -0
  11. data/lib/jpmobile/email.rb +1 -1
  12. data/lib/jpmobile/emoticon/z_combine.rb +14 -14
  13. data/lib/jpmobile/emoticon.rb +3 -3
  14. data/lib/jpmobile/fallback_view_selector.rb +1 -1
  15. data/lib/jpmobile/mail.rb +17 -15
  16. data/lib/jpmobile/mobile/abstract_mobile.rb +11 -12
  17. data/lib/jpmobile/mobile/android.rb +2 -2
  18. data/lib/jpmobile/mobile/android_tablet.rb +2 -2
  19. data/lib/jpmobile/mobile/au.rb +4 -1
  20. data/lib/jpmobile/mobile/docomo.rb +4 -0
  21. data/lib/jpmobile/mobile/ipad.rb +2 -2
  22. data/lib/jpmobile/mobile/iphone.rb +2 -2
  23. data/lib/jpmobile/mobile/softbank.rb +2 -1
  24. data/lib/jpmobile/mobile/willcom.rb +1 -0
  25. data/lib/jpmobile/path_set.rb +2 -0
  26. data/lib/jpmobile/rack/filter.rb +1 -1
  27. data/lib/jpmobile/rack/params_filter.rb +1 -1
  28. data/lib/jpmobile/rails.rb +1 -1
  29. data/lib/jpmobile/resolver.rb +7 -22
  30. data/lib/jpmobile/trans_sid.rb +3 -3
  31. data/lib/jpmobile/util.rb +2 -2
  32. data/lib/jpmobile/version.rb +1 -1
  33. data/lib/jpmobile.rb +1 -1
  34. data/lib/tasks/jpmobile_tasks.rake +8 -9
  35. data/spec/rack/jpmobile/android_spec.rb +2 -2
  36. data/spec/rack/jpmobile/au_spec.rb +17 -17
  37. data/spec/rack/jpmobile/black_berry_spec.rb +2 -2
  38. data/spec/rack/jpmobile/docomo_spec.rb +15 -15
  39. data/spec/rack/jpmobile/emoticon_spec.rb +31 -31
  40. data/spec/rack/jpmobile/filter_spec.rb +23 -23
  41. data/spec/rack/jpmobile/iphone_spec.rb +3 -3
  42. data/spec/rack/jpmobile/mobile_by_ua_spec.rb +3 -3
  43. data/spec/rack/jpmobile/params_filter_spec.rb +14 -14
  44. data/spec/rack/jpmobile/softbank_spec.rb +9 -9
  45. data/spec/rack/jpmobile/willcom_spec.rb +6 -6
  46. data/spec/rack/jpmobile/windows_phone.rb +2 -2
  47. data/spec/unit/decorated_mail_spec.rb +1 -1
  48. data/spec/unit/mail_spec.rb +3 -3
  49. data/spec/unit/receive_mail_spec.rb +30 -30
  50. data/spec/unit/util_spec.rb +4 -4
  51. data/spec/unit/valid_ip_spec.rb +1 -1
  52. data/test/rails/overrides/Gemfile.jpmobile +1 -2
  53. data/test/rails/overrides/app/controllers/filter_controller_base.rb +2 -2
  54. data/test/rails/overrides/app/mailers/decorated_mailer.rb +1 -1
  55. data/test/rails/overrides/spec/controllers/mobile_spec_controller_spec.rb +6 -6
  56. data/test/rails/overrides/spec/features/filter_spec.rb +8 -8
  57. data/test/rails/overrides/spec/mailers/mobile_mailer_spec.rb +20 -20
  58. data/test/rails/overrides/spec/rails_helper.rb +1 -1
  59. data/tools/e4u_conv.rb +3 -3
  60. data/tools/generate_emoticon_conversion_table.rb +1 -1
  61. metadata +33 -19
  62. data/test/rails/overrides/Gemfile +0 -54
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 0a59b2d91b6623e62be44818ffad569c1a30bb3f
4
- data.tar.gz: a4737c7bfa0e802747202254c43162022213c3c0
2
+ SHA256:
3
+ metadata.gz: 6a3282bc38e1341f5732641f7fbcb39a45f6067ea93796d9ddf39d17198b8efa
4
+ data.tar.gz: 8ec05a3964dee4fd9a731ff61f38f946ca0a06049dc8d5709a8dec89ea701ff1
5
5
  SHA512:
6
- metadata.gz: 478a46e5f1d336ad58d7cf51605cd51fe11c5e5159b507e7c602d054d2bd953d1939b713b130bae46a5f1425afd921470dcf37e133042d149269a2ec7d614776
7
- data.tar.gz: 40699b70bfb7eeefc58dc071effa2abcafae6484ab0a59adb0f84e793313a8e15e63ef5e24b9ce6d861415f97bbda074ae908ad69e465968e4d2e3a0a100b870
6
+ metadata.gz: cb4b41c43846247d7f2462793925ba8ac7313490f9f019145122c7e0e91d6574b862bcd81ef0d2d44be80e34e58f62c52b776995a0a4df31dc46e2f7d678fdce
7
+ data.tar.gz: 92b5f532f143b28226b949b1cb384d4fc7d382c268ba102ee0700580f0f49ec37f83496b1b5c40f3e87273b2f222c8e3ee2b71d6840099663a50d2c4faa40547
data/.gitignore CHANGED
@@ -15,5 +15,4 @@ rdoc
15
15
  spec/reports
16
16
  test/tmp
17
17
  test/version_tmp
18
- .ruby-version
19
- .envrc
18
+ .envrc
data/.rubocop.yml CHANGED
@@ -7,7 +7,7 @@ inherit_gem:
7
7
  # - "config/rspec.yml"
8
8
 
9
9
  AllCops:
10
- TargetRubyVersion: 2.3
10
+ TargetRubyVersion: 2.4
11
11
  Exclude:
12
12
  - 'bin/bundle'
13
13
  - 'bin/rails'
@@ -38,17 +38,27 @@ Style/BlockDelimiters:
38
38
  - 'lib/jpmobile/mail.rb'
39
39
  EnforcedStyle: braces_for_chaining
40
40
 
41
- Style/IndentationConsistency:
41
+ Layout/IndentationConsistency:
42
42
  EnforcedStyle: normal
43
43
 
44
- Style/AccessorMethodName:
44
+ Naming/AccessorMethodName:
45
45
  Exclude:
46
46
  - 'lib/jpmobile/mail.rb'
47
47
 
48
+ Naming/ConstantName:
49
+ Exclude:
50
+ - 'lib/jpmobile/datum_conv.rb'
51
+
52
+ Naming/MemoizedInstanceVariableName:
53
+ Enabled: false
54
+
48
55
  Style/BlockComments:
49
56
  Exclude:
50
57
  - 'test/rails/overrides/spec/spec_helper.rb'
51
58
 
59
+ Style/FormatStringToken:
60
+ Enabled: false
61
+
52
62
  Metrics/AbcSize:
53
63
  Exclude:
54
64
  - 'lib/jpmobile/datum_conv.rb'
@@ -121,3 +131,7 @@ Lint/HandleExceptions:
121
131
  - 'lib/jpmobile/emoticon.rb'
122
132
  - 'lib/jpmobile/fallback_view_selector.rb'
123
133
  - 'lib/jpmobile/position.rb'
134
+
135
+ Lint/Void:
136
+ Exclude:
137
+ - 'lib/jpmobile/filter.rb'
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.5.1
data/Gemfile CHANGED
@@ -4,3 +4,4 @@ source 'https://rubygems.org'
4
4
  gemspec
5
5
 
6
6
  gem 'onkcop', require: false
7
+ gem 'rubocop', require: false
data/Gemfile.lock CHANGED
@@ -1,181 +1,190 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- jpmobile (5.0.0)
4
+ jpmobile (5.2.0.beta1)
5
+ mail (~> 2.7.0)
5
6
 
6
7
  GEM
7
8
  remote: https://rubygems.org/
8
9
  specs:
9
- actioncable (5.0.3)
10
- actionpack (= 5.0.3)
11
- nio4r (>= 1.2, < 3.0)
12
- websocket-driver (~> 0.6.1)
13
- actionmailer (5.0.3)
14
- actionpack (= 5.0.3)
15
- actionview (= 5.0.3)
16
- activejob (= 5.0.3)
10
+ actioncable (5.2.0)
11
+ actionpack (= 5.2.0)
12
+ nio4r (~> 2.0)
13
+ websocket-driver (>= 0.6.1)
14
+ actionmailer (5.2.0)
15
+ actionpack (= 5.2.0)
16
+ actionview (= 5.2.0)
17
+ activejob (= 5.2.0)
17
18
  mail (~> 2.5, >= 2.5.4)
18
19
  rails-dom-testing (~> 2.0)
19
- actionpack (5.0.3)
20
- actionview (= 5.0.3)
21
- activesupport (= 5.0.3)
20
+ actionpack (5.2.0)
21
+ actionview (= 5.2.0)
22
+ activesupport (= 5.2.0)
22
23
  rack (~> 2.0)
23
- rack-test (~> 0.6.3)
24
+ rack-test (>= 0.6.3)
24
25
  rails-dom-testing (~> 2.0)
25
26
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
26
- actionview (5.0.3)
27
- activesupport (= 5.0.3)
27
+ actionview (5.2.0)
28
+ activesupport (= 5.2.0)
28
29
  builder (~> 3.1)
29
- erubis (~> 2.7.0)
30
+ erubi (~> 1.4)
30
31
  rails-dom-testing (~> 2.0)
31
32
  rails-html-sanitizer (~> 1.0, >= 1.0.3)
32
- activejob (5.0.3)
33
- activesupport (= 5.0.3)
33
+ activejob (5.2.0)
34
+ activesupport (= 5.2.0)
34
35
  globalid (>= 0.3.6)
35
- activemodel (5.0.3)
36
- activesupport (= 5.0.3)
37
- activerecord (5.0.3)
38
- activemodel (= 5.0.3)
39
- activesupport (= 5.0.3)
40
- arel (~> 7.0)
41
- activesupport (5.0.3)
36
+ activemodel (5.2.0)
37
+ activesupport (= 5.2.0)
38
+ activerecord (5.2.0)
39
+ activemodel (= 5.2.0)
40
+ activesupport (= 5.2.0)
41
+ arel (>= 9.0)
42
+ activestorage (5.2.0)
43
+ actionpack (= 5.2.0)
44
+ activerecord (= 5.2.0)
45
+ marcel (~> 0.3.1)
46
+ activesupport (5.2.0)
42
47
  concurrent-ruby (~> 1.0, >= 1.0.2)
43
- i18n (~> 0.7)
48
+ i18n (>= 0.7, < 2)
44
49
  minitest (~> 5.1)
45
50
  tzinfo (~> 1.1)
46
- addressable (2.5.1)
47
- public_suffix (~> 2.0, >= 2.0.2)
48
- arel (7.1.4)
49
- ast (2.3.0)
51
+ addressable (2.5.2)
52
+ public_suffix (>= 2.0.2, < 4.0)
53
+ arel (9.0.0)
54
+ ast (2.4.0)
50
55
  builder (3.2.3)
51
- capybara (2.13.0)
56
+ capybara (3.0.1)
52
57
  addressable
53
- mime-types (>= 1.16)
54
- nokogiri (>= 1.3.3)
55
- rack (>= 1.0.0)
56
- rack-test (>= 0.5.4)
57
- xpath (~> 2.0)
58
- capybara-webkit (1.14.0)
59
- capybara (>= 2.3.0, < 2.14.0)
58
+ mini_mime (>= 0.1.3)
59
+ nokogiri (~> 1.8)
60
+ rack (>= 1.6.0)
61
+ rack-test (>= 0.6.3)
62
+ xpath (~> 3.0)
63
+ capybara-webkit (1.15.0)
64
+ capybara (>= 2.3, < 4.0)
60
65
  json
61
- coderay (1.1.1)
66
+ coderay (1.1.2)
62
67
  concurrent-ruby (1.0.5)
68
+ crass (1.0.4)
63
69
  diff-lcs (1.3)
64
- erubis (2.7.0)
70
+ erubi (1.7.1)
65
71
  geokit (1.11.0)
66
72
  git (1.3.0)
67
- globalid (0.4.0)
73
+ globalid (0.4.1)
68
74
  activesupport (>= 4.2.0)
69
75
  hpricot (0.8.6)
70
- i18n (0.8.1)
76
+ i18n (1.0.0)
77
+ concurrent-ruby (~> 1.0)
71
78
  json (2.1.0)
72
- loofah (2.0.3)
79
+ loofah (2.2.2)
80
+ crass (~> 1.0.2)
73
81
  nokogiri (>= 1.5.9)
74
- mail (2.6.5)
75
- mime-types (>= 1.16, < 4)
76
- method_source (0.8.2)
77
- mime-types (3.1)
78
- mime-types-data (~> 3.2015)
79
- mime-types-data (3.2016.0521)
80
- mini_portile2 (2.1.0)
81
- minitest (5.10.2)
82
- nio4r (2.0.0)
83
- nokogiri (1.7.2)
84
- mini_portile2 (~> 2.1.0)
85
- onkcop (0.48.1.1)
86
- rubocop (~> 0.48.1)
87
- rubocop-rspec (>= 1.15.0)
88
- parser (2.4.0.0)
89
- ast (~> 2.2)
82
+ mail (2.7.0)
83
+ mini_mime (>= 0.1.1)
84
+ marcel (0.3.2)
85
+ mimemagic (~> 0.3.2)
86
+ method_source (0.9.0)
87
+ mimemagic (0.3.2)
88
+ mini_mime (1.0.0)
89
+ mini_portile2 (2.3.0)
90
+ minitest (5.11.3)
91
+ nio4r (2.3.0)
92
+ nokogiri (1.8.2)
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)
90
100
  powerpack (0.1.1)
91
- pry (0.10.4)
101
+ pry (0.11.3)
92
102
  coderay (~> 1.1.0)
93
- method_source (~> 0.8.1)
94
- slop (~> 3.4)
95
- public_suffix (2.0.5)
96
- rack (2.0.2)
97
- rack-test (0.6.3)
98
- rack (>= 1.0)
99
- rails (5.0.3)
100
- actioncable (= 5.0.3)
101
- actionmailer (= 5.0.3)
102
- actionpack (= 5.0.3)
103
- actionview (= 5.0.3)
104
- activejob (= 5.0.3)
105
- activemodel (= 5.0.3)
106
- activerecord (= 5.0.3)
107
- activesupport (= 5.0.3)
108
- bundler (>= 1.3.0, < 2.0)
109
- railties (= 5.0.3)
103
+ method_source (~> 0.9.0)
104
+ public_suffix (3.0.2)
105
+ rack (2.0.4)
106
+ rack-test (1.0.0)
107
+ rack (>= 1.0, < 3)
108
+ rails (5.2.0)
109
+ actioncable (= 5.2.0)
110
+ actionmailer (= 5.2.0)
111
+ actionpack (= 5.2.0)
112
+ actionview (= 5.2.0)
113
+ activejob (= 5.2.0)
114
+ activemodel (= 5.2.0)
115
+ activerecord (= 5.2.0)
116
+ activestorage (= 5.2.0)
117
+ activesupport (= 5.2.0)
118
+ bundler (>= 1.3.0)
119
+ railties (= 5.2.0)
110
120
  sprockets-rails (>= 2.0.0)
111
121
  rails-dom-testing (2.0.3)
112
122
  activesupport (>= 4.2.0)
113
123
  nokogiri (>= 1.6)
114
- rails-html-sanitizer (1.0.3)
115
- loofah (~> 2.0)
116
- railties (5.0.3)
117
- actionpack (= 5.0.3)
118
- activesupport (= 5.0.3)
124
+ rails-html-sanitizer (1.0.4)
125
+ loofah (~> 2.2, >= 2.2.2)
126
+ railties (5.2.0)
127
+ actionpack (= 5.2.0)
128
+ activesupport (= 5.2.0)
119
129
  method_source
120
130
  rake (>= 0.8.7)
121
131
  thor (>= 0.18.1, < 2.0)
122
- rainbow (2.2.2)
123
- rake
124
- rake (12.0.0)
125
- rspec (3.6.0)
126
- rspec-core (~> 3.6.0)
127
- rspec-expectations (~> 3.6.0)
128
- rspec-mocks (~> 3.6.0)
129
- rspec-core (3.6.0)
130
- rspec-support (~> 3.6.0)
131
- rspec-expectations (3.6.0)
132
+ 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)
132
141
  diff-lcs (>= 1.2.0, < 2.0)
133
- rspec-support (~> 3.6.0)
142
+ rspec-support (~> 3.7.0)
134
143
  rspec-its (1.2.0)
135
144
  rspec-core (>= 3.0.0)
136
145
  rspec-expectations (>= 3.0.0)
137
- rspec-mocks (3.6.0)
146
+ rspec-mocks (3.7.0)
138
147
  diff-lcs (>= 1.2.0, < 2.0)
139
- rspec-support (~> 3.6.0)
140
- rspec-rails (3.6.0)
148
+ rspec-support (~> 3.7.0)
149
+ rspec-rails (3.7.2)
141
150
  actionpack (>= 3.0)
142
151
  activesupport (>= 3.0)
143
152
  railties (>= 3.0)
144
- rspec-core (~> 3.6.0)
145
- rspec-expectations (~> 3.6.0)
146
- rspec-mocks (~> 3.6.0)
147
- rspec-support (~> 3.6.0)
148
- rspec-support (3.6.0)
149
- rubocop (0.48.1)
150
- parser (>= 2.3.3.1, < 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)
159
+ parallel (~> 1.10)
160
+ parser (>= 2.5)
151
161
  powerpack (~> 0.1)
152
- rainbow (>= 1.99.1, < 3.0)
162
+ rainbow (>= 2.2.2, < 4.0)
153
163
  ruby-progressbar (~> 1.7)
154
164
  unicode-display_width (~> 1.0, >= 1.0.1)
155
- rubocop-rspec (1.15.1)
156
- rubocop (>= 0.42.0)
157
- ruby-progressbar (1.8.1)
158
- slop (3.6.0)
165
+ rubocop-rspec (1.25.0)
166
+ rubocop (>= 0.53.0)
167
+ ruby-progressbar (1.9.0)
159
168
  sprockets (3.7.1)
160
169
  concurrent-ruby (~> 1.0)
161
170
  rack (> 1, < 3)
162
- sprockets-rails (3.2.0)
171
+ sprockets-rails (3.2.1)
163
172
  actionpack (>= 4.0)
164
173
  activesupport (>= 4.0)
165
174
  sprockets (>= 3.0.0)
166
175
  sqlite3 (1.3.13)
167
176
  sqlite3-ruby (1.3.3)
168
177
  sqlite3 (>= 1.3.3)
169
- thor (0.19.4)
178
+ thor (0.20.0)
170
179
  thread_safe (0.3.6)
171
- tzinfo (1.2.3)
180
+ tzinfo (1.2.5)
172
181
  thread_safe (~> 0.1)
173
- unicode-display_width (1.2.1)
174
- websocket-driver (0.6.5)
182
+ unicode-display_width (1.3.0)
183
+ websocket-driver (0.7.0)
175
184
  websocket-extensions (>= 0.1.0)
176
- websocket-extensions (0.1.2)
177
- xpath (2.0.0)
178
- nokogiri (~> 1.3)
185
+ websocket-extensions (0.1.3)
186
+ xpath (3.0.0)
187
+ nokogiri (~> 1.8)
179
188
 
180
189
  PLATFORMS
181
190
  ruby
@@ -188,11 +197,12 @@ DEPENDENCIES
188
197
  jpmobile!
189
198
  onkcop
190
199
  pry
191
- rails (~> 5.0.0)
200
+ rails (~> 5.2.0)
192
201
  rspec
193
202
  rspec-its
194
203
  rspec-rails
204
+ rubocop
195
205
  sqlite3-ruby
196
206
 
197
207
  BUNDLED WITH
198
- 1.14.6
208
+ 1.16.1
data/Rakefile CHANGED
@@ -3,7 +3,6 @@ require 'rake/testtask'
3
3
  require 'fileutils'
4
4
  require 'pathname'
5
5
  require 'git'
6
- include FileUtils
7
6
 
8
7
  desc 'Default: run unit tests.'
9
8
  task :default => :test
data/circle.yml CHANGED
@@ -2,7 +2,7 @@ machine:
2
2
  timezone:
3
3
  Asia/Tokyo
4
4
  ruby:
5
- version: 2.4.0
5
+ version: 2.4.2
6
6
 
7
7
  database:
8
8
  override:
data/jpmobile.gemspec CHANGED
@@ -1,4 +1,4 @@
1
- lib = File.expand_path('../lib', __FILE__)
1
+ lib = File.expand_path('lib', __dir__)
2
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
  require 'jpmobile/version'
4
4
 
@@ -10,19 +10,21 @@ Gem::Specification.new do |gem|
10
10
  gem.description = 'A Rails plugin for mobile devices in Japan'
11
11
  gem.summary = 'Rails plugin for mobile devices in Japan'
12
12
  gem.homepage = 'http://jpmobile-rails.org'
13
+ gem.license = 'MIT'
13
14
 
14
15
  gem.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
15
16
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
16
17
  gem.require_paths = ['lib']
17
18
 
18
- gem.add_development_dependency 'rails', '~> 5.0.0'
19
- gem.add_development_dependency 'rspec'
20
- gem.add_development_dependency 'rspec-rails'
21
- gem.add_development_dependency 'rspec-its'
19
+ gem.add_dependency 'mail', '~> 2.7.0'
22
20
  gem.add_development_dependency 'capybara-webkit'
23
21
  gem.add_development_dependency 'geokit'
24
- gem.add_development_dependency 'sqlite3-ruby'
25
- gem.add_development_dependency 'hpricot'
26
22
  gem.add_development_dependency 'git'
23
+ gem.add_development_dependency 'hpricot'
27
24
  gem.add_development_dependency 'pry'
25
+ gem.add_development_dependency 'rails', '~> 5.2.0'
26
+ gem.add_development_dependency 'rspec'
27
+ gem.add_development_dependency 'rspec-its'
28
+ gem.add_development_dependency 'rspec-rails'
29
+ gem.add_development_dependency 'sqlite3-ruby'
28
30
  end
@@ -17,6 +17,7 @@ module Jpmobile::DocomoGuid #:nodoc:
17
17
  result = super || {}
18
18
  return result unless request # for test process
19
19
  return result unless apply_add_guid?
20
+
20
21
  result.merge({ guid: 'ON' })
21
22
  end
22
23
 
@@ -48,7 +48,7 @@ module Jpmobile
48
48
  def convertable?(content_type)
49
49
  if converting_content_type.respond_to?(:each)
50
50
  converting_content_type.each do |c|
51
- return true if content_type.match(c)
51
+ return true if content_type.match?(c)
52
52
  end
53
53
  end
54
54
 
@@ -9,37 +9,37 @@ module Jpmobile
9
9
  # for au email
10
10
  SJIS_TO_EMAIL_JIS = { 0x81ac => 0x222E }.update(AU_SJIS_TO_EMAIL_JIS).freeze
11
11
 
12
- SJIS_REGEXP = Regexp.union(*SJIS_TO_UNICODE.keys.map { |s| Jpmobile::Util.sjis_regexp(s) })
13
- SOFTBANK_WEBCODE_REGEXP = Regexp.union(*([/(?!)/n] + SOFTBANK_WEBCODE_TO_UNICODE.keys.map { |x| "\x1b\x24#{x}\x0f" }))
12
+ SJIS_REGEXP = Regexp.union(*SJIS_TO_UNICODE.keys.map {|s| Jpmobile::Util.sjis_regexp(s) })
13
+ SOFTBANK_WEBCODE_REGEXP = Regexp.union(*([/(?!)/n] + SOFTBANK_WEBCODE_TO_UNICODE.keys.map {|x| "\x1b\x24#{x}\x0f" }))
14
14
 
15
- DOCOMO_SJIS_REGEXP = Regexp.union(*DOCOMO_SJIS_TO_UNICODE.keys.map { |s| Jpmobile::Util.sjis_regexp(s) })
16
- AU_SJIS_REGEXP = Regexp.union(*AU_SJIS_TO_UNICODE.keys.map { |s| Jpmobile::Util.sjis_regexp(s) })
17
- SOFTBANK_UNICODE_REGEXP = Regexp.union(*SOFTBANK_UNICODE_TO_WEBCODE.keys.map { |x| [x].pack('U') }).freeze
15
+ DOCOMO_SJIS_REGEXP = Regexp.union(*DOCOMO_SJIS_TO_UNICODE.keys.map {|s| Jpmobile::Util.sjis_regexp(s) })
16
+ AU_SJIS_REGEXP = Regexp.union(*AU_SJIS_TO_UNICODE.keys.map {|s| Jpmobile::Util.sjis_regexp(s) })
17
+ SOFTBANK_UNICODE_REGEXP = Regexp.union(*SOFTBANK_UNICODE_TO_WEBCODE.keys.map {|x| [x].pack('U') }).freeze
18
18
 
19
- EMOTICON_UNICODES = UNICODE_TO_SJIS.keys | SOFTBANK_UNICODE_TO_WEBCODE.keys.map { |k| k + 0x1000 }
20
- UTF8_REGEXP = Regexp.union(*EMOTICON_UNICODES.map { |x| [x].pack('U') }).freeze
19
+ EMOTICON_UNICODES = UNICODE_TO_SJIS.keys | SOFTBANK_UNICODE_TO_WEBCODE.keys.map {|k| k + 0x1000 }
20
+ UTF8_REGEXP = Regexp.union(*EMOTICON_UNICODES.map {|x| [x].pack('U') }).freeze
21
21
 
22
22
  # for PC conversion "GETA"
23
- CONVERSION_TABLE_TO_PC_EMAIL = Hash[*(CONVERSION_TABLE_TO_SOFTBANK.keys | CONVERSION_TABLE_TO_DOCOMO.keys | CONVERSION_TABLE_TO_AU.keys).map { |k| [k, GETA] }.flatten]
23
+ CONVERSION_TABLE_TO_PC_EMAIL = Hash[*(CONVERSION_TABLE_TO_SOFTBANK.keys | CONVERSION_TABLE_TO_DOCOMO.keys | CONVERSION_TABLE_TO_AU.keys).map {|k| [k, GETA] }.flatten]
24
24
 
25
- SOFTBANK_SJIS_REGEXP = Regexp.union(*SOFTBANK_SJIS_TO_UNICODE.keys.map { |s| Jpmobile::Util.sjis_regexp(s) }).freeze
26
- AU_EMAILJIS_REGEXP = Regexp.union(*AU_EMAILJIS_TO_UNICODE.keys.map { |s| Jpmobile::Util.jis_regexp(s) })
25
+ SOFTBANK_SJIS_REGEXP = Regexp.union(*SOFTBANK_SJIS_TO_UNICODE.keys.map {|s| Jpmobile::Util.sjis_regexp(s) }).freeze
26
+ AU_EMAILJIS_REGEXP = Regexp.union(*AU_EMAILJIS_TO_UNICODE.keys.map {|s| Jpmobile::Util.jis_regexp(s) })
27
27
 
28
28
  # for unicode/google emoticons
29
29
  UNICODE_EMOTICONS = (UNICODE_TO_DOCOMO_UNICODE.keys | UNICODE_TO_AU_UNICODE.keys | UNICODE_TO_SOFTBANK_UNICODE.keys).uniq
30
30
  GOOGLE_EMOTICONS = (GOOGLE_TO_DOCOMO_UNICODE.keys | GOOGLE_TO_AU_UNICODE.keys | GOOGLE_TO_SOFTBANK_UNICODE.keys).uniq
31
31
 
32
- UNICODE_EMOTICON_REGEXP = Regexp.union(*UNICODE_EMOTICONS.map { |x| x.is_a?(Array) ? x.pack('UU') : [x].pack('U') }).freeze
33
- GOOGLE_EMOTICON_REGEXP = Regexp.union(*GOOGLE_EMOTICONS.map { |x| x.is_a?(Array) ? x.pack('UU') : [x].pack('U') }).freeze
32
+ UNICODE_EMOTICON_REGEXP = Regexp.union(*UNICODE_EMOTICONS.map {|x| x.is_a?(Array) ? x.pack('UU') : [x].pack('U') }).freeze
33
+ GOOGLE_EMOTICON_REGEXP = Regexp.union(*GOOGLE_EMOTICONS.map {|x| x.is_a?(Array) ? x.pack('UU') : [x].pack('U') }).freeze
34
34
 
35
35
  UNICODE_EMOTICON_TO_CARRIER_EMOTICON = UNICODE_TO_DOCOMO_UNICODE.merge(UNICODE_TO_AU_UNICODE.merge(UNICODE_TO_SOFTBANK_UNICODE))
36
36
  GOOGLE_EMOTICON_TO_CARRIER_EMOTICON = GOOGLE_TO_SOFTBANK_UNICODE.merge(GOOGLE_TO_AU_UNICODE.merge(GOOGLE_TO_DOCOMO_UNICODE))
37
37
 
38
38
  CONVERSION_TABLE_TO_UNICODE_EMOTICON = Jpmobile::Util.invert_table(UNICODE_TO_DOCOMO_UNICODE).merge(
39
- Jpmobile::Util.invert_table(UNICODE_TO_AU_UNICODE).merge(Jpmobile::Util.invert_table(UNICODE_TO_SOFTBANK_UNICODE))
39
+ Jpmobile::Util.invert_table(UNICODE_TO_AU_UNICODE).merge(Jpmobile::Util.invert_table(UNICODE_TO_SOFTBANK_UNICODE)),
40
40
  )
41
41
  CONVERSION_TABLE_TO_GOOGLE_EMOTICON = Jpmobile::Util.invert_table(GOOGLE_TO_SOFTBANK_UNICODE).merge(
42
- Jpmobile::Util.invert_table(GOOGLE_TO_AU_UNICODE).merge(Jpmobile::Util.invert_table(GOOGLE_TO_DOCOMO_UNICODE))
42
+ Jpmobile::Util.invert_table(GOOGLE_TO_AU_UNICODE).merge(Jpmobile::Util.invert_table(GOOGLE_TO_DOCOMO_UNICODE)),
43
43
  )
44
44
  end
45
45
  end
@@ -181,7 +181,7 @@ module Jpmobile
181
181
  end
182
182
  when String
183
183
  # 変換先が数値参照だと、再変換する
184
- if converted =~ /&#x([0-9a-f]{4});/i
184
+ if converted.match?(/&#x([0-9a-f]{4});/i)
185
185
  self.unicodecr_to_external(converted, conversion_table, to_sjis)
186
186
  else
187
187
  # 変換先が文字列で指定されている。
@@ -294,8 +294,8 @@ module Jpmobile
294
294
 
295
295
  begin
296
296
  yaml_hash = YAML.load_file(@pc_emoticon_yaml)
297
- @pc_emoticon_hash = Hash[*(yaml_hash.values.inject([]) { |r, v| r += v.to_a.flatten; r })]
298
- @pc_emoticon_image_path.chop if @pc_emoticon_image_path =~ %r{/$}
297
+ @pc_emoticon_hash = Hash[*(yaml_hash.values.inject([]) {|r, v| r += v.to_a.flatten; r })]
298
+ @pc_emoticon_image_path.chop if @pc_emoticon_image_path.match?(%r{/$})
299
299
 
300
300
  return true
301
301
  rescue
@@ -8,7 +8,7 @@ module Jpmobile
8
8
  begin
9
9
  expected_view_file = lookup_context.find_template(options[:template], options[:prefixes])
10
10
 
11
- _candidates = lookup_context.mobile.map { |variant|
11
+ _candidates = lookup_context.mobile.map {|variant|
12
12
  target_template = options[:template] + '_' + variant
13
13
  expected_view_file.virtual_path.match(target_template)
14
14
  }.compact