jpmobile 6.1.2 → 7.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +8 -3
  3. data/.rubocop.yml +1 -1
  4. data/.ruby-version +1 -1
  5. data/Gemfile +2 -0
  6. data/Gemfile.lock +119 -138
  7. data/README.md +3 -18
  8. data/jpmobile.gemspec +3 -4
  9. data/lib/jpmobile/docomo_guid.rb +2 -2
  10. data/lib/jpmobile/hook_action_view.rb +3 -3
  11. data/lib/jpmobile/hook_template_details_requested.rb +12 -0
  12. data/lib/jpmobile/mailer.rb +1 -1
  13. data/lib/jpmobile/mobile/android.rb +1 -1
  14. data/lib/jpmobile/mobile/android_tablet.rb +1 -1
  15. data/lib/jpmobile/mobile/au.rb +2 -2
  16. data/lib/jpmobile/mobile/black_berry.rb +1 -1
  17. data/lib/jpmobile/mobile/ddipocket.rb +1 -1
  18. data/lib/jpmobile/mobile/docomo.rb +2 -2
  19. data/lib/jpmobile/mobile/emobile.rb +2 -2
  20. data/lib/jpmobile/mobile/ipad.rb +1 -1
  21. data/lib/jpmobile/mobile/iphone.rb +1 -1
  22. data/lib/jpmobile/mobile/softbank.rb +2 -2
  23. data/lib/jpmobile/mobile/vodafone.rb +2 -2
  24. data/lib/jpmobile/mobile/willcom.rb +2 -2
  25. data/lib/jpmobile/mobile/windows_phone.rb +1 -1
  26. data/lib/jpmobile/path_set.rb +10 -36
  27. data/lib/jpmobile/rails.rb +2 -0
  28. data/lib/jpmobile/resolver.rb +44 -6
  29. data/lib/jpmobile/template_details.rb +38 -0
  30. data/lib/jpmobile/trans_sid.rb +1 -1
  31. data/lib/jpmobile/util.rb +1 -1
  32. data/lib/jpmobile/version.rb +1 -1
  33. data/lib/jpmobile/view_selector.rb +5 -6
  34. data/lib/jpmobile.rb +13 -0
  35. data/lib/tasks/jpmobile_tasks.rake +2 -1
  36. data/spec/rack/jpmobile/mobile_by_ua_spec.rb +1 -0
  37. data/test/rails/overrides/Gemfile.jpmobile +4 -0
  38. data/test/rails/overrides/app/controllers/mobile_spec_controller.rb +1 -1
  39. data/test/rails/overrides/app/controllers/template_path_controller.rb +3 -0
  40. data/test/rails/overrides/app/views/mobile_spec/mobile_not_exist.html.erb +3 -0
  41. data/test/rails/overrides/config/routes.rb +1 -1
  42. data/test/rails/overrides/spec/controllers/mobile_spec_controller_spec.rb +3 -3
  43. data/test/rails/overrides/spec/rails_helper.rb +1 -1
  44. data/test/rails/overrides/spec/requests/filter_spec.rb +106 -0
  45. data/test/rails/overrides/spec/requests/template_path_spec.rb +1 -1
  46. data/test/rails/overrides/spec/{features → system}/admin/top_spec.rb +2 -2
  47. data/test/rails/overrides/spec/{features → system}/filter_spec.rb +2 -7
  48. data/test/rails/overrides/spec/system/support/cuprite_setup.rb +14 -0
  49. data/test/rails/overrides/spec/system_helper.rb +3 -0
  50. metadata +23 -29
  51. data/test/rails/overrides/app/views/mobile_spec/no_mobile.html.erb +0 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 74fa7416fa00515953a733795e73ec1e6588661679d75a1976679c1d504ffcf4
4
- data.tar.gz: c5bbfb870db11b2040e7c6071224f15814666205af7d6ab7753d6420f0f1857c
3
+ metadata.gz: 23fd23b1c3355357f297fbfbcd1ccd9bd673a7cd32ac0de550ed5222b9cbe2d1
4
+ data.tar.gz: f2432b9a47332debe6dde7bb42b5dc175a6ffa7c0ac70f80ca40ab3a4613a1f8
5
5
  SHA512:
