jpmobile 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  :major: 2
3
3
  :minor: 0
4
- :patch: 0
4
+ :patch: 1
5
5
  :build: !!null
@@ -11,7 +11,8 @@ module Jpmobile
11
11
  self.view_paths.unshift(Jpmobile::Resolver.new(File.join(::Rails.root, "app/views")))
12
12
 
13
13
  def mail(headers={}, &block)
14
- tos = headers[:to].split(/,/)
14
+ tos = headers[:to] || self.default_params[:to]
15
+ tos = tos.split(/,/)
15
16
 
16
17
  @mobile = if tos.size == 1
17
18
  # for mobile
@@ -1,6 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  class MobileMailer < Jpmobile::Mailer::Base
3
3
  default :from => "info@jp.mobile"
4
+ default :to => "info@jp.mobile"
4
5
 
5
6
  def view_selection(to_mail, subject_text, text)
6
7
  @text = text
@@ -16,4 +17,9 @@ class MobileMailer < Jpmobile::Mailer::Base
16
17
  @text = text
17
18
  mail(:to => to_mail, :subject => subject_text)
18
19
  end
20
+
21
+ def default_to_mail(subject_text, text)
22
+ @text = text
23
+ mail(:subject => subject_text)
24
+ end
19
25
  end
@@ -52,6 +52,14 @@ describe MobileMailer do
52
52
  raw_mail = ascii_8bit(email.to_s)
53
53
  raw_mail.should match(/ZVG%0FE%16%5E%07%04%21P%5CZ%06%00%0D%1D%40L/)
54
54
  end
55
+
56
+ context ":toの指定が" do
57
+ it "ない場合でも正常に送信できること" do
58
+ email = MobileMailer.default_to_mail('題名', '本文').deliver
59
+
60
+ ActionMailer::Base.deliveries.size.should == 1
61
+ end
62
+ end
55
63
  end
56
64
 
57
65
  describe "PC宛に送るとき" 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: 2.0.0
4
+ version: 2.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2011-09-01 00:00:00.000000000Z
13
+ date: 2011-09-05 00:00:00.000000000Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: jeweler
17
- requirement: &13235520 !ruby/object:Gem::Requirement
17
+ requirement: &23576180 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: '0'
23
23
  type: :development
24
24
  prerelease: false
25
- version_requirements: *13235520
25
+ version_requirements: *23576180
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: rails
28
- requirement: &13235040 !ruby/object:Gem::Requirement
28
+ requirement: &23575080 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: 3.1.0
34
34
  type: :development
35
35
  prerelease: false
36
- version_requirements: *13235040
36
+ version_requirements: *23575080
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: rspec
39
- requirement: &13234560 !ruby/object:Gem::Requirement
39
+ requirement: &23574220 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ! '>='
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: '0'
45
45
  type: :development
46
46
  prerelease: false
47
- version_requirements: *13234560
47
+ version_requirements: *23574220
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: rspec-rails
50
- requirement: &13097940 !ruby/object:Gem::Requirement
50
+ requirement: &23573240 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ! '>='
@@ -55,10 +55,10 @@ dependencies:
55
55
  version: '0'
56
56
  type: :development
57
57
  prerelease: false
58
- version_requirements: *13097940
58
+ version_requirements: *23573240
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: webrat
61
- requirement: &13097360 !ruby/object:Gem::Requirement
61
+ requirement: &23572300 !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
64
64
  - - ! '>='
@@ -66,10 +66,10 @@ dependencies:
66
66
  version: '0'
67
67
  type: :development
68
68
  prerelease: false
69
- version_requirements: *13097360
69
+ version_requirements: *23572300
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: geokit
72
- requirement: &13096760 !ruby/object:Gem::Requirement
72
+ requirement: &23571660 !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
75
75
  - - ! '>='
@@ -77,10 +77,10 @@ dependencies:
77
77
  version: '0'
78
78
  type: :development
79
79
  prerelease: false
80
- version_requirements: *13096760
80
+ version_requirements: *23571660
81
81
  - !ruby/object:Gem::Dependency
82
82
  name: sqlite3-ruby
83
- requirement: &13096180 !ruby/object:Gem::Requirement
83
+ requirement: &23570480 !ruby/object:Gem::Requirement
84
84
  none: false
85
85
  requirements:
86
86
  - - ! '>='
@@ -88,10 +88,10 @@ dependencies:
88
88
  version: '0'
89
89
  type: :development
90
90
  prerelease: false
91
- version_requirements: *13096180
91
+ version_requirements: *23570480
92
92
  - !ruby/object:Gem::Dependency
93
93
  name: hpricot
94
- requirement: &13095580 !ruby/object:Gem::Requirement
94
+ requirement: &23569620 !ruby/object:Gem::Requirement
95
95
  none: false
96
96
  requirements:
97
97
  - - ! '>='
@@ -99,10 +99,10 @@ dependencies:
99
99
  version: '0'
