jpmobile 5.1.0 → 5.1.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9b84db317e22ca18e365aa0902ffc9aabe50ea0c
4
- data.tar.gz: 5e126ef0948bde5be5bed2fce66c88ed51b06b55
3
+ metadata.gz: 0f606e8dcfcefaf3f8c8157d08a2ff642f8a89bb
4
+ data.tar.gz: 8fa435f921bf2fca48a6572c4859b5f5076aa42b
5
5
  SHA512:
6
- metadata.gz: 2a5e414cd3fb607ba5f9bf7280f425f19a4709161126371627d0521dad2cee55205828206d17522213a07fdbc936742d7f7eaf6558d43b5dac6780b5f024ae71
7
- data.tar.gz: 84250d25c5b909b8343aea70f3240fa4698314103ae381c0a48bb85b7c79a37e8c5997582c95540b4caa119c6fe35a3432e551a29a475e8e23368b6324119a32
6
+ metadata.gz: 74fbb52d229f5cfbdd7c2c26ca5fd05dbfcba78b5731bfce905e1992bd06a04e5ddbddd205d46ddf9a51b8d8988712e264f8a4e127347ad684449e2dd0e67dc0
7
+ data.tar.gz: d9f196f90b90ee8a1a3c3eefa7c4b663d187022b56f86aa8b1747d800348ebe1b3af49dc2a4566059fc7cdfb40a8fffd577af2915d9a879fe6d2c38d301ef2d5
@@ -1 +1 @@
1
- 2.4.1
1
+ 2.4.4
@@ -28,3 +28,9 @@ export MAILTRAP_PASSWORD=YYYYYYYYYYYYYY
28
28
  $ bundle exec rake test
29
29
  $ bundle exec rubocop