6
- metadata.gz: 1c02221b79367bacdd03b7a9c996a1c13b924f075425e7cefdf92673a7accf790c9ec5b957892f2cbaad040ca5c9feeef19e7f6aa90b6d0ae3a175bb4a1adaeb
7
- data.tar.gz: 5ac93c588bc456034de7e1a0dc2d59775a4161ffd9d65046e1e52582d219f9cd17a2ca76b666adcba5243ef6da66379e85aaa00ceac4ad4921a63c991e4d834b
6
+ metadata.gz: 57bf348d59ec1f6b520d363a1b5e8b798a033c10a75d88ca88c8b8539530b436a9711a9882571f21371e1c547654c92c16db1ac50fae9164f4cd0a818b19d262
7
+ data.tar.gz: 86b3585c886a0e4ba2a5a94f736b45d3adc8c4c2924572acc477986d8cecb8edf34eed5e06c3fbb2a4f071f2c7f431b9f7e3d5cb1f4f29cb680b5a42d2be2c8b
data/.circleci/config.yml CHANGED
@@ -1,21 +1,26 @@
1
- version: 2
1
+ version: 2.1
2
+ orbs:
3
+ browser-tools: circleci/browser-tools@1.1
2
4
  jobs:
3
5
  test-job:
4
6
  working_directory: ~/jpmobile
5
7
  docker:
6
- - image: circleci/ruby:2.7-node-browsers
8
+ - image: cimg/ruby:3.0-browsers
7
9
  environment:
8
10
  BUNDLE_JOBS: 3
9
11
  BUNDLE_RETRY: 3
10
12
  BUNDLE_PATH: vendor/bundle
11
13
  RAILS_ENV: test
12
14
  steps:
15
+ - browser-tools/install-browser-tools
13
16
  - checkout
14
17
 
15
18
  # Install dependent packages
16
19
  - run:
17
20
  name: Install dependent packages
18
- command: sudo apt-get install -y cmake qt5-default libqt5webkit5-dev gstreamer1.0-plugins-base gstreamer1.0-tools gstreamer1.0-x
21
+ command: |
22
+ sudo apt update
23
+ sudo apt install -y cmake libsqlite3-dev
19
24
 
20
25
  # Which version of bundler?
21
26
  - run:
data/.rubocop.yml CHANGED
@@ -3,7 +3,7 @@ require: rubocop-performance
3
3
  inherit_from: './.onkcop-config.yml'
4
4
 
5
5
  AllCops:
6
- TargetRubyVersion: 2.5
6
+ TargetRubyVersion: 3.0
7
7
  Exclude:
8
8
  - 'tmp/**/*'
9
9
  - 'bin/*'
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.7.2
1
+ 3.0.3
data/Gemfile CHANGED
@@ -5,3 +5,5 @@ gemspec
5
5
 
6
6
  gem 'rubocop', require: false
7
7
  gem 'rubocop-performance', require: false
8
+ gem 'rubocop-rails', require: false
9
+ gem 'rubocop-rspec', require: false
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- jpmobile (6.1.1)
4
+ jpmobile (6.1.2)
5
5
  mail (~> 2.7.0)
6
6
  rexml
7
7
  scanf
@@ -9,228 +9,209 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- actioncable (6.1.0)
13
- actionpack (= 6.1.0)
14
- activesupport (= 6.1.0)
12
+ actioncable (7.0.0)
13
+ actionpack (= 7.0.0)
14
+ activesupport (= 7.0.0)
15
15
  nio4r (~> 2.0)
16
16
  websocket-driver (>= 0.6.1)
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)
17
+ actionmailbox (7.0.0)
18
+ actionpack (= 7.0.0)
19
+ activejob (= 7.0.0)
20
+ activerecord (= 7.0.0)
21
+ activestorage (= 7.0.0)
22
+ activesupport (= 7.0.0)
23
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)
24
+ actionmailer (7.0.0)
25
+ actionpack (= 7.0.0)
26
+ actionview (= 7.0.0)
27
+ activejob (= 7.0.0)
28
+ activesupport (= 7.0.0)
29
29
  mail (~> 2.5, >= 2.5.4)
30
30
  rails-dom-testing (~> 2.0)
