jpmobile 0.1.6 → 1.0.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/README +0 -0
- data/README.rdoc +58 -29
- data/Rakefile +1 -1
- data/VERSION.yml +4 -4
- data/lib/jpmobile.rb +3 -0
- data/lib/jpmobile/email.rb +17 -2
- data/lib/jpmobile/emoticon.rb +87 -23
- data/lib/jpmobile/emoticon/au.rb +644 -0
- data/lib/jpmobile/emoticon/softbank.rb +488 -0
- data/lib/jpmobile/emoticon/z_combine.rb +16 -13
- data/lib/jpmobile/hook_action_controller.rb +1 -13
- data/lib/jpmobile/hook_action_view.rb +3 -62
- data/lib/jpmobile/mail.rb +316 -0
- data/lib/jpmobile/mailer.rb +31 -0
- data/lib/jpmobile/mobile/abstract_mobile.rb +66 -0
- data/lib/jpmobile/mobile/au.rb +25 -2
- data/lib/jpmobile/mobile/docomo.rb +23 -1
- data/lib/jpmobile/mobile/emobile.rb +1 -1
- data/lib/jpmobile/mobile/softbank.rb +33 -1
- data/lib/jpmobile/mobile/vodafone.rb +1 -1
- data/lib/jpmobile/mobile/willcom.rb +1 -1
- data/lib/jpmobile/path_set.rb +40 -0
- data/lib/jpmobile/rails.rb +24 -0
- data/lib/jpmobile/resolver.rb +38 -0
- data/lib/jpmobile/util.rb +223 -14
- data/lib/tasks/jpmobile_tasks.rake +41 -48
- data/spec/rack/jpmobile/emoticon_spec.rb +3 -8
- data/spec/rack/jpmobile/filter_spec.rb +1 -1
- data/spec/rack/jpmobile/params_filter_spec.rb +4 -4
- data/spec/rack_helper.rb +5 -9
- data/spec/unit/detect_by_email_spec.rb +29 -0
- data/spec/unit/emoticon_spec.rb +90 -0
- data/spec/unit/encoding_spec.rb +102 -0
- data/spec/unit/mail_spec.rb +117 -0
- data/spec/unit/receive_mail_spec.rb +289 -0
- data/spec/unit/spec_helper.rb +8 -0
- data/spec/unit/util_spec.rb +5 -0
- data/test/rails/overrides/app/controllers/application_controller.rb +3 -2
- data/test/rails/overrides/app/controllers/template_path_controller.rb +8 -0
- data/test/rails/overrides/app/models/mobile_mailer.rb +19 -0
- data/test/rails/overrides/app/models/normal_mailer.rb +9 -0
- data/test/rails/overrides/spec/models/mobile_mailer_spec.rb +737 -0
- data/test/rails/overrides/spec/models/normal_mailer_spec.rb +34 -0
- data/test/rails/overrides/spec/requests/template_path_spec.rb +13 -7
- data/test/rails/overrides/spec/spec_helper.rb +6 -0
- data/test/rails/rails_root/app/controllers/application_controller.rb +3 -2
- data/test/rails/rails_root/app/controllers/template_path_controller.rb +8 -0
- data/test/rails/rails_root/app/models/mobile_mailer.rb +2 -1
- data/test/rails/rails_root/app/models/normal_mailer.rb +9 -0
- data/test/rails/rails_root/config/initializers/secret_token.rb +1 -1
- data/test/rails/rails_root/spec/models/mobile_mailer_spec.rb +73 -80
- data/test/rails/rails_root/spec/models/normal_mailer_spec.rb +34 -0
- data/test/rails/rails_root/spec/requests/template_path_spec.rb +13 -7
- data/test/rails/rails_root/spec/spec_helper.rb +1 -1
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile.rb +2 -1
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/emoticon.rb +7 -5
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/hook_action_controller.rb +1 -13
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/hook_action_view.rb +3 -62
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mail.rb +162 -111
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mailer.rb +31 -0
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mobile/abstract_mobile.rb +34 -3
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mobile/au.rb +2 -5
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mobile/docomo.rb +4 -5
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mobile/softbank.rb +7 -8
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/path_set.rb +40 -0
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/rack/params_filter.rb +1 -1
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/rails.rb +24 -0
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/resolver.rb +38 -0
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/util.rb +33 -23
- metadata +43 -14
- data/test/legacy/emoticon_test.rb +0 -63
- data/test/legacy/helper.rb +0 -8
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/hook_action_mailer.rb +0 -22
@@ -0,0 +1,31 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require 'jpmobile/mail'
|
3
|
+
|
4
|
+
module Jpmobile
|
5
|
+
module Mailer
|
6
|
+
class Base < ActionMailer::Base
|
7
|
+
self._view_paths = self._view_paths.dup
|
8
|
+
self.view_paths.unshift(Jpmobile::Resolver.new(File.join(::Rails.root, "app/views")))
|
9
|
+
|
10
|
+
def mail(headers={}, &block)
|
11
|
+
tos = headers[:to].split(/,/)
|
12
|
+
|
13
|
+
@mobile = if tos.size == 1
|
14
|
+
# for mobile
|
15
|
+
(Jpmobile::Email.detect(tos.first) || Jpmobile::Mobile::AbstractMobile).new(nil, nil)
|
16
|
+
else
|
17
|
+
# for multi to addresses
|
18
|
+
Jpmobile::Mobile::AbstractMobile.new(nil, nil)
|
19
|
+
end
|
20
|
+
self.lookup_context.mobile = @mobile.variants
|
21
|
+
|
22
|
+
m = super(headers, &block)
|
23
|
+
|
24
|
+
m.mobile = @mobile
|
25
|
+
m.charset = @mobile.mail_charset
|
26
|
+
|
27
|
+
m
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -4,6 +4,9 @@ require 'ipaddr'
|
|
4
4
|
module Jpmobile::Mobile
|
5
5
|
# 携帯電話の抽象クラス。
|
6
6
|
class AbstractMobile
|
7
|
+
# メールのデフォルトのcharset
|
8
|
+
MAIL_CHARSET = "ISO-2022-JP"
|
9
|
+
|
7
10
|
def initialize(env, request)
|
8
11
|
@env = env
|
9
12
|
@request = request
|
@@ -66,6 +69,29 @@ module Jpmobile::Mobile
|
|
66
69
|
"UTF-8"
|
67
70
|
end
|
68
71
|
|
72
|
+
# for view selector
|
73
|
+
def variants
|
74
|
+
return @_variants if @_variants
|
75
|
+
|
76
|
+
@_variants = self.class.ancestors.select {|c| c.to_s =~ /^Jpmobile/}.map do |klass|
|
77
|
+
klass = klass.to_s.
|
78
|
+
gsub(/Jpmobile::/, '').
|
79
|
+
gsub(/AbstractMobile::/, '').
|
80
|
+
gsub(/Mobile::SmartPhone/, 'smart_phone').
|
81
|
+
gsub(/::/, '_').
|
82
|
+
gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2').
|
83
|
+
gsub(/([a-z\d])([A-Z])/, '\1_\2').
|
84
|
+
downcase
|
85
|
+
klass =~ /abstract/ ? "mobile" : klass
|
86
|
+
end
|
87
|
+
|
88
|
+
if @_variants.include?("smart_phone")
|
89
|
+
@_variants = @_variants.reject{|v| v == "mobile"}.map{|v| v.gsub(/mobile/, "smart_phone")}
|
90
|
+
end
|
91
|
+
|
92
|
+
@_variants
|
93
|
+
end
|
94
|
+
|
69
95
|
# メール送信用
|
70
96
|
def to_mail_subject(str)
|
71
97
|
"=?#{mail_charset}?B?" + [to_mail_encoding(str)].pack('m').strip + "?="
|
@@ -73,8 +99,8 @@ module Jpmobile::Mobile
|
|
73
99
|
def to_mail_body(str)
|
74
100
|
to_mail_encoding(str)
|
75
101
|
end
|
76
|
-
def mail_charset
|
77
|
-
"
|
102
|
+
def mail_charset(charset = nil)
|
103
|
+
(charset.nil? or charset == "") ? self.class::MAIL_CHARSET : charset
|
78
104
|
end
|
79
105
|
def to_mail_encoding(str)
|
80
106
|
str = Jpmobile::Emoticon.unicodecr_to_external(str, Jpmobile::Emoticon::CONVERSION_TABLE_TO_PC_EMAIL, false)
|
@@ -90,7 +116,7 @@ module Jpmobile::Mobile
|
|
90
116
|
str
|
91
117
|
end
|
92
118
|
end
|
93
|
-
def to_mail_internal(str,
|
119
|
+
def to_mail_internal(str, charset)
|
94
120
|
str
|
95
121
|
end
|
96
122
|
def to_mail_subject_encoded?(str)
|
@@ -99,6 +125,11 @@ module Jpmobile::Mobile
|
|
99
125
|
def to_mail_body_encoded?(str)
|
100
126
|
Jpmobile::Util.jis?(str)
|
101
127
|
end
|
128
|
+
def decode_transfer_encoding(body, charset)
|
129
|
+
body = Jpmobile::Util.set_encoding(body, charset)
|
130
|
+
body = to_mail_internal(body, nil)
|
131
|
+
Jpmobile::Util.force_encode(body, charset, Jpmobile::Util::UTF8)
|
132
|
+
end
|
102
133
|
|
103
134
|
# リクエストがこのクラスに属するか調べる
|
104
135
|
# メソッド名に関して非常に不安
|
@@ -111,12 +111,9 @@ module Jpmobile::Mobile
|
|
111
111
|
def to_mail_body(str)
|
112
112
|
to_mail_encoding(str)
|
113
113
|
end
|
114
|
-
def mail_charset
|
115
|
-
"ISO-2022-JP"
|
116
|
-
end
|
117
114
|
|
118
|
-
def to_mail_internal(str,
|
119
|
-
if Jpmobile::Util.jis?(str) or Jpmobile::Util.ascii_8bit?(str)
|
115
|
+
def to_mail_internal(str, charset)
|
116
|
+
if Jpmobile::Util.jis?(str) or Jpmobile::Util.ascii_8bit?(str) or charset == mail_charset
|
120
117
|
# 絵文字を数値参照に変換
|
121
118
|
str = Jpmobile::Emoticon.external_to_unicodecr_au_mail(Jpmobile::Util.jis(str))
|
122
119
|
str = Jpmobile::Util.jis_to_utf8(Jpmobile::Util.jis(str))
|
@@ -8,6 +8,8 @@ module Jpmobile::Mobile
|
|
8
8
|
USER_AGENT_REGEXP = /^DoCoMo/
|
9
9
|
# 対応するメールアドレスの正規表現
|
10
10
|
MAIL_ADDRESS_REGEXP = /.+@docomo\.ne\.jp/
|
11
|
+
# メールのデフォルトのcharset
|
12
|
+
MAIL_CHARSET = "Shift_JIS"
|
11
13
|
|
12
14
|
# オープンiエリアがあればエリアコードを +String+ で返す。無ければ +nil+ を返す。
|
13
15
|
def areacode
|
@@ -102,11 +104,8 @@ module Jpmobile::Mobile
|
|
102
104
|
def to_mail_body(str)
|
103
105
|
to_external(str, nil, nil).first
|
104
106
|
end
|
105
|
-
def
|
106
|
-
|
107
|
-
end
|
108
|
-
def to_mail_internal(str, val)
|
109
|
-
if Jpmobile::Util.shift_jis?(str) or Jpmobile::Util.ascii_8bit?(str)
|
107
|
+
def to_mail_internal(str, charset)
|
108
|
+
if Jpmobile::Util.shift_jis?(str) or Jpmobile::Util.ascii_8bit?(str) or charset == mail_charset
|
110
109
|
# 絵文字を数値参照に変換
|
111
110
|
str = Jpmobile::Emoticon.external_to_unicodecr_docomo(Jpmobile::Util.sjis(str))
|
112
111
|
end
|
@@ -9,6 +9,8 @@ module Jpmobile::Mobile
|
|
9
9
|
USER_AGENT_REGEXP = /^(?:SoftBank|Semulator)/
|
10
10
|
# 対応するメールアドレスの正規表現 ディズニーモバイル対応
|
11
11
|
MAIL_ADDRESS_REGEXP = /.+@(?:softbank\.ne\.jp|disney\.ne\.jp)/
|
12
|
+
# メールのデフォルトのcharset
|
13
|
+
MAIL_CHARSET = "Shift_JIS"
|
12
14
|
|
13
15
|
# 製造番号を返す。無ければ +nil+ を返す。
|
14
16
|
def serial_number
|
@@ -66,17 +68,14 @@ module Jpmobile::Mobile
|
|
66
68
|
def to_mail_body(str)
|
67
69
|
to_mail_encoding(str)
|
68
70
|
end
|
69
|
-
def
|
70
|
-
"Shift_JIS"
|
71
|
-
end
|
72
|
-
def to_mail_internal(str, val)
|
71
|
+
def to_mail_internal(str, charset)
|
73
72
|
# 絵文字を数値参照に変換
|
74
|
-
if Jpmobile::Util.
|
75
|
-
# Shift_JIS
|
76
|
-
str = Jpmobile::Emoticon.external_to_unicodecr_softbank_sjis(Jpmobile::Util.sjis(str))
|
77
|
-
elsif Jpmobile::Util.utf8?(str)
|
73
|
+
if Jpmobile::Util.utf8?(str) or charset == "UTF-8"
|
78
74
|
# UTF-8
|
79
75
|
str = Jpmobile::Emoticon.external_to_unicodecr_softbank(Jpmobile::Util.utf8(str))
|
76
|
+
elsif Jpmobile::Util.shift_jis?(str) or Jpmobile::Util.ascii_8bit?(str) or charset == mail_charset
|
77
|
+
# Shift_JIS
|
78
|
+
str = Jpmobile::Emoticon.external_to_unicodecr_softbank_sjis(Jpmobile::Util.sjis(str))
|
80
79
|
end
|
81
80
|
|
82
81
|
str
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module Jpmobile
|
2
|
+
class PathSet < Array
|
3
|
+
%w(initialize << concat insert push unshift).each do |method|
|
4
|
+
class_eval <<-METHOD, __FILE__, __LINE__ + 1
|
5
|
+
def #{method}(*args)
|
6
|
+
super
|
7
|
+
typecast!
|
8
|
+
end
|
9
|
+
METHOD
|
10
|
+
end
|
11
|
+
|
12
|
+
def find(path, prefix = nil, partial = false, details = {}, key = nil)
|
13
|
+
template = find_all(path, prefix, partial, details, key).first
|
14
|
+
raise MissingTemplate.new(self, "#{prefix}/#{path}", details, partial) unless template
|
15
|
+
template
|
16
|
+
end
|
17
|
+
|
18
|
+
def find_all(*args)
|
19
|
+
each do |resolver|
|
20
|
+
templates = resolver.find_all(*args)
|
21
|
+
return templates unless templates.empty?
|
22
|
+
end
|
23
|
+
[]
|
24
|
+
end
|
25
|
+
|
26
|
+
def exists?(*args)
|
27
|
+
find_all(*args).any?
|
28
|
+
end
|
29
|
+
|
30
|
+
protected
|
31
|
+
|
32
|
+
def typecast!
|
33
|
+
each_with_index do |path, i|
|
34
|
+
path = path.to_s if path.is_a?(Pathname)
|
35
|
+
next unless path.is_a?(String)
|
36
|
+
self[i] = Jpmobile::Resolver.new(path)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -21,3 +21,27 @@ ActiveSupport.on_load(:before_configuration) do
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
24
|
+
|
25
|
+
module Jpmobile
|
26
|
+
module ViewSelector
|
27
|
+
def self.included(base)
|
28
|
+
base.class_eval do
|
29
|
+
before_filter :register_mobile
|
30
|
+
|
31
|
+
self._view_paths = self._view_paths.dup
|
32
|
+
self.view_paths.unshift(Jpmobile::Resolver.new(File.join(Rails.root, "app/views")))
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def register_mobile
|
37
|
+
if request.mobile
|
38
|
+
# register mobile
|
39
|
+
self.lookup_context.mobile = request.mobile.variants
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
def disable_mobile_view!
|
44
|
+
self.lookup_context.mobile = nil
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
module Jpmobile
|
2
|
+
class Resolver < ActionView::FileSystemResolver
|
3
|
+
# EXTENSION_ORDER = [:variants, :locale, :formats, :handlers]
|
4
|
+
|
5
|
+
def find_templates(name, prefix, partial, details)
|
6
|
+
path = build_path(name, prefix, partial, details)
|
7
|
+
query(path, EXTENSION_ORDER.map { |ext| details[ext] }, details[:formats], details[:mobile])
|
8
|
+
end
|
9
|
+
|
10
|
+
def build_path(name, prefix, partial, details)
|
11
|
+
path = ""
|
12
|
+
path << "#{prefix}/" unless prefix.empty?
|
13
|
+
path << (partial ? "_#{name}" : name)
|
14
|
+
path
|
15
|
+
end
|
16
|
+
|
17
|
+
def query(path, exts, formats, mobile)
|
18
|
+
query = File.join(@path, path)
|
19
|
+
query << '{' << mobile.map {|v| "_#{v}"}.join(',') << ',}' if mobile and mobile.respond_to?(:map)
|
20
|
+
|
21
|
+
exts.each do |ext|
|
22
|
+
query << '{' << ext.map {|e| e && ".#{e}" }.join(',') << ',}'
|
23
|
+
end
|
24
|
+
|
25
|
+
query.gsub!(/\{\.html,/, "{.html,.text.html,")
|
26
|
+
query.gsub!(/\{\.text,/, "{.text,.text.plain,")
|
27
|
+
|
28
|
+
Dir[query].reject { |p| File.directory?(p) }.map do |p|
|
29
|
+
handler, format = extract_handler_and_format(p, formats)
|
30
|
+
|
31
|
+
contents = File.open(p, "rb") {|io| io.read }
|
32
|
+
|
33
|
+
ActionView::Template.new(contents, File.expand_path(p), handler,
|
34
|
+
:virtual_path => path, :format => format)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -54,29 +54,29 @@ module Jpmobile
|
|
54
54
|
new_obj
|
55
55
|
end
|
56
56
|
|
57
|
-
def sjis(
|
58
|
-
if
|
59
|
-
|
57
|
+
def sjis(str)
|
58
|
+
if str.respond_to?(:force_encoding) and !shift_jis?(str)
|
59
|
+
str.force_encoding(SJIS)
|
60
60
|
end
|
61
|
-
|
61
|
+
str
|
62
62
|
end
|
63
63
|
|
64
|
-
def utf8(
|
65
|
-
if
|
66
|
-
|
64
|
+
def utf8(str)
|
65
|
+
if str.respond_to?(:force_encoding) and !utf8?(str)
|
66
|
+
str.force_encoding(UTF8)
|
67
67
|
end
|
68
|
-
|
68
|
+
str
|
69
69
|
end
|
70
70
|
|
71
|
-
def jis(
|
72
|
-
if
|
73
|
-
|
71
|
+
def jis(str)
|
72
|
+
if str.respond_to?(:force_encoding) and !jis?(str)
|
73
|
+
str.force_encoding(JIS)
|
74
74
|
end
|
75
|
-
|
75
|
+
str
|
76
76
|
end
|
77
77
|
|
78
78
|
def ascii_8bit(str)
|
79
|
-
if str.respond_to?(:force_encoding)
|
79
|
+
if str.respond_to?(:force_encoding) and !ascii_8bit?(str)
|
80
80
|
str.force_encoding(BINARY)
|
81
81
|
end
|
82
82
|
str
|
@@ -157,25 +157,34 @@ module Jpmobile
|
|
157
157
|
jis_str = jis.kind_of?(Numeric) ? [jis].pack('n') : jis
|
158
158
|
|
159
159
|
if Object.const_defined?(:Encoding)
|
160
|
-
Regexp.compile(Regexp.escape(jis_str.force_encoding("stateless-ISO-2022-JP-KDDI"))) # for au only
|
160
|
+
# Regexp.compile(Regexp.escape(jis_str.force_encoding("stateless-ISO-2022-JP-KDDI"))) # for au only
|
161
|
+
Regexp.compile(Regexp.escape(jis_str.force_encoding(BINARY))) # for au only
|
161
162
|
else
|
162
163
|
Regexp.compile(Regexp.escape(jis_str,"j"),nil,'j')
|
163
164
|
end
|
164
165
|
end
|
165
166
|
|
167
|
+
def jis_string_regexp
|
168
|
+
Regexp.compile(Regexp.escape(ascii_8bit("\x1b\x24\x42")) + "(.+)" + Regexp.escape(ascii_8bit("\x1b\x28\x42")))
|
169
|
+
end
|
170
|
+
|
166
171
|
def encode(str, charset)
|
167
172
|
if Object.const_defined?(:Encoding)
|
168
|
-
str.encode(charset)
|
173
|
+
(charset.nil? or charset == "" or str.nil? or str == "") ? str : str.encode(charset)
|
169
174
|
else
|
170
|
-
|
171
|
-
when /iso-2022-jp/i
|
172
|
-
NKF.nkf("-j", str)
|
173
|
-
when /shift_jis/i
|
174
|
-
NKF.nkf("-s", str)
|
175
|
-
when /utf-8/i
|
176
|
-
NKF.nkf("-w", str)
|
177
|
-
else
|
175
|
+
if str.nil?
|
178
176
|
str
|
177
|
+
else
|
178
|
+
case charset
|
179
|
+
when /iso-2022-jp/i
|
180
|
+
NKF.nkf("-j", str)
|
181
|
+
when /shift_jis/i
|
182
|
+
NKF.nkf("-s", str)
|
183
|
+
when /utf-8/i
|
184
|
+
NKF.nkf("-w", str)
|
185
|
+
else
|
186
|
+
str
|
187
|
+
end
|
179
188
|
end
|
180
189
|
end
|
181
190
|
end
|
@@ -233,6 +242,7 @@ module Jpmobile
|
|
233
242
|
def set_encoding(str, encoding)
|
234
243
|
if encoding and Object.const_defined?(:Encoding)
|
235
244
|
encoding = SJIS if encoding =~ /shift_jis/i
|
245
|
+
|
236
246
|
str.force_encoding(encoding)
|
237
247
|
end
|
238
248
|
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jpmobile
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
4
|
+
prerelease: true
|
5
5
|
segments:
|
6
|
-
- 0
|
7
6
|
- 1
|
8
|
-
-
|
9
|
-
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- pre
|
10
|
+
version: 1.0.0.pre
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Yoji Shidara
|
@@ -15,7 +16,7 @@ autorequire:
|
|
15
16
|
bindir: bin
|
16
17
|
cert_chain: []
|
17
18
|
|
18
|
-
date: 2011-01-
|
19
|
+
date: 2011-01-28 00:00:00 +09:00
|
19
20
|
default_executable:
|
20
21
|
dependencies:
|
21
22
|
- !ruby/object:Gem::Dependency
|
@@ -270,11 +271,13 @@ executables: []
|
|
270
271
|
extensions: []
|
271
272
|
|
272
273
|
extra_rdoc_files:
|
274
|
+
- README
|
273
275
|
- README.rdoc
|
274
276
|
files:
|
275
277
|
- CHANGELOG
|
276
278
|
- Gemfile
|
277
279
|
- MIT-LICENSE
|
280
|
+
- README
|
278
281
|
- README.rdoc
|
279
282
|
- Rakefile
|
280
283
|
- VERSION.yml
|
@@ -295,6 +298,8 @@ files:
|
|
295
298
|
- lib/jpmobile/helpers.rb
|
296
299
|
- lib/jpmobile/hook_action_controller.rb
|
297
300
|
- lib/jpmobile/hook_action_view.rb
|
301
|
+
- lib/jpmobile/mail.rb
|
302
|
+
- lib/jpmobile/mailer.rb
|
298
303
|
- lib/jpmobile/mobile/abstract_mobile.rb
|
299
304
|
- lib/jpmobile/mobile/android.rb
|
300
305
|
- lib/jpmobile/mobile/au.rb
|
@@ -307,6 +312,7 @@ files:
|
|
307
312
|
- lib/jpmobile/mobile/vodafone.rb
|
308
313
|
- lib/jpmobile/mobile/willcom.rb
|
309
314
|
- lib/jpmobile/mobile/windows_phone.rb
|
315
|
+
- lib/jpmobile/path_set.rb
|
310
316
|
- lib/jpmobile/position.rb
|
311
317
|
- lib/jpmobile/rack.rb
|
312
318
|
- lib/jpmobile/rack/filter.rb
|
@@ -314,6 +320,7 @@ files:
|
|
314
320
|
- lib/jpmobile/rack/params_filter.rb
|
315
321
|
- lib/jpmobile/rails.rb
|
316
322
|
- lib/jpmobile/request_with_mobile.rb
|
323
|
+
- lib/jpmobile/resolver.rb
|
317
324
|
- lib/jpmobile/trans_sid.rb
|
318
325
|
- lib/jpmobile/util.rb
|
319
326
|
- lib/tasks/jpmobile_tasks.rake
|
@@ -337,12 +344,14 @@ files:
|
|
337
344
|
- spec/rack_helper.rb
|
338
345
|
- spec/spec_helper.rb
|
339
346
|
- spec/unit/detect_by_email_spec.rb
|
347
|
+
- spec/unit/emoticon_spec.rb
|
348
|
+
- spec/unit/encoding_spec.rb
|
340
349
|
- spec/unit/is_carrier_spec.rb
|
350
|
+
- spec/unit/mail_spec.rb
|
351
|
+
- spec/unit/receive_mail_spec.rb
|
341
352
|
- spec/unit/spec_helper.rb
|
342
353
|
- spec/unit/util_spec.rb
|
343
354
|
- spec/unit/valid_ip_spec.rb
|
344
|
-
- test/legacy/emoticon_test.rb
|
345
|
-
- test/legacy/helper.rb
|
346
355
|
- test/rails/overrides/app/controllers/application_controller.rb
|
347
356
|
- test/rails/overrides/app/controllers/docomo_guid_always_controller.rb
|
348
357
|
- test/rails/overrides/app/controllers/docomo_guid_base_controller.rb
|
@@ -360,6 +369,8 @@ files:
|
|
360
369
|
- test/rails/overrides/app/controllers/trans_sid_metal_controller.rb
|
361
370
|
- test/rails/overrides/app/controllers/trans_sid_mobile_controller.rb
|
362
371
|
- test/rails/overrides/app/controllers/trans_sid_none_controller.rb
|
372
|
+
- test/rails/overrides/app/models/mobile_mailer.rb
|
373
|
+
- test/rails/overrides/app/models/normal_mailer.rb
|
363
374
|
- test/rails/overrides/app/models/user.rb
|
364
375
|
- test/rails/overrides/autotest/discover.rb
|
365
376
|
- test/rails/overrides/config/initializers/jpmobile_generator.rb
|
@@ -367,6 +378,8 @@ files:
|
|
367
378
|
- test/rails/overrides/db/migrate/001_add_sessions_table.rb
|
368
379
|
- test/rails/overrides/db/migrate/20100824062306_create_users.rb
|
369
380
|
- test/rails/overrides/spec/helpers/helpers_spec.rb
|
381
|
+
- test/rails/overrides/spec/models/mobile_mailer_spec.rb
|
382
|
+
- test/rails/overrides/spec/models/normal_mailer_spec.rb
|
370
383
|
- test/rails/overrides/spec/requests/docomo_guid_spec.rb
|
371
384
|
- test/rails/overrides/spec/requests/docomo_spec.rb
|
372
385
|
- test/rails/overrides/spec/requests/emobile_spec.rb
|
@@ -396,6 +409,7 @@ files:
|
|
396
409
|
- test/rails/rails_root/app/controllers/trans_sid_none_controller.rb
|
397
410
|
- test/rails/rails_root/app/helpers/application_helper.rb
|
398
411
|
- test/rails/rails_root/app/models/mobile_mailer.rb
|
412
|
+
- test/rails/rails_root/app/models/normal_mailer.rb
|
399
413
|
- test/rails/rails_root/app/models/user.rb
|
400
414
|
- test/rails/rails_root/autotest/discover.rb
|
401
415
|
- test/rails/rails_root/config/application.rb
|
@@ -417,6 +431,7 @@ files:
|
|
417
431
|
- test/rails/rails_root/db/seeds.rb
|
418
432
|
- test/rails/rails_root/spec/helpers/helpers_spec.rb
|
419
433
|
- test/rails/rails_root/spec/models/mobile_mailer_spec.rb
|
434
|
+
- test/rails/rails_root/spec/models/normal_mailer_spec.rb
|
420
435
|
- test/rails/rails_root/spec/requests/docomo_guid_spec.rb
|
421
436
|
- test/rails/rails_root/spec/requests/docomo_spec.rb
|
422
437
|
- test/rails/rails_root/spec/requests/emobile_spec.rb
|
@@ -457,9 +472,9 @@ files:
|
|
457
472
|
- test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/filter.rb
|
458
473
|
- test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/helpers.rb
|
459
474
|
- test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/hook_action_controller.rb
|
460
|
-
- test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/hook_action_mailer.rb
|
461
475
|
- test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/hook_action_view.rb
|
462
476
|
- test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mail.rb
|
477
|
+
- test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mailer.rb
|
463
478
|
- test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mobile/abstract_mobile.rb
|
464
479
|
- test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mobile/android.rb
|
465
480
|
- test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mobile/au.rb
|
@@ -472,6 +487,7 @@ files:
|
|
472
487
|
- test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mobile/vodafone.rb
|
473
488
|
- test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mobile/willcom.rb
|
474
489
|
- test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mobile/windows_phone.rb
|
490
|
+
- test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/path_set.rb
|
475
491
|
- test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/position.rb
|
476
492
|
- test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/rack.rb
|
477
493
|
- test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/rack/filter.rb
|
@@ -479,6 +495,7 @@ files:
|
|
479
495
|
- test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/rack/params_filter.rb
|
480
496
|
- test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/rails.rb
|
481
497
|
- test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/request_with_mobile.rb
|
498
|
+
- test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/resolver.rb
|
482
499
|
- test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/trans_sid.rb
|
483
500
|
- test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/util.rb
|
484
501
|
- test/rails/rails_root/vendor/plugins/jpmobile/tmp/conversion-table.rb
|
@@ -523,11 +540,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
523
540
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
524
541
|
none: false
|
525
542
|
requirements:
|
526
|
-
- - "
|
543
|
+
- - ">"
|
527
544
|
- !ruby/object:Gem::Version
|
528
545
|
segments:
|
529
|
-
-
|
530
|
-
|
546
|
+
- 1
|
547
|
+
- 3
|
548
|
+
- 1
|
549
|
+
version: 1.3.1
|
531
550
|
requirements: []
|
532
551
|
|
533
552
|
rubyforge_project:
|
@@ -550,12 +569,14 @@ test_files:
|
|
550
569
|
- spec/rack_helper.rb
|
551
570
|
- spec/spec_helper.rb
|
552
571
|
- spec/unit/detect_by_email_spec.rb
|
572
|
+
- spec/unit/emoticon_spec.rb
|
573
|
+
- spec/unit/encoding_spec.rb
|
553
574
|
- spec/unit/is_carrier_spec.rb
|
575
|
+
- spec/unit/mail_spec.rb
|
576
|
+
- spec/unit/receive_mail_spec.rb
|
554
577
|
- spec/unit/spec_helper.rb
|
555
578
|
- spec/unit/util_spec.rb
|
556
579
|
- spec/unit/valid_ip_spec.rb
|
557
|
-
- test/legacy/emoticon_test.rb
|
558
|
-
- test/legacy/helper.rb
|
559
580
|
- test/rails/overrides/app/controllers/application_controller.rb
|
560
581
|
- test/rails/overrides/app/controllers/docomo_guid_always_controller.rb
|
561
582
|
- test/rails/overrides/app/controllers/docomo_guid_base_controller.rb
|
@@ -573,6 +594,8 @@ test_files:
|
|
573
594
|
- test/rails/overrides/app/controllers/trans_sid_metal_controller.rb
|
574
595
|
- test/rails/overrides/app/controllers/trans_sid_mobile_controller.rb
|
575
596
|
- test/rails/overrides/app/controllers/trans_sid_none_controller.rb
|
597
|
+
- test/rails/overrides/app/models/mobile_mailer.rb
|
598
|
+
- test/rails/overrides/app/models/normal_mailer.rb
|
576
599
|
- test/rails/overrides/app/models/user.rb
|
577
600
|
- test/rails/overrides/autotest/discover.rb
|
578
601
|
- test/rails/overrides/config/initializers/jpmobile_generator.rb
|
@@ -580,6 +603,8 @@ test_files:
|
|
580
603
|
- test/rails/overrides/db/migrate/001_add_sessions_table.rb
|
581
604
|
- test/rails/overrides/db/migrate/20100824062306_create_users.rb
|
582
605
|
- test/rails/overrides/spec/helpers/helpers_spec.rb
|
606
|
+
- test/rails/overrides/spec/models/mobile_mailer_spec.rb
|
607
|
+
- test/rails/overrides/spec/models/normal_mailer_spec.rb
|
583
608
|
- test/rails/overrides/spec/requests/docomo_guid_spec.rb
|
584
609
|
- test/rails/overrides/spec/requests/docomo_spec.rb
|
585
610
|
- test/rails/overrides/spec/requests/emobile_spec.rb
|
@@ -609,6 +634,7 @@ test_files:
|
|
609
634
|
- test/rails/rails_root/app/controllers/trans_sid_none_controller.rb
|
610
635
|
- test/rails/rails_root/app/helpers/application_helper.rb
|
611
636
|
- test/rails/rails_root/app/models/mobile_mailer.rb
|
637
|
+
- test/rails/rails_root/app/models/normal_mailer.rb
|
612
638
|
- test/rails/rails_root/app/models/user.rb
|
613
639
|
- test/rails/rails_root/autotest/discover.rb
|
614
640
|
- test/rails/rails_root/config/application.rb
|
@@ -630,6 +656,7 @@ test_files:
|
|
630
656
|
- test/rails/rails_root/db/seeds.rb
|
631
657
|
- test/rails/rails_root/spec/helpers/helpers_spec.rb
|
632
658
|
- test/rails/rails_root/spec/models/mobile_mailer_spec.rb
|
659
|
+
- test/rails/rails_root/spec/models/normal_mailer_spec.rb
|
633
660
|
- test/rails/rails_root/spec/requests/docomo_guid_spec.rb
|
634
661
|
- test/rails/rails_root/spec/requests/docomo_spec.rb
|
635
662
|
- test/rails/rails_root/spec/requests/emobile_spec.rb
|
@@ -670,9 +697,9 @@ test_files:
|
|
670
697
|
- test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/filter.rb
|
671
698
|
- test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/helpers.rb
|
672
699
|
- test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/hook_action_controller.rb
|
673
|
-
- test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/hook_action_mailer.rb
|
674
700
|
- test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/hook_action_view.rb
|
675
701
|
- test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mail.rb
|
702
|
+
- test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mailer.rb
|
676
703
|
- test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mobile/abstract_mobile.rb
|
677
704
|
- test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mobile/android.rb
|
678
705
|
- test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mobile/au.rb
|
@@ -685,6 +712,7 @@ test_files:
|
|
685
712
|
- test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mobile/vodafone.rb
|
686
713
|
- test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mobile/willcom.rb
|
687
714
|
- test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mobile/windows_phone.rb
|
715
|
+
- test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/path_set.rb
|
688
716
|
- test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/position.rb
|
689
717
|
- test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/rack.rb
|
690
718
|
- test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/rack/filter.rb
|
@@ -692,6 +720,7 @@ test_files:
|
|
692
720
|
- test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/rack/params_filter.rb
|
693
721
|
- test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/rails.rb
|
694
722
|
- test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/request_with_mobile.rb
|
723
|
+
- test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/resolver.rb
|
695
724
|
- test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/trans_sid.rb
|
696
725
|
- test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/util.rb
|
697
726
|
- test/rails/rails_root/vendor/plugins/jpmobile/tmp/conversion-table.rb
|