30
30
  ```
31
+
32
+ ### Railsでのテスト
33
+
34
+ ```
35
+ $ bundle exec rake test:rails
36
+ ```
data/Gemfile CHANGED
@@ -3,4 +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
6
+ gem 'onkcop', '0.48.1.1', require: false
7
+ gem 'rubocop', '0.48.1', require: false
@@ -1,50 +1,50 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- jpmobile (5.0.0)
4
+ jpmobile (5.1.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- actioncable (5.1.0)
10
- actionpack (= 5.1.0)
9
+ actioncable (5.1.4)
10
+ actionpack (= 5.1.4)
11
11
  nio4r (~> 2.0)
12
12
  websocket-driver (~> 0.6.1)
13
- actionmailer (5.1.0)
14
- actionpack (= 5.1.0)
15
- actionview (= 5.1.0)
16
- activejob (= 5.1.0)
13
+ actionmailer (5.1.4)
14
+ actionpack (= 5.1.4)
15
+ actionview (= 5.1.4)
16
+ activejob (= 5.1.4)
17
17
  mail (~> 2.5, >= 2.5.4)
18
18
  rails-dom-testing (~> 2.0)
19
- actionpack (5.1.0)
20
- actionview (= 5.1.0)
21
- activesupport (= 5.1.0)
19
+ actionpack (5.1.4)
20
+ actionview (= 5.1.4)
21
+ activesupport (= 5.1.4)
22
22
  rack (~> 2.0)
23
- rack-test (~> 0.6.3)
23
+ rack-test (>= 0.6.3)
24
24
  rails-dom-testing (~> 2.0)
25
25
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
26
- actionview (5.1.0)
27
- activesupport (= 5.1.0)
26
+ actionview (5.1.4)
27
+ activesupport (= 5.1.4)
28
28
  builder (~> 3.1)
29
29
  erubi (~> 1.4)
30
30
  rails-dom-testing (~> 2.0)
31
31
  rails-html-sanitizer (~> 1.0, >= 1.0.3)
32
- activejob (5.1.0)
33
- activesupport (= 5.1.0)
32
+ activejob (5.1.4)
33
+ activesupport (= 5.1.4)
34
34
  globalid (>= 0.3.6)
35
- activemodel (5.1.0)
36
- activesupport (= 5.1.0)
37
- activerecord (5.1.0)
38
- activemodel (= 5.1.0)
39
- activesupport (= 5.1.0)
35
+ activemodel (5.1.4)
36
+ activesupport (= 5.1.4)
37
+ activerecord (5.1.4)
38
+ activemodel (= 5.1.4)
39
+ activesupport (= 5.1.4)
40
40
  arel (~> 8.0)
41
- activesupport (5.1.0)
41
+ activesupport (5.1.4)
42
42
  concurrent-ruby (~> 1.0, >= 1.0.2)
43
43
  i18n (~> 0.7)
44
44
  minitest (~> 5.1)
45
45
  tzinfo (~> 1.1)
46
- addressable (2.5.1)
47
- public_suffix (~> 2.0, >= 2.0.2)
46
+ addressable (2.5.2)
47
+ public_suffix (>= 2.0.2, < 4.0)
48
48
  arel (8.0.0)
49
49
  ast (2.3.0)
50
50
  builder (3.2.3)
@@ -58,123 +58,121 @@ GEM
58
58
  capybara-webkit (1.14.0)
59
59
  capybara (>= 2.3.0, < 2.14.0)
60
60
  json
61
- coderay (1.1.1)
61
+ coderay (1.1.2)
62
62
  concurrent-ruby (1.0.5)
63
63
  diff-lcs (1.3)
64
- erubi (1.6.0)
64
+ erubi (1.6.1)
65
65
  geokit (1.11.0)
66
66
  git (1.3.0)
67
67
  globalid (0.4.0)
68
68
  activesupport (>= 4.2.0)
69
69
  hpricot (0.8.6)
70
- i18n (0.8.1)
70
+ i18n (0.8.6)
71
71
  json (2.1.0)
72
72
  loofah (2.0.3)
73
73
  nokogiri (>= 1.5.9)
74
- mail (2.6.5)
74
+ mail (2.6.6)
75
75
  mime-types (>= 1.16, < 4)
76
76
  method_source (0.8.2)
77
77
  mime-types (3.1)
78
78
  mime-types-data (~> 3.2015)
79
79
  mime-types-data (3.2016.0521)
80
- mini_portile2 (2.1.0)
81
- minitest (5.10.1)
82
- nio4r (2.0.0)
83
- nokogiri (1.7.1)
84
- mini_portile2 (~> 2.1.0)
80
+ mini_portile2 (2.3.0)
81
+ minitest (5.10.3)
82
+ nio4r (2.1.0)
83
+ nokogiri (1.8.1)
84
+ mini_portile2 (~> 2.3.0)
85
85
  onkcop (0.48.1.1)
86
86
  rubocop (~> 0.48.1)
87
87
  rubocop-rspec (>= 1.15.0)
88
88
  parser (2.4.0.0)
89
89
  ast (~> 2.2)
90
90
  powerpack (0.1.1)
91
- pry (0.10.4)
91
+ pry (0.11.0)
92
92
  coderay (~> 1.1.0)
93
93
  method_source (~> 0.8.1)
94
- slop (~> 3.4)
95
- public_suffix (2.0.5)
96
- rack (2.0.1)
97
- rack-test (0.6.3)
98
- rack (>= 1.0)
99
- rails (5.1.0)
100
- actioncable (= 5.1.0)
101
- actionmailer (= 5.1.0)
102
- actionpack (= 5.1.0)
103
- actionview (= 5.1.0)
104
- activejob (= 5.1.0)
105
- activemodel (= 5.1.0)
106
- activerecord (= 5.1.0)
107
- activesupport (= 5.1.0)
108
- bundler (>= 1.3.0, < 2.0)
109
- railties (= 5.1.0)
94
+ public_suffix (3.0.0)
95
+ rack (2.0.3)
96
+ rack-test (0.7.0)
97
+ rack (>= 1.0, < 3)
98
+ rails (5.1.4)
99
+ actioncable (= 5.1.4)
100
+ actionmailer (= 5.1.4)
101
+ actionpack (= 5.1.4)
102
+ actionview (= 5.1.4)
103
+ activejob (= 5.1.4)
104
+ activemodel (= 5.1.4)
105
+ activerecord (= 5.1.4)
106
+ activesupport (= 5.1.4)
107
+ bundler (>= 1.3.0)
108
+ railties (= 5.1.4)
110
109
  sprockets-rails (>= 2.0.0)
111
- rails-dom-testing (2.0.2)
112
- activesupport (>= 4.2.0, < 6.0)
113
- nokogiri (~> 1.6)
110
+ rails-dom-testing (2.0.3)
111
+ activesupport (>= 4.2.0)
112
+ nokogiri (>= 1.6)
114
113
  rails-html-sanitizer (1.0.3)
115
114
  loofah (~> 2.0)
116
- railties (5.1.0)
117
- actionpack (= 5.1.0)
118
- activesupport (= 5.1.0)
115
+ railties (5.1.4)
116
+ actionpack (= 5.1.4)
117
+ activesupport (= 5.1.4)
119
118
  method_source
120
119
  rake (>= 0.8.7)
121
120
  thor (>= 0.18.1, < 2.0)
122
121
  rainbow (2.2.2)
123
122
  rake
124
- rake (12.0.0)
125
- rspec (3.5.0)
126
- rspec-core (~> 3.5.0)
127
- rspec-expectations (~> 3.5.0)
128
- rspec-mocks (~> 3.5.0)
129
- rspec-core (3.5.4)
130
- rspec-support (~> 3.5.0)
131
- rspec-expectations (3.5.0)
123
+ rake (12.1.0)
124
+ rspec (3.6.0)
125
+ rspec-core (~> 3.6.0)
126
+ rspec-expectations (~> 3.6.0)
127
+ rspec-mocks (~> 3.6.0)
128
+ rspec-core (3.6.0)
129
+ rspec-support (~> 3.6.0)
130
+ rspec-expectations (3.6.0)
132
131
  diff-lcs (>= 1.2.0, < 2.0)
133
- rspec-support (~> 3.5.0)
132
+ rspec-support (~> 3.6.0)
134
133
  rspec-its (1.2.0)
135
134
  rspec-core (>= 3.0.0)
136
135
  rspec-expectations (>= 3.0.0)
137
- rspec-mocks (3.5.0)
136
+ rspec-mocks (3.6.0)
138
137
  diff-lcs (>= 1.2.0, < 2.0)
139
- rspec-support (~> 3.5.0)
140
- rspec-rails (3.5.2)
138
+ rspec-support (~> 3.6.0)
139
+ rspec-rails (3.6.1)
141
140
  actionpack (>= 3.0)
142
141
  activesupport (>= 3.0)
143
142
  railties (>= 3.0)
144
- rspec-core (~> 3.5.0)
145
- rspec-expectations (~> 3.5.0)
146
- rspec-mocks (~> 3.5.0)
147
- rspec-support (~> 3.5.0)
148
- rspec-support (3.5.0)
143
+ rspec-core (~> 3.6.0)
144
+ rspec-expectations (~> 3.6.0)
145
+ rspec-mocks (~> 3.6.0)
146
+ rspec-support (~> 3.6.0)
147
+ rspec-support (3.6.0)
149
148
  rubocop (0.48.1)
150
149
  parser (>= 2.3.3.1, < 3.0)
151
150
  powerpack (~> 0.1)
152
151
  rainbow (>= 1.99.1, < 3.0)
153
152
  ruby-progressbar (~> 1.7)
154
153
  unicode-display_width (~> 1.0, >= 1.0.1)
155
- rubocop-rspec (1.15.0)
154
+ rubocop-rspec (1.15.1)
156
155
  rubocop (>= 0.42.0)
157
- ruby-progressbar (1.8.1)
158
- slop (3.6.0)
156
+ ruby-progressbar (1.8.3)
159
157
  sprockets (3.7.1)
160
158
  concurrent-ruby (~> 1.0)
161
159
  rack (> 1, < 3)
162
- sprockets-rails (3.2.0)
160
+ sprockets-rails (3.2.1)
163
161
  actionpack (>= 4.0)
164
162
  activesupport (>= 4.0)
165
163
  sprockets (>= 3.0.0)
166
164
  sqlite3 (1.3.13)
167
165
  sqlite3-ruby (1.3.3)
168
166
  sqlite3 (>= 1.3.3)
169
- thor (0.19.4)
167
+ thor (0.20.0)
170
168
  thread_safe (0.3.6)
171
169
  tzinfo (1.2.3)
172
170
  thread_safe (~> 0.1)
173
- unicode-display_width (1.2.1)
171
+ unicode-display_width (1.3.0)
174
172
  websocket-driver (0.6.5)
175
173
  websocket-extensions (>= 0.1.0)
176
174
  websocket-extensions (0.1.2)
177
- xpath (2.0.0)
175
+ xpath (2.1.0)
178
176
  nokogiri (~> 1.3)
179
177
 
180
178
  PLATFORMS
@@ -186,13 +184,14 @@ DEPENDENCIES
186
184
  git
187
185
  hpricot
188
186
  jpmobile!
189
- onkcop
187
+ onkcop (= 0.48.1.1)
190
188
  pry
191
- rails (~> 5.1.0)
189
+ rails (~> 5.1.4)
192
190
  rspec
193
191
  rspec-its
194
192
  rspec-rails
193
+ rubocop (= 0.48.1)
195
194
  sqlite3-ruby
196
195
 
197
196
  BUNDLED WITH
198
- 1.14.6
197
+ 1.16.0.pre.2
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:
@@ -10,12 +10,13 @@ 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.1.0'
19
+ gem.add_development_dependency 'rails', '~> 5.1.4'
19
20
  gem.add_development_dependency 'rspec'
20
21
  gem.add_development_dependency 'rspec-rails'
21
22
  gem.add_development_dependency 'rspec-its'
@@ -64,6 +64,7 @@ module Jpmobile
64
64
 
65
65
  autoload :FallbackViewSelector, 'jpmobile/fallback_view_selector'
66
66
 
67
+ autoload :ParamsOverCookie, 'jpmobile/trans_sid'
67
68
  autoload :TransSidRedirecting, 'jpmobile/trans_sid'
68
69
  autoload :TransSid, 'jpmobile/trans_sid'
69
70
 
@@ -164,12 +164,26 @@ module Jpmobile
164
164
  end
165
165
 
166
166
  def convert_parameters(params)
167
- params.each do |k, v|
168
- params[k] = if params[k].respond_to?(:each)
169
- convert_parameters(params[k])
170
- else
171
- to_internal(v)
172
- end
167
+ return to_internal(params) unless params.respond_to?(:each)
168
+
169
+ case params
170
+ when Array
171
+ params.map do |v|
172
+ if v.respond_to?(:each)
173
+ convert_parameters(v)
174
+ else
175
+ to_internal(v)
176
+ end
177
+ end
178
+ else
179
+ params.each do |k, v|
180
+ params[k] =
181
+ if v.respond_to?(:each)
182
+ convert_parameters(v)
183
+ else
184
+ to_internal(v)
185
+ end
186
+ end
173
187
  end
174
188
  end
175
189
  end
@@ -54,7 +54,8 @@ module Mail
54
54
  end
55
55
 
56
56
  def parse_message_with_jpmobile
57
- header_part, body_part = raw_source.lstrip.split(/#{CRLF}#{CRLF}|#{CRLF}#{WSP}*#{CRLF}(?!#{WSP})/m, 2)
57
+ _crlf_raw_source = raw_source.encode(raw_source.encoding, universal_newline: true).encode!(raw_source.encoding, crlf_newline: true)
58
+ header_part, body_part = _crlf_raw_source.lstrip.split(/#{CRLF}#{CRLF}|#{CRLF}#{WSP}*#{CRLF}(?!#{WSP})/m, 2)
58
59
  # header_part, body_part = raw_source.lstrip.split(HEADER_SEPARATOR, 2)
59
60
 
60
61
  self.header = header_part
@@ -81,6 +82,9 @@ module Mail
81
82
  def init_with_string(string)
82
83
  # convert to ASCII-8BIT for ascii incompatible encodings
83
84
  s = Jpmobile::Util.ascii_8bit(string)
85
+ unless s.ascii_only?
86
+ s = s.kind_of?(String) ? s.to_str.encode(s.encoding, :universal_newline => true).encode!(s.encoding, :crlf_newline => true) : ''
87
+ end
84
88
  self.raw_source = s
85
89
  set_envelope_header
86
90
  parse_message
@@ -312,7 +316,7 @@ module Mail
312
316
  _raw_source = if transfer_encoding == encoding
313
317
  @raw_source.dup
314
318
  else
315
- get_best_encoding(transfer_encoding).encode(@raw_source)
319
+ negotiate_best_encoding(transfer_encoding).encode(@raw_source)
316
320
  end
317
321
  Jpmobile::Util.set_encoding(_raw_source, @mobile.mail_charset(@charset))
318
322
  when /quoted-printable/
@@ -331,7 +335,7 @@ module Mail
331
335
 
332
336
  # fix charset
333
337
  def set_charset_with_jpmobile
334
- @charset ||= only_us_ascii? ? 'US-ASCII' : nil
338
+ @charset ||= ascii_only? ? 'US-ASCII' : nil
335
339
  end
336
340
 
337
341
  def mobile=(m)
@@ -509,6 +513,15 @@ module Mail
509
513
  def encoded_with_jpmobile
510
514
  if @mobile
511
515
  self.charset = @mobile.mail_charset
516
+
517
+ _value = address_list.addresses.map { |_a|
518
+ if Utilities.blank?(_a.display_name) || _a.display_name.ascii_only?
519
+ _a.to_s
520
+ else
521
+ "#{@mobile.to_mail_subject(_a.display_name)} <#{_a.address}>"
522
+ end
523
+ }.join(", ")
524
+ @address_list = AddressList.new(_value)
512
525
  end
513
526
 
514
527
  encoded_without_jpmobile
@@ -539,6 +552,15 @@ module Mail
539
552
  def encoded_with_jpmobile
540
553
  if @mobile
541
554
  self.charset = @mobile.mail_charset
555
+
556
+ _value = address_list.addresses.map { |_a|
557
+ if Utilities.blank?(_a.display_name) || _a.display_name.ascii_only?
558
+ _a.to_s
559
+ else
560
+ "#{@mobile.to_mail_subject(_a.display_name)} <#{_a.address}>"
561
+ end
562
+ }.join(", ")
563
+ @address_list = AddressList.new(_value)
542
564
  end
543
565
 
544
566
  encoded_without_jpmobile
@@ -7,17 +7,17 @@ module Jpmobile
7
7
 
8
8
  def call(env)
9
9
  # 入力
10
- if (@mobile = env['rack.jpmobile']) && @mobile.apply_params_filter?
10
+ if (mobile = env['rack.jpmobile']) && mobile.apply_params_filter?
11
11
  # パラメータをkey, valueに分解
12
12
  # form_params
13
13
  unless env['REQUEST_METHOD'] == 'GET' || env['REQUEST_METHOD'] == 'HEAD'
14
14
  unless env['CONTENT_TYPE'] =~ %r{application/json|application/xml}
15
- env['rack.input'] = StringIO.new(parse_query(env['rack.input'].read))
15
+ env['rack.input'] = StringIO.new(parse_query(env['rack.input'].read, mobile))
16
16
  end
17
17
  end
18
18
 
19
19
  # query_params
20
- env['QUERY_STRING'] = parse_query(env['QUERY_STRING'])
20
+ env['QUERY_STRING'] = parse_query(env['QUERY_STRING'], mobile)
21
21
  end
22
22
 
23
23
  status, env, body = @app.call(env)
@@ -27,18 +27,18 @@ module Jpmobile
27
27
 
28
28
  private
29
29
 
30
- def to_internal(str)
31
- ::Rack::Utils.escape(@mobile.to_internal(::Rack::Utils.unescape(str)))
30
+ def to_internal(str, mobile)
31
+ ::Rack::Utils.escape(mobile.to_internal(::Rack::Utils.unescape(str)))
32
32
  end
33
33
 
34
- def parse_query(str)
34
+ def parse_query(str, mobile)
35
35
  return nil unless str
36
36
 
37
37
  new_array = []
38
38
  str.split('&').each do |param_pair|
39
39
  k, v = param_pair.split('=')
40
- k = to_internal(k) if k
41
- v = to_internal(v) if v
40
+ k = to_internal(k, mobile) if k
41
+ v = to_internal(v, mobile) if v
42
42
  new_array << "#{k}=#{v}" if k
43
43
  end
44
44
 
@@ -1,3 +1,3 @@
1
1
  module Jpmobile
2
- VERSION = '5.1.0'.freeze
2
+ VERSION = '5.1.1'.freeze
3
3
  end
@@ -34,7 +34,7 @@ namespace :test do
34
34
  # generate rails app
35
35
  FileUtils.rm_rf(rails_root)
36
36
  FileUtils.mkdir_p(rails_root)
37
- `rails _5.1.0_ new #{rails_root} --skip-bundle`
37
+ `rails new #{rails_root} --skip-bundle`
38
38
  end