31
- actionpack (6.1.0)
32
- actionview (= 6.1.0)
33
- activesupport (= 6.1.0)
34
- rack (~> 2.0, >= 2.0.9)
31
+ actionpack (7.0.0)
32
+ actionview (= 7.0.0)
33
+ activesupport (= 7.0.0)
34
+ rack (~> 2.0, >= 2.2.0)
35
35
  rack-test (>= 0.6.3)
36
36
  rails-dom-testing (~> 2.0)
37
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)
38
+ actiontext (7.0.0)
39
+ actionpack (= 7.0.0)
40
+ activerecord (= 7.0.0)
41
+ activestorage (= 7.0.0)
42
+ activesupport (= 7.0.0)
43
+ globalid (>= 0.6.0)
43
44
  nokogiri (>= 1.8.5)
44
- actionview (6.1.0)
45
- activesupport (= 6.1.0)
45
+ actionview (7.0.0)
46
+ activesupport (= 7.0.0)
46
47
  builder (~> 3.1)
47
48
  erubi (~> 1.4)
48
49
  rails-dom-testing (~> 2.0)
49
50
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
50
- activejob (6.1.0)
51
- activesupport (= 6.1.0)
51
+ activejob (7.0.0)
52
+ activesupport (= 7.0.0)
52
53
  globalid (>= 0.3.6)
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)
63
- marcel (~> 0.3.1)
64
- mimemagic (~> 0.3.2)
65
- activesupport (6.1.0)
54
+ activemodel (7.0.0)
55
+ activesupport (= 7.0.0)
56
+ activerecord (7.0.0)
57
+ activemodel (= 7.0.0)
58
+ activesupport (= 7.0.0)
59
+ activestorage (7.0.0)
60
+ actionpack (= 7.0.0)
61
+ activejob (= 7.0.0)
62
+ activerecord (= 7.0.0)
63
+ activesupport (= 7.0.0)
64
+ marcel (~> 1.0)
65
+ mini_mime (>= 1.1.0)
66
+ activesupport (7.0.0)
66
67
  concurrent-ruby (~> 1.0, >= 1.0.2)
67
68
  i18n (>= 1.6, < 2)
68
69
  minitest (>= 5.1)
69
70
  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)
71
+ ast (2.4.2)
74
72
  builder (3.2.4)
75
- capybara (3.34.0)
76
- addressable
77
- mini_mime (>= 0.1.3)
78
- nokogiri (~> 1.8)
79
- rack (>= 1.6.0)
80
- rack-test (>= 0.6.3)
81
- regexp_parser (~> 1.5)
82
- xpath (~> 3.2)
83
- capybara-webkit (1.15.1)
84
- capybara (>= 2.3, < 4.0)
85
- json
86
73
  coderay (1.1.3)
87
- concurrent-ruby (1.1.7)
74
+ concurrent-ruby (1.1.9)
88
75
  crass (1.0.6)
89
76
  diff-lcs (1.4.4)
90
77
  erubi (1.10.0)
91
78
  geokit (1.13.1)
92
- git (1.7.0)
79
+ git (1.9.1)
93
80
  rchardet (~> 1.8)
94
- globalid (0.4.2)
95
- activesupport (>= 4.2.0)
81
+ globalid (1.0.0)
82
+ activesupport (>= 5.0)
96
83
  hpricot (0.8.6)
97
- i18n (1.8.5)
84
+ i18n (1.8.11)
98
85
  concurrent-ruby (~> 1.0)
99
- json (2.3.1)
100
- loofah (2.8.0)
86
+ loofah (2.13.0)
101
87
  crass (~> 1.0.2)
102
88
  nokogiri (>= 1.5.9)
103
89
  mail (2.7.1)
104
90
  mini_mime (>= 0.1.1)
105
- marcel (0.3.3)
106
- mimemagic (~> 0.3.2)
91
+ marcel (1.0.2)
107
92
  method_source (1.0.0)
108
- mimemagic (0.3.5)
109
- mini_mime (1.0.2)
110
- mini_portile2 (2.4.0)
111
- minitest (5.14.2)
112
- nio4r (2.5.4)
113
- nokogiri (1.10.10)
114
- mini_portile2 (~> 2.4.0)
115
- parallel (1.20.1)
116
- parser (3.0.0.0)
93
+ mini_mime (1.1.2)
94
+ minitest (5.15.0)
95
+ nio4r (2.5.8)
96
+ nokogiri (1.12.5-arm64-darwin)
97
+ racc (~> 1.4)
98
+ parallel (1.21.0)
99
+ parser (3.0.3.2)
117
100
  ast (~> 2.4.1)
