jpmobile 7.1.0 → 8.1.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 (63) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +3 -3
  3. data/.onkcop-config.yml +1 -1
  4. data/.rubocop.yml +48 -3
  5. data/.ruby-version +1 -1
  6. data/Gemfile +1 -5
  7. data/Gemfile.lock +195 -191
  8. data/jpmobile.gemspec +2 -3
  9. data/lib/jpmobile/docomo_guid.rb +1 -0
  10. data/lib/jpmobile/email.rb +1 -1
  11. data/lib/jpmobile/emoticon/z_combine.rb +1 -1
  12. data/lib/jpmobile/emoticon.rb +2 -3
  13. data/lib/jpmobile/fallback_view_selector.rb +2 -2
  14. data/lib/jpmobile/filter.rb +1 -1
  15. data/lib/jpmobile/helpers.rb +1 -1
  16. data/lib/jpmobile/hook_template_details_requested.rb +1 -1
  17. data/lib/jpmobile/mail.rb +22 -24
  18. data/lib/jpmobile/mailer.rb +4 -4
  19. data/lib/jpmobile/method_less_action_support.rb +3 -3
  20. data/lib/jpmobile/mobile/abstract_mobile.rb +9 -9
  21. data/lib/jpmobile/mobile/android.rb +1 -1
  22. data/lib/jpmobile/mobile/au.rb +3 -3
  23. data/lib/jpmobile/mobile/black_berry.rb +1 -1
  24. data/lib/jpmobile/mobile/ddipocket.rb +1 -1
  25. data/lib/jpmobile/mobile/docomo.rb +2 -2
  26. data/lib/jpmobile/mobile/emobile.rb +2 -2
  27. data/lib/jpmobile/mobile/ipad.rb +1 -1
  28. data/lib/jpmobile/mobile/iphone.rb +1 -1
  29. data/lib/jpmobile/mobile/softbank.rb +3 -3
  30. data/lib/jpmobile/mobile/vodafone.rb +2 -2
  31. data/lib/jpmobile/mobile/willcom.rb +2 -2
  32. data/lib/jpmobile/mobile/windows_phone.rb +1 -1
  33. data/lib/jpmobile/path_set.rb +1 -1
  34. data/lib/jpmobile/position.rb +1 -0
  35. data/lib/jpmobile/rack/filter.rb +2 -0
  36. data/lib/jpmobile/request_with_mobile.rb +1 -1
  37. data/lib/jpmobile/resolver.rb +1 -1
  38. data/lib/jpmobile/session/active_record_store.rb +1 -1
  39. data/lib/jpmobile/session/mem_cache_store.rb +1 -1
  40. data/lib/jpmobile/template_details.rb +1 -1
  41. data/lib/jpmobile/trans_sid.rb +1 -1
  42. data/lib/jpmobile/version.rb +1 -1
  43. data/lib/jpmobile/view_selector.rb +2 -2
  44. data/lib/jpmobile.rb +1 -1
  45. data/lib/tasks/jpmobile_tasks.rake +2 -2
  46. data/renovate.json +1 -1
  47. data/spec/rack_helper.rb +0 -1
  48. data/spec/unit/email_spec.rb +2 -2
  49. data/spec/unit/is_carrier_spec.rb +1 -1
  50. data/spec/unit/receive_mail_spec.rb +1 -1
  51. data/spec/unit/util_spec.rb +0 -1
  52. data/test/rails/overrides/Gemfile.jpmobile +1 -1
  53. data/test/rails/overrides/spec/controllers/hankaku_filter_controller_spec.rb +1 -1
  54. data/test/rails/overrides/spec/controllers/helpers_spec.rb +1 -1
  55. data/test/rails/overrides/spec/rails_helper.rb +3 -1
  56. data/test/rails/overrides/spec/requests/method_less_action_support_spec.rb +1 -1
  57. data/test/rails/overrides/spec/system/filter_spec.rb +8 -8
  58. data/test/rails/overrides/spec/system_helper.rb +5 -1
  59. data/test/sinatra/guestbook.rb +2 -1
  60. metadata +6 -26
  61. data/tools/generate_au_emoticon_table.rb +0 -34
  62. data/tools/generate_docomo_emoticon_table.rb +0 -33
  63. data/tools/generate_softbank_emoticon_table.rb +0 -31