39
39
 
40
40
  # setup jpmobile
@@ -347,8 +347,8 @@ describe 'Jpmobile::Mail' do
347
347
  enable_starttls_auto: false,
348
348
  user_name: ENV['MAILTRAP_USERNAME'],
349
349
  password: ENV['MAILTRAP_PASSWORD'],
350
- address: 'mailtrap.io',
351
- domain: 'mailtrap.io',
350
+ address: 'smtp.mailtrap.io',
351
+ domain: 'smtp.mailtrap.io',
352
352
  port: '2525',
353
353
  authentication: :cram_md5,
354
354
  }
@@ -207,7 +207,7 @@ describe 'Jpmobile::Mail#receive' do
207
207
  end
208
208
 
209
209
  it 'body should be parsed correctly' do
210
- expect(@mail.body.to_s).to eq("本文&#xe6e2;\nFor docomo\n\n")
210
+ expect(@mail.body.to_s).to eq("本文&#xe6e2;\r\nFor docomo\r\n\r\n")
211
211
  end
212
212
 
213
213
  context 'to_s' do
@@ -352,7 +352,7 @@ describe 'Jpmobile::Mail#receive' do
352
352
  end
353
353
 
354
354
  it 'body should be parsed correctly' do
355
- expect(@mail.body.to_s).to eq("本文&#xf21c;\nFor softbank\n\n")
355
+ expect(@mail.body.to_s).to eq("本文&#xf21c;\r\nFor softbank\r\n\r\n")
356
356
  end