118
- pry (0.13.1)
101
+ pry (0.14.1)
119
102
  coderay (~> 1.1)
120
103
  method_source (~> 1.0)
121
- public_suffix (4.0.6)
104
+ racc (1.6.0)
122
105
  rack (2.2.3)
123
106
  rack-test (1.1.0)
124
107
  rack (>= 1.0, < 3)
125
- rails (6.1.0)
126
- actioncable (= 6.1.0)
127
- actionmailbox (= 6.1.0)
128
- actionmailer (= 6.1.0)
129
- actionpack (= 6.1.0)
130
- actiontext (= 6.1.0)
131
- actionview (= 6.1.0)
132
- activejob (= 6.1.0)
133
- activemodel (= 6.1.0)
134
- activerecord (= 6.1.0)
135
- activestorage (= 6.1.0)
136
- activesupport (= 6.1.0)
108
+ rails (7.0.0)
109
+ actioncable (= 7.0.0)
110
+ actionmailbox (= 7.0.0)
111
+ actionmailer (= 7.0.0)
112
+ actionpack (= 7.0.0)
113
+ actiontext (= 7.0.0)
114
+ actionview (= 7.0.0)
115
+ activejob (= 7.0.0)
116
+ activemodel (= 7.0.0)
117
+ activerecord (= 7.0.0)
118
+ activestorage (= 7.0.0)
119
+ activesupport (= 7.0.0)
137
120
  bundler (>= 1.15.0)
138
- railties (= 6.1.0)
139
- sprockets-rails (>= 2.0.0)
121
+ railties (= 7.0.0)
140
122
  rails-dom-testing (2.0.3)
141
123
  activesupport (>= 4.2.0)
142
124
  nokogiri (>= 1.6)
143
- rails-html-sanitizer (1.3.0)
125
+ rails-html-sanitizer (1.4.2)
144
126
  loofah (~> 2.3)
145
- railties (6.1.0)
146
- actionpack (= 6.1.0)
147
- activesupport (= 6.1.0)
127
+ railties (7.0.0)
128
+ actionpack (= 7.0.0)
129
+ activesupport (= 7.0.0)
148
130
  method_source
149
- rake (>= 0.8.7)
131
+ rake (>= 12.2)
150
132
  thor (~> 1.0)
133
+ zeitwerk (~> 2.5)
151
134
  rainbow (3.0.0)
152
- rake (13.0.1)
135
+ rake (13.0.6)
153
136
  rchardet (1.8.0)
154
- regexp_parser (1.8.2)
155
- rexml (3.2.4)
137
+ regexp_parser (2.2.0)
138
+ rexml (3.2.5)
156
139
  rspec (3.10.0)
157
140
  rspec-core (~> 3.10.0)
158
141
  rspec-expectations (~> 3.10.0)
159
142
  rspec-mocks (~> 3.10.0)
160
- rspec-core (3.10.0)
143
+ rspec-core (3.10.1)
161
144
  rspec-support (~> 3.10.0)
162
- rspec-expectations (3.10.0)
145
+ rspec-expectations (3.10.1)
163
146
  diff-lcs (>= 1.2.0, < 2.0)
164
147
  rspec-support (~> 3.10.0)
165
148
  rspec-its (1.3.0)
166
149
  rspec-core (>= 3.0.0)
167
150
  rspec-expectations (>= 3.0.0)
168
- rspec-mocks (3.10.0)
151
+ rspec-mocks (3.10.2)
169
152
  diff-lcs (>= 1.2.0, < 2.0)
170
153
  rspec-support (~> 3.10.0)
171
- rspec-rails (4.0.1)
172
- actionpack (>= 4.2)
173
- activesupport (>= 4.2)
174
- railties (>= 4.2)
175
- rspec-core (~> 3.9)
176
- rspec-expectations (~> 3.9)
177
- rspec-mocks (~> 3.9)
178
- rspec-support (~> 3.9)
179
- rspec-support (3.10.0)
180
- rubocop (1.7.0)
154
+ rspec-rails (5.0.2)
155
+ actionpack (>= 5.2)
156
+ activesupport (>= 5.2)
157
+ railties (>= 5.2)
158
+ rspec-core (~> 3.10)
159
+ rspec-expectations (~> 3.10)
160
+ rspec-mocks (~> 3.10)
161
+ rspec-support (~> 3.10)
162
+ rspec-support (3.10.3)
163
+ rubocop (1.23.0)
181
164
  parallel (~> 1.10)