@@ -59,7 +59,7 @@ describe 'Jpmobile::Mobile' do
59
59
  [%w[Ddipocket ddipocket], true],
60
60
  ].each do |carrier, expected|
61
61
  it "#{carrier.first}##{carrier.last}? should be return #{expected}" do
62
- expect(Jpmobile::Mobile.const_get(carrier.first).new({}, {}).__send__("#{carrier.last}?")).to eq(expected)
62
+ expect(Jpmobile::Mobile.const_get(carrier.first).new({}, {}).__send__(:"#{carrier.last}?")).to eq(expected)
63
63
  end
64
64
  end
65
65
  end
@@ -7,7 +7,7 @@ describe 'Jpmobile::Mail#receive' do
7
7
 
8
8
  before(:each) do
9
9
  @to = 'info@jpmobile-rails.org'
10
- Jpmobile::Email.japanese_mail_address_regexp = Regexp.new(/\.jp[^a-zA-Z.-]/)
10
+ Jpmobile::Email.japanese_mail_address_regexp = /\.jp[^a-zA-Z.-]/
11
11
  end
12
12
 
13
13
  describe 'PC mail' do
@@ -1,6 +1,5 @@
1
1
  require File.expand_path(File.join(File.dirname(__FILE__), 'spec_helper'))
2
2
  require 'stringio'
3
- require 'nkf'
4
3
 
5
4
  describe Jpmobile::Util do
6
5
  include Jpmobile::Util
@@ -4,7 +4,7 @@ gem 'jpmobile', path: './vendor/jpmobile'
4
4
  gem 'jpmobile-terminfo', path: './vendor/jpmobile-terminfo'
5
5
  gem 'jpmobile-ipaddresses', path: './vendor/jpmobile-ipaddresses'
6
6
 
7
- gem 'activerecord-session_store', git: 'https://github.com/rails/activerecord-session_store.git', ref: 'f188efbc49a522123cc8acc805143824176d01c1'
7
+ gem 'activerecord-session_store'
8
8
 
9
9
  gem 'pry'
10
10
  gem 'pry-byebug'
@@ -6,7 +6,7 @@ describe HankakuFilterController, type: :controller do
6
6
 
7
7
  it 'should be successful' do
8
8
  request.user_agent = 'DoCoMo/2.0 P05C(c500;TB;W24H16)'
9
- get 'index', params: params
9
+ get('index', params:)
10
10
  expect(response).to be_successful
11
11
  expect(request.mobile?).to be_truthy
12
12
  end
@@ -9,7 +9,7 @@ describe LinksController, type: :controller do
9
9
  def get_href_and_texts(str)
10
10
  results = []
11
11
  (Nokogiri::HTML.parse(str) / 'a').each do |link|
12
- path, query = link['href'].split(/\?/, 2)
12
+ path, query = link['href'].split('?', 2)
13
13
  params = query.nil? ? nil : Rack::Utils.parse_query(query)
14
14
  results << [link.inner_html, link.attributes, path, params]
15
15
  end
@@ -28,7 +28,9 @@ ActiveRecord::Migration.maintain_test_schema!
28
28
 
29
29
  RSpec.configure do |config|
30
30
  # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
31
- config.fixture_path = "#{Rails.root}/spec/fixtures"
31
+ config.fixture_paths = [
32
+ "#{Rails.root}/spec/fixtures",
33
+ ]
32
34
 
33
35
  # If you're not using ActiveRecord, or you'd prefer not to run each of your
34
36
  # examples within a transaction, remove the following line or assign false
@@ -2,7 +2,7 @@ require 'rails_helper'
2
2
 
3
3
  describe 'Method-less mobile template only action', type: :request do
4
4
  subject do
5
- get '/method_less_action_support', headers: headers
5
+ get '/method_less_action_support', headers:
6
6
  end
7
7
 
8
8
  let(:headers) do
@@ -40,7 +40,7 @@ describe 'jpmobile integration spec', type: :feature do
40
40
  shared_examples_for '文字コードフィルタが動作しているとき' do
41
41
  it 'response.bodyが空のときは文字コードを変更しないこと' do
42
42
  visit "/#{controller}/empty"
43
- expect(page.response_headers['Content-Type']).to match(/utf-8/i)
43
+ expect(extract_response_header(page, 'Content-Type')).to match(/utf-8/i)
44
44
  end
45
45
  end
46
46
 