357
357
 
358
358
  context 'to_s' do
@@ -0,0 +1,55 @@
1
+ source 'https://rubygems.org'
2
+
3
+ git_source(:github) do |repo_name|
4
+ repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
5
+ "https://github.com/#{repo_name}.git"
6
+ end
7
+
8
+
9
+ # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
10
+ gem 'rails', '~> 5.1.4'
11
+ # Use sqlite3 as the database for Active Record
12
+ gem 'sqlite3', '~> 1.3.6'
13
+ # Use Puma as the app server
14
+ gem 'puma', '~> 3.7'
15
+ # Use SCSS for stylesheets
16
+ gem 'sass-rails', '~> 5.0'
17
+ # Use Uglifier as compressor for JavaScript assets
18
+ gem 'uglifier', '>= 1.3.0'
19
+ # See https://github.com/rails/execjs#readme for more supported runtimes
20
+ # gem 'therubyracer', platforms: :ruby
21
+
22
+ # Use CoffeeScript for .coffee assets and views
23
+ gem 'coffee-rails', '~> 4.2'
24
+ # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
25
+ gem 'turbolinks', '~> 5'
26
+ # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
27
+ gem 'jbuilder', '~> 2.5'
28
+ # Use Redis adapter to run Action Cable in production
29
+ # gem 'redis', '~> 3.0'
30
+ # Use ActiveModel has_secure_password
31
+ # gem 'bcrypt', '~> 3.1.7'
32
+
33
+ # Use Capistrano for deployment
34
+ # gem 'capistrano-rails', group: :development
35
+
36
+ group :development, :test do
37
+ # Call 'byebug' anywhere in the code to stop execution and get a debugger console
38
+ gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
39
+ # Adds support for Capybara system testing and selenium driver
40
+ gem 'capybara', '~> 2.13'
41
+ gem 'selenium-webdriver'
42
+ end
43
+
44
+ group :development do
45
+ # Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
46
+ gem 'web-console', '>= 3.3.0'
47
+ gem 'listen', '>= 3.0.5', '< 3.2'
48
+ # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
49
+ gem 'spring'
50
+ gem 'spring-watcher-listen', '~> 2.0.0'
51
+ end
52
+
53
+ # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
54
+ gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
55
+ instance_eval File.read(File.expand_path(__FILE__) + '.jpmobile')
@@ -0,0 +1,14 @@
1
+ require 'rails_helper'
2
+
3
+ describe Jpmobile::HankakuFilterController, type: :controller do
4
+ describe '#index' do
5
+ let(:params) { { prefecture_ids: ['1', '2'] } }
6
+
7
+ it 'should be successful' do
8
+ request.user_agent = 'DoCoMo/2.0 P05C(c500;TB;W24H16)'
9
+ get 'index', params: params
10
+ expect(response).to be_successful
11
+ expect(request.mobile?).to be_truthy
12
+ end
13
+ end
14
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jpmobile
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.0
4
+ version: 5.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shin-ichiro OGAWA
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-04-28 00:00:00.000000000 Z
12
+ date: 2019-03-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: 5.1.0
20
+ version: 5.1.4
21
21
  type: :development
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: 5.1.0
27
+ version: 5.1.4
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: rspec
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -282,6 +282,7 @@ files:
282
282
  - spec/unit/variants_spec.rb
