jpmobile 2.0.11 → 3.0.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 (53) hide show
  1. data/Gemfile +3 -4
  2. data/README.rdoc +5 -12
  3. data/Rakefile +1 -1
  4. data/VERSION.yml +2 -2
  5. data/jpmobile.gemspec +3 -2
  6. data/lib/jpmobile.rb +1 -15
  7. data/lib/jpmobile/emoticon.rb +2 -65
  8. data/lib/jpmobile/emoticon/z_combine.rb +1 -17
  9. data/lib/jpmobile/lookup_context.rb +1 -1
  10. data/lib/jpmobile/mail.rb +29 -59
  11. data/lib/jpmobile/mailer.rb +1 -1
  12. data/lib/jpmobile/mobile/abstract_mobile.rb +36 -60
  13. data/lib/jpmobile/mobile/android.rb +0 -2
  14. data/lib/jpmobile/mobile/iphone.rb +25 -1
  15. data/lib/jpmobile/rack.rb +1 -6
  16. data/lib/jpmobile/rails.rb +2 -2
  17. data/lib/jpmobile/resolver.rb +18 -13
  18. data/lib/jpmobile/trans_sid.rb +9 -8
  19. data/lib/jpmobile/util.rb +1 -54
  20. data/lib/tasks/jpmobile_tasks.rake +4 -4
  21. data/spec/rack/jpmobile/emoticon_spec.rb +0 -167
  22. data/spec/rack/jpmobile/mobile_by_ua_spec.rb +1 -5
  23. data/spec/unit/emoticon_spec.rb +0 -60
  24. data/spec/unit/mail_spec.rb +0 -86
  25. data/spec/unit/receive_mail_spec.rb +0 -46
  26. data/spec/unit/util_spec.rb +0 -43
  27. data/test/rails/overrides/Gemfile +4 -19
  28. data/test/rails/overrides/app/controllers/template_path_controller.rb +0 -12
  29. data/test/rails/overrides/spec/mailers/mobile_mailer_spec.rb +0 -10
  30. data/test/rails/overrides/spec/requests/template_path_spec.rb +0 -72
  31. metadata +43 -166
  32. data/lib/jpmobile/emoticon/google.rb +0 -2421
  33. data/lib/jpmobile/emoticon/unicode.rb +0 -2253
  34. data/lib/jpmobile/mobile/android_tablet.rb +0 -12
  35. data/lib/jpmobile/mobile/black_berry.rb +0 -10
  36. data/lib/jpmobile/mobile/google_emoticon.rb +0 -29
  37. data/lib/jpmobile/mobile/ipad.rb +0 -12
  38. data/lib/jpmobile/mobile/tablet.rb +0 -16
  39. data/lib/jpmobile/mobile/unicode_emoticon.rb +0 -43
  40. data/spec/rack/jpmobile/black_berry_spec.rb +0 -20
  41. data/spec/unit/email-fixtures/bounce_with_utf8_part.eml +0 -42
  42. data/spec/unit/email-fixtures/iphone-mail3.eml +0 -56
  43. data/spec/unit/email-fixtures/iphone-message.eml +0 -27
  44. data/spec/unit/mobile/iphone_spec.rb +0 -34
  45. data/spec/unit/variants_spec.rb +0 -128
  46. data/test/rails/overrides/app/views/template_path/smart_phone_only.html.erb +0 -1
  47. data/test/rails/overrides/app/views/template_path/smart_phone_only_smart_phone.html.erb +0 -1
  48. data/test/rails/overrides/app/views/template_path/with_ipd.html.erb +0 -1
  49. data/test/rails/overrides/app/views/template_path/with_ipd_tablet_ipad.html.erb +0 -1
  50. data/test/rails/overrides/app/views/template_path/with_tblt.html.erb +0 -1
  51. data/test/rails/overrides/app/views/template_path/with_tblt_tablet.html.erb +0 -1
  52. data/test/rails/overrides/spec/fixtures/mobile_mailer/bounced-jp.eml +0 -72
  53. data/tools/e4u_conv.rb +0 -122