182
- parser (>= 2.7.1.5)
165
+ parser (>= 3.0.0.0)
183
166
  rainbow (>= 2.2.2, < 4.0)
184
167
  regexp_parser (>= 1.8, < 3.0)
185
168
  rexml
186
- rubocop-ast (>= 1.2.0, < 2.0)
169
+ rubocop-ast (>= 1.12.0, < 2.0)
187
170
  ruby-progressbar (~> 1.7)
188
- unicode-display_width (>= 1.4.0, < 2.0)
189
- rubocop-ast (1.3.0)
190
- parser (>= 2.7.1.5)
191
- rubocop-performance (1.5.2)
192
- rubocop (>= 0.71.0)
193
- ruby-progressbar (1.10.1)
171
+ unicode-display_width (>= 1.4.0, < 3.0)
172
+ rubocop-ast (1.15.0)
173
+ parser (>= 3.0.1.1)
174
+ rubocop-performance (1.12.0)
175
+ rubocop (>= 1.7.0, < 2.0)
176
+ rubocop-ast (>= 0.4.0)
177
+ rubocop-rails (2.12.4)
178
+ activesupport (>= 4.2.0)
179
+ rack (>= 1.1)
180
+ rubocop (>= 1.7.0, < 2.0)
181
+ rubocop-rspec (2.6.0)
182
+ rubocop (~> 1.19)
183
+ ruby-progressbar (1.11.0)
194
184
  scanf (1.0.0)
195
- sprockets (4.0.2)
196
- concurrent-ruby (~> 1.0)
197
- rack (> 1, < 3)
198
- sprockets-rails (3.2.2)
199
- actionpack (>= 4.0)
200
- activesupport (>= 4.0)
201
- sprockets (>= 3.0.0)
202
185
  sqlite3 (1.4.2)
203
186
  sqlite3-ruby (1.3.3)
204
187
  sqlite3 (>= 1.3.3)
205
- thor (1.0.1)
206
- tzinfo (2.0.3)
188
+ thor (1.1.0)
189
+ tzinfo (2.0.4)
207
190
  concurrent-ruby (~> 1.0)
208
- unicode-display_width (1.7.0)
209
- websocket-driver (0.7.3)
191
+ unicode-display_width (2.1.0)
192
+ websocket-driver (0.7.5)
210
193
  websocket-extensions (>= 0.1.0)
211
194
  websocket-extensions (0.1.5)
212
- xpath (3.2.0)
213
- nokogiri (~> 1.8)
214
- zeitwerk (2.4.2)
195
+ zeitwerk (2.5.1)
215
196
 
216
197
  PLATFORMS
217
- ruby
218
- x86_64-darwin-19
198
+ arm64-darwin-20
219
199
 
220
200
  DEPENDENCIES
221
- capybara-webkit
222
201
  geokit
223
202
  git
224
203
  hpricot
225
204
  jpmobile!
226
205
  pry
227
- rails (~> 6.1.0)
206
+ rails (~> 7.0.0.alpha2)
228
207
  rspec
229
208
  rspec-its
230
209
  rspec-rails
231
210
  rubocop
232
211
  rubocop-performance
212
+ rubocop-rails
213
+ rubocop-rspec
233
214
  sqlite3-ruby
234
215
 
235
216
  BUNDLED WITH