@@ -48,13 +48,13 @@ describe 'jpmobile integration spec', type: :feature do
48
48
  it 'はShift_JISで携帯に送出されること' do
49
49
  visit "/#{controller}/abracadabra_utf8"
50
50
  expect(page.body.encode('UTF-8')).to have_content('アブラカダブラ')
51
- expect(page.response_headers['Content-Type']).to match(/Shift_JIS/i)
51
+ expect(extract_response_header(page, 'Content-Type')).to match(/Shift_JIS/i)
52
52
  end
53
53
  it 'はxhtmlでもShift_JISで携帯に送出されること' do
54
54
  visit "/#{controller}/abracadabra_xhtml_utf8"
55
55
 
56
56
  expect(page.body.encode('UTF-8')).to have_content('アブラカダブラ')
57
- expect(page.response_headers['Content-Type']).to match(/Shift_JIS/i)
57
+ expect(extract_response_header(page, 'Content-Type')).to match(/Shift_JIS/i)
58
58
  end
59
59
  it 'はShift_JISで渡されたパラメタがparamsにUTF-8に変換されて格納されること' do
60
60
  visit "/#{controller}/index_zenkaku?q=#{CGI.escape(utf8_to_sjis("アブラカダブラ"))}"
@@ -72,12 +72,12 @@ describe 'jpmobile integration spec', type: :feature do
72
72
  it 'はUTF-8で携帯に送出されること' do
73
73
  visit "/#{controller}/abracadabra_utf8"
74
74
  expect(page.body.encode('UTF-8')).to have_content('アブラカダブラ')
75
- expect(page.response_headers['Content-Type']).to match(/utf-8/i)
75
+ expect(extract_response_header(page, 'Content-Type')).to match(/utf-8/i)
76
76
  end
77
77
  it 'はxhtmlでもUTF-8で携帯に送出されること' do
78
78
  visit "/#{controller}/abracadabra_xhtml_utf8"
79
79
  expect(page.body.encode('UTF-8')).to have_content('アブラカダブラ')
80
- expect(page.response_headers['Content-Type']).to match(/utf-8/i)
80
+ expect(extract_response_header(page, 'Content-Type')).to match(/utf-8/i)
81
81
  end
82
82
  it 'はparamsにUTF-8のまま格納されること' do
83
83
  visit "/#{controller}/index_zenkaku?q=#{CGI.escape("アブラカダブラ")}"
@@ -94,7 +94,7 @@ describe 'jpmobile integration spec', type: :feature do
94
94
  it 'は半角に変換されShift_JISで携帯に送出されること' do
95
95
  visit "/#{controller}/abracadabra_utf8"
96
96
  expect(page.body.encode('UTF-8')).to have_content('アブラカダブラ') # アブラカダブラ半角,SJIS
97
- expect(page.response_headers['Content-Type']).to match(/Shift_JIS/)
97
+ expect(extract_response_header(page, 'Content-Type')).to match(/Shift_JIS/)
98
98
  end
99
99
  it 'はShift_JISで渡されたパラメタがparamsにUTF-8に変換されて格納されること' do
100
100
  visit "/#{controller}/index_zenkaku?q=#{CGI.escape(utf8_to_sjis("アブラカダブラ"))}"
@@ -112,7 +112,7 @@ describe 'jpmobile integration spec', type: :feature do
112
112
  it 'はUTF-8半角で携帯に送出されること' do
113
113
  visit "/#{controller}/abracadabra_utf8"
114
114
  expect(page.body.encode('UTF-8')).to have_content('アブラカダブラ')
115
- expect(page.response_headers['Content-Type']).to match(/utf-8/i)
115
+ expect(extract_response_header(page, 'Content-Type')).to match(/utf-8/i)
116
116
  end
117
117
  it 'はparamsにUTF-8のまま格納されること' do
118
118
  visit "/#{controller}/index_zenkaku?q=#{CGI.escape("アブラカダブラ")}"
@@ -223,7 +223,7 @@ describe 'jpmobile integration spec', type: :feature do
223
223
 
224
224
  it 'Content-Type が UTF-8 であること' do
225
225
  visit "/#{controller}/with_charset"
226
- expect(page.response_headers['Content-Type']).to match(/UTF-8/i)
226
+ expect(extract_response_header(page, 'Content-Type')).to match(/UTF-8/i)
227
227
  end
228
228
  end
229
229
  end