100
100
  type: :development
101
101
  prerelease: false
102
- version_requirements: *13095580
102
+ version_requirements: *23569620
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: rails
105
- requirement: &13094980 !ruby/object:Gem::Requirement
105
+ requirement: &23568620 !ruby/object:Gem::Requirement
106
106
  none: false
107
107
  requirements:
108
108
  - - ! '>='
@@ -110,10 +110,10 @@ dependencies:
110
110
  version: 3.1.0
111
111
  type: :development
112
112
  prerelease: false
113
- version_requirements: *13094980
113
+ version_requirements: *23568620
114
114
  - !ruby/object:Gem::Dependency
115
115
  name: jeweler
116
- requirement: &13094460 !ruby/object:Gem::Requirement
116
+ requirement: &23565280 !ruby/object:Gem::Requirement
117
117
  none: false
118
118
  requirements:
119
119
  - - ! '>='
@@ -121,10 +121,10 @@ dependencies:
121
121
  version: 1.5.1
122
122
  type: :development
123
123
  prerelease: false
124
- version_requirements: *13094460
124
+ version_requirements: *23565280
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: rspec
127
- requirement: &13093880 !ruby/object:Gem::Requirement
127
+ requirement: &23564200 !ruby/object:Gem::Requirement
128
128
  none: false
129
129
  requirements:
130
130
  - - ! '>='
@@ -132,10 +132,10 @@ dependencies:
132
132
  version: 2.6.0
133
133
  type: :development
134
134
  prerelease: false
135
- version_requirements: *13093880
135
+ version_requirements: *23564200
136
136
  - !ruby/object:Gem::Dependency
137
137
  name: rspec-rails
138
- requirement: &13093280 !ruby/object:Gem::Requirement
138
+ requirement: &23561920 !ruby/object:Gem::Requirement
139
139
  none: false
140
140
  requirements:
141
141
  - - ! '>='
@@ -143,10 +143,10 @@ dependencies:
143
143
  version: 2.6.0
144
144
  type: :development
145
145
  prerelease: false
146
- version_requirements: *13093280
146
+ version_requirements: *23561920
147
147
  - !ruby/object:Gem::Dependency
148
148
  name: webrat
149
- requirement: &13092700 !ruby/object:Gem::Requirement
149
+ requirement: &23561000 !ruby/object:Gem::Requirement
150
150
  none: false
151
151
  requirements:
152
152
  - - ! '>='
@@ -154,10 +154,10 @@ dependencies:
154
154
  version: 0.7.2
155
155
  type: :development
156
156
  prerelease: false
157
- version_requirements: *13092700
157
+ version_requirements: *23561000
158
158
  - !ruby/object:Gem::Dependency
159
159
  name: geokit
160
- requirement: &13092140 !ruby/object:Gem::Requirement
160
+ requirement: &23559820 !ruby/object:Gem::Requirement
161
161
  none: false
162
162
  requirements:
163
163
  - - ! '>='
@@ -165,10 +165,10 @@ dependencies:
165
165
  version: 1.5.0
166
166
  type: :development
167
167
  prerelease: false
168
- version_requirements: *13092140
168
+ version_requirements: *23559820
169
169
  - !ruby/object:Gem::Dependency
170
170
  name: sqlite3-ruby
171
- requirement: &13091660 !ruby/object:Gem::Requirement
171
+ requirement: &23559020 !ruby/object:Gem::Requirement
172
172
  none: false
173
173
  requirements:
174
174
  - - ! '>='
@@ -176,10 +176,10 @@ dependencies:
176
176
  version: 1.3.2
177
177
  type: :development
178
178
  prerelease: false
179
- version_requirements: *13091660
179
+ version_requirements: *23559020
180
180
  - !ruby/object:Gem::Dependency
181
181
  name: hpricot
182
- requirement: &13091180 !ruby/object:Gem::Requirement
182
+ requirement: &23557960 !ruby/object:Gem::Requirement
183
183
  none: false
184
184
  requirements:
185
185
  - - ! '>='
@@ -187,10 +187,10 @@ dependencies:
187
187
  version: 0.8.3
188
188
  type: :development
189
189
  prerelease: false
190
- version_requirements: *13091180
190
+ version_requirements: *23557960
191
191
  - !ruby/object:Gem::Dependency
192
192
  name: git
193
- requirement: &13090700 !ruby/object:Gem::Requirement
193
+ requirement: &23487920 !ruby/object:Gem::Requirement
194
194
  none: false
195
195
  requirements:
196
196
  - - ! '>='
@@ -198,7 +198,7 @@ dependencies:
198
198
  version: 1.2.5
199
199
  type: :development
200
200
  prerelease: false
201
- version_requirements: *13090700
201
+ version_requirements: *23487920
202
202
  description: A Rails plugin for Japanese mobile-phones
203
203
  email: dara@shidara.net
204
204
  executables: []