283
283
  - test/rails/.gitignore
284
284
  - test/rails/overrides/.rspec
285
+ - test/rails/overrides/Gemfile
285
286
  - test/rails/overrides/Gemfile.jpmobile
286
287
  - test/rails/overrides/app/controllers/admin/top_controller.rb
287
288
  - test/rails/overrides/app/controllers/application_controller.rb
@@ -368,6 +369,7 @@ files:
368
369
  - test/rails/overrides/db/migrate/001_add_sessions_table.rb
369
370
  - test/rails/overrides/db/migrate/20100824062306_create_users.rb
370
371
  - test/rails/overrides/spec/controllers/docomo_guid_spec.rb
372
+ - test/rails/overrides/spec/controllers/hankaku_filter_controller_spec.rb
371
373
  - test/rails/overrides/spec/controllers/helpers_spec.rb
372
374
  - test/rails/overrides/spec/controllers/mobile_spec_controller_spec.rb
373
375
  - test/rails/overrides/spec/controllers/template_path_spec.rb
@@ -418,7 +420,8 @@ files:
418
420
  - tools/generate_softbank_emoticon_table.rb
419
421
  - tools/list_gps_unsupported_au.rb
420
422
  homepage: http://jpmobile-rails.org
421
- licenses: []
423
+ licenses:
424
+ - MIT
422
425
  metadata: {}
