jpmobile 7.1.0 → 8.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +2 -2
  3. data/.rubocop.yml +48 -3
  4. data/.ruby-version +1 -1
  5. data/Gemfile +1 -4
  6. data/Gemfile.lock +164 -172
  7. data/jpmobile.gemspec +2 -2
  8. data/lib/jpmobile/email.rb +1 -1
  9. data/lib/jpmobile/emoticon.rb +1 -2
  10. data/lib/jpmobile/fallback_view_selector.rb +2 -2
  11. data/lib/jpmobile/filter.rb +1 -1
  12. data/lib/jpmobile/helpers.rb +1 -1
  13. data/lib/jpmobile/hook_template_details_requested.rb +1 -1
  14. data/lib/jpmobile/mail.rb +22 -24
  15. data/lib/jpmobile/mailer.rb +4 -4
  16. data/lib/jpmobile/method_less_action_support.rb +3 -3
  17. data/lib/jpmobile/mobile/abstract_mobile.rb +8 -8
  18. data/lib/jpmobile/mobile/android.rb +1 -1
  19. data/lib/jpmobile/mobile/au.rb +2 -2
  20. data/lib/jpmobile/mobile/black_berry.rb +1 -1
  21. data/lib/jpmobile/mobile/ddipocket.rb +1 -1
  22. data/lib/jpmobile/mobile/docomo.rb +2 -2
  23. data/lib/jpmobile/mobile/emobile.rb +2 -2
  24. data/lib/jpmobile/mobile/ipad.rb +1 -1
  25. data/lib/jpmobile/mobile/iphone.rb +1 -1
  26. data/lib/jpmobile/mobile/softbank.rb +2 -2
  27. data/lib/jpmobile/mobile/vodafone.rb +2 -2
  28. data/lib/jpmobile/mobile/willcom.rb +2 -2
  29. data/lib/jpmobile/mobile/windows_phone.rb +1 -1
  30. data/lib/jpmobile/path_set.rb +1 -1
  31. data/lib/jpmobile/rack/filter.rb +2 -0
  32. data/lib/jpmobile/request_with_mobile.rb +1 -1
  33. data/lib/jpmobile/resolver.rb +1 -1
  34. data/lib/jpmobile/session/active_record_store.rb +1 -1
  35. data/lib/jpmobile/session/mem_cache_store.rb +1 -1
  36. data/lib/jpmobile/template_details.rb +1 -1
  37. data/lib/jpmobile/trans_sid.rb +1 -1
  38. data/lib/jpmobile/version.rb +1 -1
  39. data/lib/jpmobile/view_selector.rb +2 -2
  40. data/lib/tasks/jpmobile_tasks.rake +2 -2
  41. data/spec/rack_helper.rb +0 -1
  42. data/spec/unit/email_spec.rb +2 -2
  43. data/spec/unit/is_carrier_spec.rb +1 -1
  44. data/spec/unit/receive_mail_spec.rb +1 -1
  45. data/spec/unit/util_spec.rb +0 -1
  46. data/test/rails/overrides/Gemfile.jpmobile +1 -1
  47. data/test/rails/overrides/spec/controllers/hankaku_filter_controller_spec.rb +1 -1
  48. data/test/rails/overrides/spec/controllers/helpers_spec.rb +1 -1
  49. data/test/rails/overrides/spec/rails_helper.rb +3 -1
  50. data/test/rails/overrides/spec/requests/method_less_action_support_spec.rb +1 -1
  51. data/test/rails/overrides/spec/system/filter_spec.rb +8 -8
  52. data/test/rails/overrides/spec/system_helper.rb +5 -1
  53. data/test/sinatra/guestbook.rb +1 -1
  54. metadata +6 -9
  55. data/tools/generate_au_emoticon_table.rb +0 -34
  56. data/tools/generate_docomo_emoticon_table.rb +0 -33
  57. data/tools/generate_softbank_emoticon_table.rb +0 -31
@@ -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
@@ -23,7 +23,7 @@ class Guestbook < Jpmobile::Sinatra::Base
23
23
  end
24
24
 
25
25
  def assigns(sym)
26
- instance_variable_get("@#{sym}")
26
+ instance_variable_get(:"@#{sym}")
27
27
  end
28
28
 
29
29
  get '/' do
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: 7.1.0
4
+ version: 8.0.0
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: 2023-10-06 00:00:00.000000000 Z
12
+ date: 2024-11-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mail
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: 2.7.0
20
+ version: 2.8.0
21
21
  type: :runtime
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: 2.7.0
27
+ version: 2.8.0
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: rexml
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -332,10 +332,7 @@ files:
332
332
  - tools/e4u_conv.rb
333
333
  - tools/emoji/genregexp.rb
334
334
  - tools/emoji4unicode.xml
335
- - tools/generate_au_emoticon_table.rb
336
- - tools/generate_docomo_emoticon_table.rb
337
335
  - tools/generate_emoticon_conversion_table.rb
338
- - tools/generate_softbank_emoticon_table.rb
339
336
  - tools/list_gps_unsupported_au.rb
340
337
  homepage: https://jpmobile-rails.org
341
338
  licenses:
@@ -352,14 +349,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
352
349
  requirements:
353
350
  - - ">="
354
351
  - !ruby/object:Gem::Version
355
- version: 2.7.0
352
+ version: 3.2.0
356
353
  required_rubygems_version: !ruby/object:Gem::Requirement
357
354
  requirements:
358
355
  - - ">="
359
356
  - !ruby/object:Gem::Version
360
357
  version: '0'
361
358
  requirements: []
362
- rubygems_version: 3.4.10
359
+ rubygems_version: 3.5.22
363
360
  signing_key:
364
361
  specification_version: 4
365
362
  summary: Rails plugin for mobile devices in Japan
@@ -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