236
- 2.2.3
217
+ 2.2.32
data/README.md CHANGED
@@ -1,10 +1,10 @@
1
- [![CircleCI](https://circleci.com/gh/jpmobile/jpmobile/tree/master.svg?style=svg)](https://circleci.com/gh/jpmobile/jpmobile/tree/master)
1
+ [![CircleCI](https://circleci.com/gh/jpmobile/jpmobile/tree/main.svg?style=svg)](https://circleci.com/gh/jpmobile/jpmobile/tree/main)
2
2
  [![Code Climate](https://codeclimate.com/github/jpmobile/jpmobile/badges/gpa.svg)](https://codeclimate.com/github/jpmobile/jpmobile)
3
3
 
4
4
  # jpmobile: A Rails plugin for Japanese mobile-phones
5
5
 
6
6
  ## jpmobileとは
7
- 携帯電話特有の機能を Rails 5.0 や Rack middleware で利用するためのプラグイン。 以下の機能を備える。
7
+ 携帯電話特有の機能を Rails や Rack middleware で利用するためのプラグイン。 以下の機能を備える。
8
8
 
9
9
  * 携帯電話のキャリア判別
10
10
  * 端末位置情報の取得
@@ -38,21 +38,6 @@ Rails](https://github.com/jpmobile/jpmobile/wiki/Version-:-Jpmobile-vs-Rails)
38
38
  を参照。
39
39
 
40
40
  ## インストール
41
- ### Rails pluginとしてインストールする場合
42
- ```shell
43
- % rails plugin install git://github.com/jpmobile/jpmobile.git
44
- ```
45
-
46
- #### IPアドレス検証が必要な場合
47
- ```shell
48
- % rails plugin install git://github.com/jpmobile/jpmobile-ipaddresses.git
49
- ```
50
-
51
- #### ディスプレイ情報を取得する必要がある場合
52
- ```shell
53
- % rails plugin install git://github.com/jpmobile/jpmobile-terminfo.git
54
- ```
55
-
56
41
  ### gemでインストールする場合
57
42
  ```shell
58
43
  % gem install jpmobile
@@ -396,7 +381,7 @@ end
396
381
  ## jpmobileの開発方法
397
382
 
398
383
  jpmobileの開発に関しては
399
- [こちら](https://github.com/jpmobile/jpmobile/blob/master/CONTRIBUTING.md) へ
384
+ [こちら](https://github.com/jpmobile/jpmobile/blob/main/CONTRIBUTING.md) へ
400
385
 
401
386
  ## リンク
402
387
 
data/jpmobile.gemspec CHANGED
@@ -13,20 +13,19 @@ Gem::Specification.new do |gem|
13
13
  gem.license = 'MIT'
14
14
 
15
15
  gem.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
16
- gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
16
+ gem.test_files = gem.files.grep(%r{^(test|spec|system)/})
17
17
  gem.require_paths = ['lib']
18
18
 
19
- gem.required_ruby_version = '>= 2.5.0'
19
+ gem.required_ruby_version = '>= 3.0.0'
20
20
 
21
21
  gem.add_dependency 'mail', '~> 2.7.0'
22
22
  gem.add_dependency 'rexml'
23
23
  gem.add_dependency 'scanf'
24
- gem.add_development_dependency 'capybara-webkit'
25
24
  gem.add_development_dependency 'geokit'
26
25
  gem.add_development_dependency 'git'
27
26
  gem.add_development_dependency 'hpricot'
28
27
  gem.add_development_dependency 'pry'
29
- gem.add_development_dependency 'rails', '~> 6.1.0'
28
+ gem.add_development_dependency 'rails', '~> 7.0.0.alpha2'
30
29
  gem.add_development_dependency 'rspec'
31
30
  gem.add_development_dependency 'rspec-its'
32
31
  gem.add_development_dependency 'rspec-rails'
@@ -1,5 +1,5 @@
1
1
  # DoCoMoの時guid=onの付与
2
- class ActionController::Base #:nodoc:
2
+ class ActionController::Base # :nodoc:
3
3
  class_attribute :docomo_guid_mode
4
4
 
5
5
  class << self
@@ -10,7 +10,7 @@ class ActionController::Base #:nodoc:
10
10
  end
11
11
  end
12
12
 
13
- module Jpmobile::DocomoGuid #:nodoc:
13
+ module Jpmobile::DocomoGuid # :nodoc:
14
14
  protected
15
15
 
16
16
  def default_url_options
@@ -1,4 +1,4 @@
1
- #:stopdoc:
1
+ # :stopdoc:
2
2
  # helperを追加
3
3
  # ActionView で trans_sid を有効にする
4
4
  ActionView::Base.class_eval do
@@ -6,7 +6,7 @@ ActionView::Base.class_eval do
6
6
 
7
7
  delegate :default_url_options, to: :controller unless respond_to?(:default_url_options)
8
8
  end
9
- #:startdoc:
9
+ # :startdoc:
10
10
 
11
11
  # :stopdoc:
12
12
  # accept-charset に charset を変更できるようにする
@@ -19,4 +19,4 @@ module Jpmobile
19
19
  end
20
20
  end
21
21
  end
22
- #:startdoc:
22
+ # :startdoc:
@@ -0,0 +1,12 @@
1
+ module Jpmobile
2
+ module HookTemplateDetailsRequested
3
+ attr_reader :mobile, :mobile_idx
4
+
5
+ def initialize(locale:, handlers:, formats:, variants:, mobile:)
6
+ super(locale: locale, handlers: handlers, formats: formats, variants: variants)
7
+
8
+ @mobile = mobile.map(&:to_sym)
9
+ @mobile_idx = build_idx_hash(@mobile)
10
+ end
11
+ end
12
+ end
@@ -37,7 +37,7 @@ module Jpmobile
37
37
  class << self
38
38
  protected
39
39
 
40
- def set_payload_for_mail(payload, mail) #:nodoc:
40
+ def set_payload_for_mail(payload, mail) # :nodoc:
41
41
  super
42
42
 
43
43
  payload[:mail] = Jpmobile::Util.ascii_8bit(mail.encoded).gsub(/\r\n/, "\n")
@@ -6,6 +6,6 @@ module Jpmobile::Mobile
6
6
  include Jpmobile::Mobile::GoogleEmoticon
7
7
 
8
8
  # 対応するUser-Agentの正規表現
9
- USER_AGENT_REGEXP = /Android/.freeze
9
+ USER_AGENT_REGEXP = /Android/
10
10
  end
11
11
  end
@@ -6,6 +6,6 @@ module Jpmobile::Mobile
6
6
  include Jpmobile::Mobile::GoogleEmoticon
7
7
 
8
8
  # 対応するUser-Agentの正規表現
9
- USER_AGENT_REGEXP = Regexp.union(/(?!Android.+Mobile)Android/, /Android.+SC-01C/)
9
+ USER_AGENT_REGEXP = Regexp.union(/^(?!.+Mobile).+(?=Android).+$/, /Android.+SC-01C/)
10
10
  end
11
11
  end
@@ -6,9 +6,9 @@ module Jpmobile::Mobile
6
6
  class Au < AbstractMobile
7
7
  # 対応するUser-Agentの正規表現
8
8
  # User-Agent文字列中に "UP.Browser" を含むVodafoneの端末があるので注意が必要
9
- USER_AGENT_REGEXP = %r{^(?:KDDI|UP.Browser/.+?)-(.+?) }.freeze
9
+ USER_AGENT_REGEXP = %r{^(?:KDDI|UP.Browser/.+?)-(.+?) }
10
10
  # 対応するメールアドレスの正規表現
11
- MAIL_ADDRESS_REGEXP = /.+@ezweb\.ne\.jp/.freeze
11
+ MAIL_ADDRESS_REGEXP = /.+@ezweb\.ne\.jp/
12
12
  # 簡易位置情報取得に対応していないデバイスID
13
13
  # http://www.au.kddi.com/ezfactory/tec/spec/eznavi.html
14
14
  LOCATION_UNSUPPORTED_DEVICE_ID = %w[PT21 TS25 KCTE TST9 KCU1 SYT5 KCTD TST8 TST7 KCTC SYT4 KCTB KCTA TST6 KCT9 TST5 TST4 KCT8 SYT3 KCT7 MIT1 MAT3 KCT6 TST3 KCT5 KCT4 SYT2 MAT1 MAT2 TST2 KCT3 KCT2 KCT1 TST1 SYT1].freeze
@@ -4,6 +4,6 @@ module Jpmobile::Mobile
4
4
  # ==BlackBerry
5
5
  class BlackBerry < SmartPhone
6
6
  # 対応するUser-Agentの正規表現
7
- USER_AGENT_REGEXP = /BlackBerry/.freeze
7
+ USER_AGENT_REGEXP = /BlackBerry/
8
8
  end
9
9
  end
@@ -4,7 +4,7 @@ module Jpmobile::Mobile
4
4
  # スーパクラスはWillcom。
5
5
  class Ddipocket < Willcom
6
6
  # 対応するUser-Agentの正規表現
7
- USER_AGENT_REGEXP = %r{^Mozilla/3.0\(DDIPOCKET}.freeze
7
+ USER_AGENT_REGEXP = %r{^Mozilla/3.0\(DDIPOCKET}
8
8
 
9
9
  MAIL_ADDRESS_REGEXP = nil # DdipocketはEmail判定だとWillcomと判定させたい
10
10
  end
@@ -4,9 +4,9 @@ module Jpmobile::Mobile
4
4
  # ==DoCoMo携帯電話
5
5
  class Docomo < AbstractMobile
6
6
  # 対応するUser-Agentの正規表現
7
- USER_AGENT_REGEXP = /^DoCoMo/.freeze
7
+ USER_AGENT_REGEXP = /^DoCoMo/
8
8
  # 対応するメールアドレスの正規表現
9
- MAIL_ADDRESS_REGEXP = /.+@docomo\.ne\.jp/.freeze
9
+ MAIL_ADDRESS_REGEXP = /.+@docomo\.ne\.jp/
10
10
  # メールのデフォルトのcharset
11
11
  MAIL_CHARSET = 'Shift_JIS'.freeze
12
12
  # テキスト部分の content-transfer-encoding
@@ -3,9 +3,9 @@
3
3
  module Jpmobile::Mobile
4
4
  # ==EMOBILE携帯電話
5
5
  class Emobile < AbstractMobile
6
- USER_AGENT_REGEXP = %r{^emobile/|^Mozilla/5.0 \(H11T; like Gecko; OpenBrowser\) NetFront/3.4$|^Mozilla/4.0 \(compatible; MSIE 6.0; Windows CE; IEMobile 7.7\) S11HT$}.freeze
6
+ USER_AGENT_REGEXP = %r{^emobile/|^Mozilla/5.0 \(H11T; like Gecko; OpenBrowser\) NetFront/3.4$|^Mozilla/4.0 \(compatible; MSIE 6.0; Windows CE; IEMobile 7.7\) S11HT$}
7
7
  # 対応するメールアドレスの正規表現
8
- MAIL_ADDRESS_REGEXP = /.+@emnet\.ne\.jp/.freeze
8
+ MAIL_ADDRESS_REGEXP = /.+@emnet\.ne\.jp/
9
9
  # EMnet対応端末から通知されるユニークなユーザIDを取得する。
10
10
  def em_uid
11
11
  @request.env['HTTP_X_EM_UID']
@@ -6,6 +6,6 @@ module Jpmobile::Mobile
6
6
  include Jpmobile::Mobile::UnicodeEmoticon
7
7
 
8
8
  # 対応するUser-Agentの正規表現
9
- USER_AGENT_REGEXP = /iPad/.freeze
9
+ USER_AGENT_REGEXP = /iPad/
10
10
  end
11
11
  end
@@ -6,6 +6,6 @@ module Jpmobile::Mobile
6
6
  include Jpmobile::Mobile::UnicodeEmoticon
7
7
 
8
8
  # 対応するUser-Agentの正規表現
9
- USER_AGENT_REGEXP = /iPhone/.freeze
9
+ USER_AGENT_REGEXP = /iPhone/
10
10
  end
11
11
  end
@@ -5,9 +5,9 @@ module Jpmobile::Mobile
5
5
  # Vodafoneのスーパクラス。
6
6
  class Softbank < AbstractMobile
7
7
  # 対応するuser-agentの正規表現
8
- USER_AGENT_REGEXP = /^(?:SoftBank|Semulator)/.freeze
8
+ USER_AGENT_REGEXP = /^(?:SoftBank|Semulator)/
9
9
  # 対応するメールアドレスの正規表現 ディズニーモバイル対応
10
- MAIL_ADDRESS_REGEXP = /.+@(?:softbank\.ne\.jp|disney\.ne\.jp)/.freeze
10
+ MAIL_ADDRESS_REGEXP = /.+@(?:softbank\.ne\.jp|disney\.ne\.jp)/
11
11
  # メールのデフォルトのcharset
12
12
  MAIL_CHARSET = 'Shift_JIS'.freeze
13
13
  # テキスト部分の content-transfer-encoding