@@ -1,3 +1,7 @@
1
1
  require 'rails_helper'
2
2
 
3
- Dir[File.join(__dir__, 'system/support/**/*.rb')].sort.each {|file| require file }
3
+ Dir[File.join(__dir__, 'system/support/**/*.rb')].each {|file| require file }
4
+
5
+ def extract_response_header(page, header)
6
+ page.response_headers[header] || page.response_headers[header.downcase]
7
+ end
@@ -8,6 +8,7 @@ require 'jpmobile/sinatra'
8
8
 
9
9
  class SinatraTestHelper
10
10
  include Singleton
11
+
11
12
  attr_accessor :last_app
12
13
  end
13
14
 
@@ -23,7 +24,7 @@ class Guestbook < Jpmobile::Sinatra::Base
23
24
  end
24
25
 
25
26
  def assigns(sym)
26
- instance_variable_get("@#{sym}")
27
+ instance_variable_get(:"@#{sym}")
27
28
  end
28
29
 
29
30
  get '/' do
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jpmobile
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.1.0
4
+ version: 8.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shin-ichiro OGAWA
8
8
  - Yoji Shidara
9
- autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2023-10-06 00:00:00.000000000 Z
11
+ date: 1980-01-02 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: mail
@@ -17,28 +16,14 @@ dependencies:
17
16
  requirements:
18
17
  - - "~>"
19
18
  - !ruby/object:Gem::Version
20
- version: 2.7.0
19
+ version: 2.8.0
21
20
  type: :runtime
22
21
  prerelease: false
23
22
  version_requirements: !ruby/object:Gem::Requirement
24
23
  requirements:
25
24
  - - "~>"
26
25
  - !ruby/object:Gem::Version
27
- version: 2.7.0
28
- - !ruby/object:Gem::Dependency
29
- name: rexml
30
- requirement: !ruby/object:Gem::Requirement
31
- requirements:
32
- - - ">="
33
- - !ruby/object:Gem::Version
34
- version: '0'
35
- type: :runtime
36
- prerelease: false
37
- version_requirements: !ruby/object:Gem::Requirement
38
- requirements:
39
- - - ">="
40
- - !ruby/object:Gem::Version
41
- version: '0'
26
+ version: 2.8.0
42
27
  - !ruby/object:Gem::Dependency
43
28
  name: scanf
44
29
  requirement: !ruby/object:Gem::Requirement
@@ -332,10 +317,7 @@ files:
332
317
  - tools/e4u_conv.rb
333
318
  - tools/emoji/genregexp.rb
334
319
  - tools/emoji4unicode.xml
335
- - tools/generate_au_emoticon_table.rb
336
- - tools/generate_docomo_emoticon_table.rb
337
320
  - tools/generate_emoticon_conversion_table.rb
338
- - tools/generate_softbank_emoticon_table.rb
339
321
  - tools/list_gps_unsupported_au.rb
340
322
  homepage: https://jpmobile-rails.org
341
323
  licenses:
@@ -344,7 +326,6 @@ metadata:
344
326
  source_code_uri: https://github.com/jpmobile/jpmobile
345
327
  documentation_uri: https://github.com/jpmobile/jpmobile
346
328
  rubygems_mfa_required: 'true'
347
- post_install_message:
348
329
  rdoc_options: []
349
330
  require_paths:
350
331
  - lib
@@ -352,15 +333,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
352
333
  requirements:
353
334
  - - ">="
354
335
  - !ruby/object:Gem::Version
355
- version: 2.7.0
336
+ version: 3.2.0
356
337
  required_rubygems_version: !ruby/object:Gem::Requirement
357
338
  requirements:
358
339
  - - ">="
359
340
  - !ruby/object:Gem::Version
360
341
  version: '0'
361
342
  requirements: []
362
- rubygems_version: 3.4.10
363
- signing_key:
343
+ rubygems_version: 3.6.9
364
344
  specification_version: 4
365
345
  summary: Rails plugin for mobile devices in Japan
366
346
  test_files: []