423
426
  post_install_message:
424
427
  rdoc_options: []
@@ -436,7 +439,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
436
439
  version: '0'
437
440
  requirements: []
438
441
  rubyforge_project:
439
- rubygems_version: 2.6.11
442
+ rubygems_version: 2.6.14.1
440
443
  signing_key:
441
444
  specification_version: 4
442
445
  summary: Rails plugin for mobile devices in Japan
@@ -497,6 +500,7 @@ test_files:
497
500
  - spec/unit/variants_spec.rb
498
501
  - test/rails/.gitignore
499
502
  - test/rails/overrides/.rspec
503
+ - test/rails/overrides/Gemfile
500
504
  - test/rails/overrides/Gemfile.jpmobile
501
505
  - test/rails/overrides/app/controllers/admin/top_controller.rb
502
506
  - test/rails/overrides/app/controllers/application_controller.rb
@@ -583,6 +587,7 @@ test_files:
583
587
  - test/rails/overrides/db/migrate/001_add_sessions_table.rb
584
588
  - test/rails/overrides/db/migrate/20100824062306_create_users.rb
585
589
  - test/rails/overrides/spec/controllers/docomo_guid_spec.rb
590
+ - test/rails/overrides/spec/controllers/hankaku_filter_controller_spec.rb
586
591
  - test/rails/overrides/spec/controllers/helpers_spec.rb
587
592
  - test/rails/overrides/spec/controllers/mobile_spec_controller_spec.rb
588
593
  - test/rails/overrides/spec/controllers/template_path_spec.rb