@@ -1 +0,0 @@
1
- <h1>smart_phone_only.html.erb</h1>
@@ -1 +0,0 @@
1
- <h1>smart_phone_only_smart_phone.html.erb</h1>
@@ -1 +0,0 @@
1
- <h1>with_ipd.html.erb</h1>
@@ -1 +0,0 @@
1
- <h1>with_ipd_tablet_ipad.html.erb</h1>
@@ -1 +0,0 @@
1
- <h1>with_tblt.html.erb</h1>
@@ -1 +0,0 @@
1
- <h1>with_tblt_tablet.html.erb</h1>
@@ -1,72 +0,0 @@
1
- Return-Path: <>
2
- X-Original-To: info@example.jp
3
- Delivered-To: info@example.jp
4
- Received: by localhost (Postfix)
5
- id 081F8161D92; Fri, 17 Aug 2012 23:05:01 +0900 (JST)
6
- Date: Fri, 17 Aug 2012 23:05:01 +0900 (JST)
7
- From: MAILER-DAEMON@example.jp (Mail Delivery System)
8
- Subject: Undelivered Mail Returned to Sender
9
- To: info@example.jp
10
- Auto-Submitted: auto-replied
11
- MIME-Version: 1.0
12
- Content-Type: multipart/report; report-type=delivery-status;
13
- boundary="EAE03161D91.1345212301/localhost"
14
- Message-Id: <20120817140501.081F8161D92@localhost>
15
-
16
- This is a MIME-encapsulated message.
17
-
18
- --EAE03161D91.1345212301/localhost
19
- Content-Description: Notification
20
- Content-Type: text/plain; charset=us-ascii
21
-
22
- This is the mail system at host localhost.
23
-
24
- I'm sorry to have to inform you that your message could not
25
- be delivered to one or more recipients. It's attached below.
26
-
27
- For further assistance, please send mail to postmaster.
28
-
29
- If you do so, please include this problem report. You can
30
- delete your own text from the attached returned message.
31
-
32
- The mail system
33
-
34
- <unknown@docomo.ne.jp>: host mfsmax.docomo.ne.jp[203.138.181.112] said: 550
35
- Unknown user unknown@docomo.ne.jp (in reply to end of DATA command)
36
-
37
- --EAE03161D91.1345212301/localhost
38
- Content-Description: Delivery report
39
- Content-Type: message/delivery-status
40
-
41
- Reporting-MTA: dns; localhost
42
- X-Postfix-Queue-ID: EAE03161D91
43
- X-Postfix-Sender: rfc822; info@example.jp
44
- Arrival-Date: Fri, 17 Aug 2012 23:05:00 +0900 (JST)
45
-
46
- Final-Recipient: rfc822; unknown@docomo.ne.jp
47
- Action: failed
48
- Status: 5.0.0
49
- Remote-MTA: dns; mfsmax.docomo.ne.jp
50
- Diagnostic-Code: smtp; 550 Unknown user unknown@docomo.ne.jp
51
-
52
- --EAE03161D91.1345212301/localhost
53
- Content-Description: Undelivered Message
54
- Content-Type: message/rfc822
55
-
56
- Return-Path: <info@example.jp>
57
- Received: by localhost (Postfix, from userid 1004)
58
- id EAE03161D91; Fri, 17 Aug 2012 23:05:00 +0900 (JST)
59
- Date: Fri, 17 Aug 2012 23:05:00 +0900
60
- From: info@example.jp
61
- To: unknown@docomo.ne.jp
62
- Message-ID: <502e4f8c8dc0a_1ed1cbf30467885@mail>
63
- Subject: =?Shift_JIS?B?dGVzdA==?=
64
- Mime-Version: 1.0
65
- Content-Type: text/plain;
66
- charset=Shift_JIS
67
- Content-Transfer-Encoding: 7bit
68
-
69
- test
70
-
71
- --EAE03161D91.1345212301/localhost--
72
-
data/tools/e4u_conv.rb DELETED
@@ -1,122 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- require 'nokogiri'
3
- require 'scanf'
4
- require 'pp'
5
-
6
- xml = Nokogiri::XML(open(File.join(File.dirname(__FILE__), 'emoji4unicode.xml')).read)
7
-
8
- google_docomo = []
9
- google_kddi = []
10
- google_softbank = []
11
- unicode_docomo = []
12
- unicode_kddi = []
13
- unicode_softbank = []
14
-
15
- xml.xpath('//e').each do |emoji|
16
- # keycode
17
- google = emoji.attributes['google'].value rescue nil
18
- unicode = emoji.attributes['unicode'].value rescue nil
19
-
20
- # carrier code
21
- docomo = emoji.attributes['docomo'].value rescue '3013'
22
- softbank = emoji.attributes['softbank'].value rescue '3013'
23
- kddi = emoji.attributes['kddi'].value rescue '3013'
24
-
25
- # fix google key
26
- google = nil if google and google.match(/[^0-9a-fA-F\+]/)
27
- # fix unicode key
28
- if unicode
29
- if unicode.match(/\+/)
30
- unicodes = unicode.split(/\+/).delete_if{|e| e.strip == ''}
31
- if unicodes.size == 1
32
- unicode = '0x%s' % unicodes.first
33
- else
34
- unicode = '[' + unicodes.map{|e| '0x%s' % e.gsub(/[^0-9a-fA-F\+]/, '')}.join(', ') + ']'
35
- end
36
- else
37
- unicode = '0x%s' % unicode
38
- end
39
- end
40
-
41
- # fix docomo code
42
- if docomo.match(/\+/)
43
- docomo = '"' + docomo.split('+').map{|e| '&#x%s;' % e.gsub(/[^0-9a-fA-F\+]/, '')}.join('') + '"'
44
- else
45
- docomo = '0x%s' % docomo.gsub(/[^0-9a-fA-F]/, '')
46
- end
47
- # fix softbank code
48
- if softbank.match(/\+/)
49
- softbank = '"' + softbank.split('+').delete_if{|e| e.strip == ''}.map{|s| '&#x%X;' % (s.gsub(/[^0-9a-fA-F\+]/, '').scanf("%x").first + 0x1000)}.join('') + '"'
50
- else
51
- if softbank.match(/3013/)
52
- softbank = '0x%s' % softbank
53
- else
54
- softbank = '0x%X' % (softbank.gsub(/[^0-9a-fA-F]/, '').scanf('%x').first + 0x1000)
55
- end
56
- end
57
- # fix kddi code
58
- if kddi.match(/\+/)
59
- kddi = '"' + kddi.split('+').map{|e| '&#x%s;' % e.gsub(/[^0-9a-fA-F\+]/, '')}.join('') + '"'
60
- else
61
- kddi = '0x%s' % kddi.gsub(/[^0-9a-fA-F]/, '')
62
- end
63
-
64
- if google
65
- google_docomo << [google, docomo]
66
- google_kddi << [google, kddi]
67
- google_softbank << [google, softbank]
68
- end
69
-
70
- if unicode
71
- # Unicode 絵文字は SoftBank に寄せる
72
- unicode_docomo << [unicode, docomo]
73
- unicode_kddi << [unicode, kddi]
74
- unicode_softbank << [unicode, softbank]
75
- end
76
- end
77
-
78
- google_emoji_rb = open(File.join(File.dirname(__FILE__), '/../lib/jpmobile/emoticon/google.rb'), 'w') do |f|
79
- # docomo
80
- f.puts 'Jpmobile::Emoticon::GOOGLE_TO_DOCOMO_UNICODE = {'
81
- google_docomo.each do |google, docomo|
82
- f.puts " 0x%s => %s," % [google, docomo]
83
- end
84
- f.puts '}'
85
-
86
- # kddi
87
- f.puts 'Jpmobile::Emoticon::GOOGLE_TO_AU_UNICODE = {'
88
- google_kddi.each do |google, kddi|
89
- f.puts " 0x%s => %s," % [google, kddi]
90
- end
91
- f.puts '}'
92
-
93
- # softbank
94
- f.puts 'Jpmobile::Emoticon::GOOGLE_TO_SOFTBANK_UNICODE = {'
95
- google_softbank.each do |google, softbank|
96
- f.puts " 0x%s => %s," % [google, softbank]
97
- end
98
- f.puts '}'
99
- end
100
-
101
- unicode_emoji_rb = open(File.join(File.dirname(__FILE__), '/../lib/jpmobile/emoticon/unicode.rb'), 'w') do |f|
102
- # docomo
103
- f.puts 'Jpmobile::Emoticon::UNICODE_TO_DOCOMO_UNICODE = {'
104
- unicode_docomo.each do |unicode, docomo|
105
- f.puts " %s => %s," % [unicode, docomo]
106
- end
107
- f.puts '}'
108
-
109
- # docomo
110
- f.puts 'Jpmobile::Emoticon::UNICODE_TO_AU_UNICODE = {'
111
- unicode_kddi.each do |unicode, kddi|
112
- f.puts " %s => %s," % [unicode, kddi]
113
- end
114
- f.puts '}'
115
-
116
- # softbank
117
- f.puts 'Jpmobile::Emoticon::UNICODE_TO_SOFTBANK_UNICODE = {'
118
- unicode_softbank.each do |unicode, softbank|
119
- f.puts " %s => %s," % [unicode, softbank]
120
- end
121
- f.puts '}'
122
- end