@@ -1,34 +0,0 @@
1
- #!/usr/bin/ruby
2
-
3
- # http://www.au.kddi.com/ezfactory/tec/spec/pdf/typeD.pdf から生成
4
- # - OSXのpreviewで開き、すべてを選択してコピーし、テキストファイルに落とす
5
- # - http://moriq.tdiary.net/20070212.html#p01
6
- # などの手段によって生成する。
7
-
8
- table = []
9
- open("au.txt") do |f|
10
- f.each do |l|
11
- l.chomp!
12
- l.scan( /(([0-9A-F] )+)/ ) do |s|
13
- s = s[0].gsub!(/ /, "")
14
- next if s.size < 16
15
- out = s[s.size-16,16]
16
- table << a = [0,4,8,12].map{|i| out[i,4]}
17
- end
18
- end
19
- end
20
-
21
- open(File.dirname(__FILE__)+"/../lib/jpmobile/emoticon/au.rb","w") do |f|
22
- f.puts "Jpmobile::Emoticon::AU_SJIS_TO_UNICODE = {"
23
- table.each do |a|
24
- f.puts " 0x%s=>0x%s," % [a[0],a[1]]
25
- end
26
- f.puts "}.freeze"
27
- f.puts "Jpmobile::Emoticon::AU_UNICODE_TO_SJIS = Jpmobile::Emoticon::AU_SJIS_TO_UNICODE.invert.freeze"
28
- # EmailJIS -> UNICODE
29
- f.puts "Jpmobile::Emoticon::AU_EMAILJIS_TO_UNICODE = {"
30
- table.each do |a|
31
- f.puts " 0x%s=>0x%s," % [a[2],a[1]]
32
- end
33
- f.puts "}.freeze"
34
- end
@@ -1,33 +0,0 @@
1
- require 'rubygems'
2
- require 'hpricot'
3
- require 'open-uri'
4
- require 'cgi'
5
-
6
- $KCODE="u"
7
-
8
- def parse(html)
9
- results = []
10
- (Hpricot(html)/"//table//tr").each do |tr|
11
- tds = (tr/:td/:span)
12
- if tds && tds.size > 0
13
- results << tds.map {|td| CGI.unescapeHTML(td.inner_html)}
14
- end
15
- end
16
- results
17
- end
18
-
19
- table = []
20
- %w(basic extention).each do |x|
21
- uri = "http://www.nttdocomo.co.jp/service/imode/make/content/pictograph/#{x}/index.html"
22
- table += parse(URI(uri).read.toutf8)
23
- end
24
-
25
-
26
- open(File.dirname(__FILE__)+"/../lib/jpmobile/emoticon/docomo.rb","w") do |f|
27
- f.puts "Jpmobile::Emoticon::DOCOMO_SJIS_TO_UNICODE = {"
28
- table.each do |row|
29
- f.puts " 0x%s=>0x%s, "%[row[1], row[3]]
30
- end
31
- f.puts "}.freeze"
32
- f.puts "Jpmobile::Emoticon::DOCOMO_UNICODE_TO_SJIS = Jpmobile::Emoticon::DOCOMO_SJIS_TO_UNICODE.invert.freeze"
33
- end
@@ -1,31 +0,0 @@
1
- require 'rubygems'
2
- require 'hpricot'
3
- require 'cgi'
4
- require 'open-uri'
5
-
6
- # 'http://developers.softbankmobile.co.jp/dp/tool_dl/web/picword_01.php'
7
-
8
- table = []
9
- for i in 1..6
10
- uri = "http://developers.softbankmobile.co.jp/dp/tool_dl/web/picword_%02d.php" % i
11
- h = Hpricot(URI(uri).read.toutf8)
12
- (h/"//table[@width='100%']//tr").each do |tr|
13
- if tr
14
- a = (tr/"td/font[@class='j10']").map { |td| td.inner_html }
15
- unless a.empty?
16
- s = CGI.unescapeHTML(a.last)
17
- raise Exception, "something is wrong" if s[0,2] != "\x1b\x24" || s[4] != 0x0f
18
- table << [a.first, s[2,2]]
19
- end
20
- end
21
- end
22
- end
23
-
24
- open(File.dirname(__FILE__)+"/../lib/jpmobile/emoticon/softbank.rb","w") do |f|
25
- f.puts "Jpmobile::Emoticon::SOFTBANK_UNICODE_TO_WEBCODE = {"
26
- table.each do |a|
27
- f.puts %{ 0x%s => %p,} % a
28
- end
29
- f.puts "}"
30
- f.puts "Jpmobile::Emoticon::SOFTBANK_WEBCODE_TO_UNICODE = Jpmobile::Emoticon::SOFTBANK_UNICODE_TO_WEBCODE.invert"
31
- end