mack-notifier 0.7.0.1 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- data/doc/classes/Mack/Notifier/Adapters/Tmail.html +45 -36
- data/doc/classes/Mack/Notifier/DeliveryHandlers/{SendMail.html → Sendmail.html} +8 -8
- data/doc/classes/Mack/Notifier/DeliveryHandlers/Smtp.html +6 -6
- data/doc/classes/Mack/Notifier/DeliveryHandlers/Test.html +9 -9
- data/doc/classes/Mack/Notifier/Validatable.html +40 -40
- data/doc/classes/Mack/Paths.html +2 -2
- data/doc/created.rid +1 -1
- data/doc/files/README.html +1 -1
- data/doc/files/lib/mack-notifier/adapters/base_rb.html +1 -1
- data/doc/files/lib/mack-notifier/adapters/tmail_rb.html +1 -1
- data/doc/files/lib/mack-notifier/attachment_rb.html +1 -1
- data/doc/files/lib/mack-notifier/delivery_handlers/sendmail_rb.html +1 -1
- data/doc/files/lib/mack-notifier/delivery_handlers/smtp_rb.html +1 -1
- data/doc/files/lib/mack-notifier/delivery_handlers/test_rb.html +1 -1
- data/doc/files/lib/mack-notifier/errors_rb.html +1 -1
- data/doc/files/lib/mack-notifier/loader_rb.html +1 -1
- data/doc/files/lib/mack-notifier/notifier_generator/notifier_generator_rb.html +1 -1
- data/doc/files/lib/mack-notifier/notifier_rb.html +1 -1
- data/doc/files/lib/mack-notifier/paths_rb.html +1 -1
- data/doc/files/lib/mack-notifier/rendering/type/mailer_rb.html +1 -1
- data/doc/files/lib/mack-notifier/settings_rb.html +1 -1
- data/doc/files/lib/mack-notifier/testing_rb.html +7 -7
- data/doc/files/lib/mack-notifier/validations_rb.html +1 -1
- data/doc/files/lib/mack-notifier_rb.html +1 -1
- data/doc/fr_class_index.html +1 -1
- data/doc/fr_method_index.html +13 -13
- data/lib/mack-notifier/adapters/tmail.rb +10 -1
- data/lib/mack-notifier/delivery_handlers/sendmail.rb +5 -1
- data/lib/mack-notifier/delivery_handlers/test.rb +3 -3
- data/lib/mack-notifier/paths.rb +2 -2
- data/lib/mack-notifier/testing.rb +6 -4
- metadata +3 -3
@@ -95,9 +95,9 @@ TMail object.
|
|
95
95
|
<h3 class="section-bar">Methods</h3>
|
96
96
|
|
97
97
|
<div class="name-list">
|
98
|
-
<a href="#
|
99
|
-
<a href="#
|
100
|
-
<a href="#
|
98
|
+
<a href="#M000031">convert</a>
|
99
|
+
<a href="#M000030">deliverable</a>
|
100
|
+
<a href="#M000029">transformed</a>
|
101
101
|
</div>
|
102
102
|
</div>
|
103
103
|
|
@@ -119,11 +119,11 @@ TMail object.
|
|
119
119
|
<div id="methods">
|
120
120
|
<h3 class="section-bar">Public Instance methods</h3>
|
121
121
|
|
122
|
-
<div id="method-
|
123
|
-
<a name="
|
122
|
+
<div id="method-M000031" class="method-detail">
|
123
|
+
<a name="M000031"></a>
|
124
124
|
|
125
125
|
<div class="method-heading">
|
126
|
-
<a href="#
|
126
|
+
<a href="#M000031" class="method-signature">
|
127
127
|
<span class="method-name">convert</span><span class="method-args">()</span>
|
128
128
|
</a>
|
129
129
|
</div>
|
@@ -134,8 +134,8 @@ Converts the <a href="../../Notifier.html">Mack::Notifier</a> object to a
|
|
134
134
|
TMail object.
|
135
135
|
</p>
|
136
136
|
<p><a class="source-toggle" href="#"
|
137
|
-
onclick="toggleCode('
|
138
|
-
<div class="method-source-code" id="
|
137
|
+
onclick="toggleCode('M000031-source');return false;">[Source]</a></p>
|
138
|
+
<div class="method-source-code" id="M000031-source">
|
139
139
|
<pre>
|
140
140
|
<span class="ruby-comment cmt"># File lib/mack-notifier/adapters/tmail.rb, line 23</span>
|
141
141
|
23: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">convert</span>
|
@@ -163,33 +163,42 @@ TMail object.
|
|
163
163
|
45: <span class="ruby-identifier">html</span>.<span class="ruby-identifier">body</span> = <span class="ruby-identifier">mack_notifier</span>.<span class="ruby-identifier">body</span>(<span class="ruby-identifier">:html</span>)
|
164
164
|
46: <span class="ruby-identifier">main_body</span>.<span class="ruby-identifier">parts</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">html</span>
|
165
165
|
47: <span class="ruby-keyword kw">end</span>
|
166
|
-
48:
|
167
|
-
49:
|
168
|
-
50: <span class="ruby-
|
169
|
-
51:
|
170
|
-
52:
|
171
|
-
53:
|
172
|
-
54:
|
173
|
-
55:
|
174
|
-
56:
|
175
|
-
57:
|
176
|
-
58:
|
177
|
-
59: <span class="ruby-
|
178
|
-
60:
|
179
|
-
61:
|
180
|
-
62:
|
181
|
-
63: <span class="ruby-
|
182
|
-
64:
|
166
|
+
48:
|
167
|
+
49: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">main_body</span>.<span class="ruby-identifier">parts</span>.<span class="ruby-identifier">empty?</span>
|
168
|
+
50: <span class="ruby-identifier">main_body</span>.<span class="ruby-identifier">content_type</span> = <span class="ruby-value str">"multipart/alternative"</span>
|
169
|
+
51: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">mack_notifier</span>.<span class="ruby-identifier">attachments</span>.<span class="ruby-identifier">any?</span> <span class="ruby-comment cmt"># there's an attachment</span>
|
170
|
+
52: <span class="ruby-ivar">@tmail</span>.<span class="ruby-identifier">parts</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">main_body</span>
|
171
|
+
53: <span class="ruby-keyword kw">else</span>
|
172
|
+
54: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">main_body</span>.<span class="ruby-identifier">parts</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
|
173
|
+
55: <span class="ruby-ivar">@tmail</span>.<span class="ruby-identifier">body</span> = <span class="ruby-identifier">main_body</span>.<span class="ruby-identifier">parts</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">body</span>
|
174
|
+
56: <span class="ruby-keyword kw">else</span>
|
175
|
+
57: <span class="ruby-ivar">@tmail</span>.<span class="ruby-identifier">parts</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">main_body</span>
|
176
|
+
58: <span class="ruby-keyword kw">end</span>
|
177
|
+
59: <span class="ruby-keyword kw">end</span>
|
178
|
+
60: <span class="ruby-keyword kw">end</span>
|
179
|
+
61:
|
180
|
+
62: <span class="ruby-comment cmt"># set attachments, if any.</span>
|
181
|
+
63: <span class="ruby-identifier">mack_notifier</span>.<span class="ruby-identifier">attachments</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">at</span><span class="ruby-operator">|</span>
|
182
|
+
64: <span class="ruby-identifier">attachment</span> = <span class="ruby-constant">TMail</span><span class="ruby-operator">::</span><span class="ruby-constant">Mail</span>.<span class="ruby-identifier">new</span>
|
183
|
+
65: <span class="ruby-identifier">attachment</span>.<span class="ruby-identifier">body</span> = <span class="ruby-constant">Base64</span>.<span class="ruby-identifier">encode64</span>(<span class="ruby-identifier">at</span>.<span class="ruby-identifier">body</span>)
|
184
|
+
66: <span class="ruby-identifier">attachment</span>.<span class="ruby-identifier">transfer_encoding</span> = <span class="ruby-value str">"Base64"</span>
|
185
|
+
67: <span class="ruby-identifier">attachment</span>.<span class="ruby-identifier">content_type</span> = <span class="ruby-value str">"application/octet-stream"</span>
|
186
|
+
68: <span class="ruby-identifier">attachment</span>[<span class="ruby-value str">'Content-Disposition'</span>] = <span class="ruby-node">"attachment; filename=#{at.file_name}"</span>
|
187
|
+
69: <span class="ruby-ivar">@tmail</span>.<span class="ruby-identifier">parts</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">attachment</span>
|
188
|
+
70: <span class="ruby-keyword kw">end</span>
|
189
|
+
71:
|
190
|
+
72: <span class="ruby-ivar">@tmail</span>.<span class="ruby-identifier">content_type</span> = <span class="ruby-identifier">mack_notifier</span>.<span class="ruby-identifier">content_type</span>
|
191
|
+
73: <span class="ruby-keyword kw">end</span>
|
183
192
|
</pre>
|
184
193
|
</div>
|
185
194
|
</div>
|
186
195
|
</div>
|
187
196
|
|
188
|
-
<div id="method-
|
189
|
-
<a name="
|
197
|
+
<div id="method-M000030" class="method-detail">
|
198
|
+
<a name="M000030"></a>
|
190
199
|
|
191
200
|
<div class="method-heading">
|
192
|
-
<a href="#
|
201
|
+
<a href="#M000030" class="method-signature">
|
193
202
|
<span class="method-name">deliverable</span><span class="method-args">()</span>
|
194
203
|
</a>
|
195
204
|
</div>
|
@@ -199,8 +208,8 @@ TMail object.
|
|
199
208
|
Returns the ready to be delivered encoded String
|
200
209
|
</p>
|
201
210
|
<p><a class="source-toggle" href="#"
|
202
|
-
onclick="toggleCode('
|
203
|
-
<div class="method-source-code" id="
|
211
|
+
onclick="toggleCode('M000030-source');return false;">[Source]</a></p>
|
212
|
+
<div class="method-source-code" id="M000030-source">
|
204
213
|
<pre>
|
205
214
|
<span class="ruby-comment cmt"># File lib/mack-notifier/adapters/tmail.rb, line 18</span>
|
206
215
|
18: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">deliverable</span>
|
@@ -211,11 +220,11 @@ Returns the ready to be delivered encoded String
|
|
211
220
|
</div>
|
212
221
|
</div>
|
213
222
|
|
214
|
-
<div id="method-
|
215
|
-
<a name="
|
223
|
+
<div id="method-M000029" class="method-detail">
|
224
|
+
<a name="M000029"></a>
|
216
225
|
|
217
226
|
<div class="method-heading">
|
218
|
-
<a href="#
|
227
|
+
<a href="#M000029" class="method-signature">
|
219
228
|
<span class="method-name">transformed</span><span class="method-args">()</span>
|
220
229
|
</a>
|
221
230
|
</div>
|
@@ -224,12 +233,12 @@ Returns the ready to be delivered encoded String
|
|
224
233
|
<p>
|
225
234
|
Returns the underlying TMail object. Raises <a
|
226
235
|
href="../../Errors/UnconvertedNotifier.html">Mack::Errors::UnconvertedNotifier</a>
|
227
|
-
if the <a href="Tmail.html#
|
236
|
+
if the <a href="Tmail.html#M000031">convert</a> method hasn‘t been
|
228
237
|
called first.
|
229
238
|
</p>
|
230
239
|
<p><a class="source-toggle" href="#"
|
231
|
-
onclick="toggleCode('
|
232
|
-
<div class="method-source-code" id="
|
240
|
+
onclick="toggleCode('M000029-source');return false;">[Source]</a></p>
|
241
|
+
<div class="method-source-code" id="M000029-source">
|
233
242
|
<pre>
|
234
243
|
<span class="ruby-comment cmt"># File lib/mack-notifier/adapters/tmail.rb, line 12</span>
|
235
244
|
12: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">transformed</span>
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
7
|
<head>
|
8
|
-
<title>Module: Mack::Notifier::DeliveryHandlers::
|
8
|
+
<title>Module: Mack::Notifier::DeliveryHandlers::Sendmail</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
11
|
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
@@ -50,7 +50,7 @@
|
|
50
50
|
<table class="header-table">
|
51
51
|
<tr class="top-aligned-row">
|
52
52
|
<td><strong>Module</strong></td>
|
53
|
-
<td class="class-name-in-header">Mack::Notifier::DeliveryHandlers::
|
53
|
+
<td class="class-name-in-header">Mack::Notifier::DeliveryHandlers::Sendmail</td>
|
54
54
|
</tr>
|
55
55
|
<tr class="top-aligned-row">
|
56
56
|
<td><strong>In:</strong></td>
|
@@ -87,7 +87,7 @@ sendmail.
|
|
87
87
|
<h3 class="section-bar">Methods</h3>
|
88
88
|
|
89
89
|
<div class="name-list">
|
90
|
-
<a href="#
|
90
|
+
<a href="#M000026">deliver</a>
|
91
91
|
</div>
|
92
92
|
</div>
|
93
93
|
|
@@ -109,19 +109,19 @@ sendmail.
|
|
109
109
|
<div id="methods">
|
110
110
|
<h3 class="section-bar">Public Class methods</h3>
|
111
111
|
|
112
|
-
<div id="method-
|
113
|
-
<a name="
|
112
|
+
<div id="method-M000026" class="method-detail">
|
113
|
+
<a name="M000026"></a>
|
114
114
|
|
115
115
|
<div class="method-heading">
|
116
|
-
<a href="#
|
116
|
+
<a href="#M000026" class="method-signature">
|
117
117
|
<span class="method-name">deliver</span><span class="method-args">(mail)</span>
|
118
118
|
</a>
|
119
119
|
</div>
|
120
120
|
|
121
121
|
<div class="method-description">
|
122
122
|
<p><a class="source-toggle" href="#"
|
123
|
-
onclick="toggleCode('
|
124
|
-
<div class="method-source-code" id="
|
123
|
+
onclick="toggleCode('M000026-source');return false;">[Source]</a></p>
|
124
|
+
<div class="method-source-code" id="M000026-source">
|
125
125
|
<pre>
|
126
126
|
<span class="ruby-comment cmt"># File lib/mack-notifier/delivery_handlers/sendmail.rb, line 7</span>
|
127
127
|
7: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">deliver</span>(<span class="ruby-identifier">mail</span>)
|
@@ -87,7 +87,7 @@ Net::SMTP.
|
|
87
87
|
<h3 class="section-bar">Methods</h3>
|
88
88
|
|
89
89
|
<div class="name-list">
|
90
|
-
<a href="#
|
90
|
+
<a href="#M000027">deliver</a>
|
91
91
|
</div>
|
92
92
|
</div>
|
93
93
|
|
@@ -109,19 +109,19 @@ Net::SMTP.
|
|
109
109
|
<div id="methods">
|
110
110
|
<h3 class="section-bar">Public Class methods</h3>
|
111
111
|
|
112
|
-
<div id="method-
|
113
|
-
<a name="
|
112
|
+
<div id="method-M000027" class="method-detail">
|
113
|
+
<a name="M000027"></a>
|
114
114
|
|
115
115
|
<div class="method-heading">
|
116
|
-
<a href="#
|
116
|
+
<a href="#M000027" class="method-signature">
|
117
117
|
<span class="method-name">deliver</span><span class="method-args">(mail)</span>
|
118
118
|
</a>
|
119
119
|
</div>
|
120
120
|
|
121
121
|
<div class="method-description">
|
122
122
|
<p><a class="source-toggle" href="#"
|
123
|
-
onclick="toggleCode('
|
124
|
-
<div class="method-source-code" id="
|
123
|
+
onclick="toggleCode('M000027-source');return false;">[Source]</a></p>
|
124
|
+
<div class="method-source-code" id="M000027-source">
|
125
125
|
<pre>
|
126
126
|
<span class="ruby-comment cmt"># File lib/mack-notifier/delivery_handlers/smtp.rb, line 8</span>
|
127
127
|
8: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">deliver</span>(<span class="ruby-identifier">mail</span>)
|
@@ -87,7 +87,7 @@ Array.
|
|
87
87
|
<h3 class="section-bar">Methods</h3>
|
88
88
|
|
89
89
|
<div class="name-list">
|
90
|
-
<a href="#
|
90
|
+
<a href="#M000028">deliver</a>
|
91
91
|
</div>
|
92
92
|
</div>
|
93
93
|
|
@@ -109,23 +109,23 @@ Array.
|
|
109
109
|
<div id="methods">
|
110
110
|
<h3 class="section-bar">Public Class methods</h3>
|
111
111
|
|
112
|
-
<div id="method-
|
113
|
-
<a name="
|
112
|
+
<div id="method-M000028" class="method-detail">
|
113
|
+
<a name="M000028"></a>
|
114
114
|
|
115
115
|
<div class="method-heading">
|
116
|
-
<a href="#
|
117
|
-
<span class="method-name">deliver</span><span class="method-args">(
|
116
|
+
<a href="#M000028" class="method-signature">
|
117
|
+
<span class="method-name">deliver</span><span class="method-args">(notifier)</span>
|
118
118
|
</a>
|
119
119
|
</div>
|
120
120
|
|
121
121
|
<div class="method-description">
|
122
122
|
<p><a class="source-toggle" href="#"
|
123
|
-
onclick="toggleCode('
|
124
|
-
<div class="method-source-code" id="
|
123
|
+
onclick="toggleCode('M000028-source');return false;">[Source]</a></p>
|
124
|
+
<div class="method-source-code" id="M000028-source">
|
125
125
|
<pre>
|
126
126
|
<span class="ruby-comment cmt"># File lib/mack-notifier/delivery_handlers/test.rb, line 7</span>
|
127
|
-
7: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">deliver</span>(<span class="ruby-identifier">
|
128
|
-
8: <span class="ruby-constant">
|
127
|
+
7: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">deliver</span>(<span class="ruby-identifier">notifier</span>)
|
128
|
+
8: <span class="ruby-constant">NotifierRegistry</span>.<span class="ruby-identifier">add</span>(<span class="ruby-identifier">notifier</span>)
|
129
129
|
9: <span class="ruby-keyword kw">end</span>
|
130
130
|
</pre>
|
131
131
|
</div>
|
@@ -88,12 +88,12 @@ href="http://validatable.rubyforge.org">validatable.rubyforge.org</a>
|
|
88
88
|
<h3 class="section-bar">Methods</h3>
|
89
89
|
|
90
90
|
<div class="name-list">
|
91
|
-
<a href="#
|
92
|
-
<a href="#
|
93
|
-
<a href="#
|
94
|
-
<a href="#
|
95
|
-
<a href="#
|
96
|
-
<a href="#
|
91
|
+
<a href="#M000021">common_notifier_validations</a>
|
92
|
+
<a href="#M000025">deliver</a>
|
93
|
+
<a href="#M000024">deliver!</a>
|
94
|
+
<a href="#M000023">email_validation_regex</a>
|
95
|
+
<a href="#M000020">included</a>
|
96
|
+
<a href="#M000022">validates_email_format_of</a>
|
97
97
|
</div>
|
98
98
|
</div>
|
99
99
|
|
@@ -169,11 +169,11 @@ DataMapper methods, if that‘s the kind of thing you‘re used to.
|
|
169
169
|
<div id="methods">
|
170
170
|
<h3 class="section-bar">Public Class methods</h3>
|
171
171
|
|
172
|
-
<div id="method-
|
173
|
-
<a name="
|
172
|
+
<div id="method-M000021" class="method-detail">
|
173
|
+
<a name="M000021"></a>
|
174
174
|
|
175
175
|
<div class="method-heading">
|
176
|
-
<a href="#
|
176
|
+
<a href="#M000021" class="method-signature">
|
177
177
|
<span class="method-name">common_notifier_validations</span><span class="method-args">()</span>
|
178
178
|
</a>
|
179
179
|
</div>
|
@@ -191,8 +191,8 @@ href="../Notifier.html">Mack::Notifier</a> class. These include:
|
|
191
191
|
validates_email_format_of :from
|
192
192
|
</pre>
|
193
193
|
<p><a class="source-toggle" href="#"
|
194
|
-
onclick="toggleCode('
|
195
|
-
<div class="method-source-code" id="
|
194
|
+
onclick="toggleCode('M000021-source');return false;">[Source]</a></p>
|
195
|
+
<div class="method-source-code" id="M000021-source">
|
196
196
|
<pre>
|
197
197
|
<span class="ruby-comment cmt"># File lib/mack-notifier/validations.rb, line 33</span>
|
198
198
|
33: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">common_notifier_validations</span>
|
@@ -207,19 +207,19 @@ href="../Notifier.html">Mack::Notifier</a> class. These include:
|
|
207
207
|
</div>
|
208
208
|
</div>
|
209
209
|
|
210
|
-
<div id="method-
|
211
|
-
<a name="
|
210
|
+
<div id="method-M000023" class="method-detail">
|
211
|
+
<a name="M000023"></a>
|
212
212
|
|
213
213
|
<div class="method-heading">
|
214
|
-
<a href="#
|
214
|
+
<a href="#M000023" class="method-signature">
|
215
215
|
<span class="method-name">email_validation_regex</span><span class="method-args">()</span>
|
216
216
|
</a>
|
217
217
|
</div>
|
218
218
|
|
219
219
|
<div class="method-description">
|
220
220
|
<p><a class="source-toggle" href="#"
|
221
|
-
onclick="toggleCode('
|
222
|
-
<div class="method-source-code" id="
|
221
|
+
onclick="toggleCode('M000023-source');return false;">[Source]</a></p>
|
222
|
+
<div class="method-source-code" id="M000023-source">
|
223
223
|
<pre>
|
224
224
|
<span class="ruby-comment cmt"># File lib/mack-notifier/validations.rb, line 52</span>
|
225
225
|
52: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">email_validation_regex</span>
|
@@ -231,19 +231,19 @@ href="../Notifier.html">Mack::Notifier</a> class. These include:
|
|
231
231
|
</div>
|
232
232
|
</div>
|
233
233
|
|
234
|
-
<div id="method-
|
235
|
-
<a name="
|
234
|
+
<div id="method-M000020" class="method-detail">
|
235
|
+
<a name="M000020"></a>
|
236
236
|
|
237
237
|
<div class="method-heading">
|
238
|
-
<a href="#
|
238
|
+
<a href="#M000020" class="method-signature">
|
239
239
|
<span class="method-name">included</span><span class="method-args">(base)</span>
|
240
240
|
</a>
|
241
241
|
</div>
|
242
242
|
|
243
243
|
<div class="method-description">
|
244
244
|
<p><a class="source-toggle" href="#"
|
245
|
-
onclick="toggleCode('
|
246
|
-
<div class="method-source-code" id="
|
245
|
+
onclick="toggleCode('M000020-source');return false;">[Source]</a></p>
|
246
|
+
<div class="method-source-code" id="M000020-source">
|
247
247
|
<pre>
|
248
248
|
<span class="ruby-comment cmt"># File lib/mack-notifier/validations.rb, line 7</span>
|
249
249
|
7: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">included</span>(<span class="ruby-identifier">base</span>)
|
@@ -304,11 +304,11 @@ href="../Notifier.html">Mack::Notifier</a> class. These include:
|
|
304
304
|
</div>
|
305
305
|
</div>
|
306
306
|
|
307
|
-
<div id="method-
|
308
|
-
<a name="
|
307
|
+
<div id="method-M000022" class="method-detail">
|
308
|
+
<a name="M000022"></a>
|
309
309
|
|
310
310
|
<div class="method-heading">
|
311
|
-
<a href="#
|
311
|
+
<a href="#M000022" class="method-signature">
|
312
312
|
<span class="method-name">validates_email_format_of</span><span class="method-args">(column, options = {})</span>
|
313
313
|
</a>
|
314
314
|
</div>
|
@@ -316,12 +316,12 @@ href="../Notifier.html">Mack::Notifier</a> class. These include:
|
|
316
316
|
<div class="method-description">
|
317
317
|
<p>
|
318
318
|
Validates the email format of the column specified against the <a
|
319
|
-
href="Validatable.html#
|
319
|
+
href="Validatable.html#M000023">email_validation_regex</a> method. This
|
320
320
|
will drill into arrays as well, if that‘s what your column is.
|
321
321
|
</p>
|
322
322
|
<p><a class="source-toggle" href="#"
|
323
|
-
onclick="toggleCode('
|
324
|
-
<div class="method-source-code" id="
|
323
|
+
onclick="toggleCode('M000022-source');return false;">[Source]</a></p>
|
324
|
+
<div class="method-source-code" id="M000022-source">
|
325
325
|
<pre>
|
326
326
|
<span class="ruby-comment cmt"># File lib/mack-notifier/validations.rb, line 43</span>
|
327
327
|
43: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">validates_email_format_of</span>(<span class="ruby-identifier">column</span>, <span class="ruby-identifier">options</span> = {})
|
@@ -339,11 +339,11 @@ will drill into arrays as well, if that‘s what your column is.
|
|
339
339
|
|
340
340
|
<h3 class="section-bar">Public Instance methods</h3>
|
341
341
|
|
342
|
-
<div id="method-
|
343
|
-
<a name="
|
342
|
+
<div id="method-M000025" class="method-detail">
|
343
|
+
<a name="M000025"></a>
|
344
344
|
|
345
345
|
<div class="method-heading">
|
346
|
-
<a href="#
|
346
|
+
<a href="#M000025" class="method-signature">
|
347
347
|
<span class="method-name">deliver</span><span class="method-args">(handler = deliver_with)</span>
|
348
348
|
</a>
|
349
349
|
</div>
|
@@ -352,13 +352,13 @@ will drill into arrays as well, if that‘s what your column is.
|
|
352
352
|
<p>
|
353
353
|
Returns false if the email is not valid. If the email is valid and an
|
354
354
|
exception is raised when trying to <a
|
355
|
-
href="Validatable.html#
|
355
|
+
href="Validatable.html#M000025">deliver</a> it false is returned and the
|
356
356
|
exception is added to the errors array, with the key :<a
|
357
|
-
href="Validatable.html#
|
357
|
+
href="Validatable.html#M000025">deliver</a>.
|
358
358
|
</p>
|
359
359
|
<p><a class="source-toggle" href="#"
|
360
|
-
onclick="toggleCode('
|
361
|
-
<div class="method-source-code" id="
|
360
|
+
onclick="toggleCode('M000025-source');return false;">[Source]</a></p>
|
361
|
+
<div class="method-source-code" id="M000025-source">
|
362
362
|
<pre>
|
363
363
|
<span class="ruby-comment cmt"># File lib/mack-notifier/validations.rb, line 74</span>
|
364
364
|
74: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">deliver</span>(<span class="ruby-identifier">handler</span> = <span class="ruby-identifier">deliver_with</span>)
|
@@ -376,11 +376,11 @@ href="Validatable.html#M000031">deliver</a>.
|
|
376
376
|
</div>
|
377
377
|
</div>
|
378
378
|
|
379
|
-
<div id="method-
|
380
|
-
<a name="
|
379
|
+
<div id="method-M000024" class="method-detail">
|
380
|
+
<a name="M000024"></a>
|
381
381
|
|
382
382
|
<div class="method-heading">
|
383
|
-
<a href="#
|
383
|
+
<a href="#M000024" class="method-signature">
|
384
384
|
<span class="method-name">deliver!</span><span class="method-args">(handler = deliver_with)</span>
|
385
385
|
</a>
|
386
386
|
</div>
|
@@ -388,11 +388,11 @@ href="Validatable.html#M000031">deliver</a>.
|
|
388
388
|
<div class="method-description">
|
389
389
|
<p>
|
390
390
|
Raises a RuntimeError if the email you are trying to <a
|
391
|
-
href="Validatable.html#
|
391
|
+
href="Validatable.html#M000025">deliver</a> is not valid.
|
392
392
|
</p>
|
393
393
|
<p><a class="source-toggle" href="#"
|
394
|
-
onclick="toggleCode('
|
395
|
-
<div class="method-source-code" id="
|
394
|
+
onclick="toggleCode('M000024-source');return false;">[Source]</a></p>
|
395
|
+
<div class="method-source-code" id="M000024-source">
|
396
396
|
<pre>
|
397
397
|
<span class="ruby-comment cmt"># File lib/mack-notifier/validations.rb, line 65</span>
|
398
398
|
65: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">deliver!</span>(<span class="ruby-identifier">handler</span> = <span class="ruby-identifier">deliver_with</span>)
|
data/doc/classes/Mack/Paths.html
CHANGED
@@ -149,7 +149,7 @@ The path the test/notifiers directory
|
|
149
149
|
<pre>
|
150
150
|
<span class="ruby-comment cmt"># File lib/mack-notifier/paths.rb, line 15</span>
|
151
151
|
15: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">notifier_tests</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
|
152
|
-
16: <span class="ruby-constant">
|
152
|
+
16: <span class="ruby-constant">Mack</span><span class="ruby-operator">::</span><span class="ruby-constant">Paths</span>.<span class="ruby-identifier">test</span>(<span class="ruby-value str">"notifiers"</span>, <span class="ruby-identifier">args</span>)
|
153
153
|
17: <span class="ruby-keyword kw">end</span>
|
154
154
|
</pre>
|
155
155
|
</div>
|
@@ -175,7 +175,7 @@ The path to the app/notifiers directory.
|
|
175
175
|
<pre>
|
176
176
|
<span class="ruby-comment cmt"># File lib/mack-notifier/paths.rb, line 5</span>
|
177
177
|
5: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">notifiers</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
|
178
|
-
6: <span class="ruby-constant">
|
178
|
+
6: <span class="ruby-constant">Mack</span><span class="ruby-operator">::</span><span class="ruby-constant">Paths</span>.<span class="ruby-identifier">app</span>(<span class="ruby-value str">"notifiers"</span>, <span class="ruby-identifier">args</span>)
|
179
179
|
7: <span class="ruby-keyword kw">end</span>
|
180
180
|
</pre>
|
181
181
|
</div>
|
data/doc/created.rid
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
Mon, 08 Sep 2008 10:58:35 -0400
|
data/doc/files/README.html
CHANGED
@@ -56,7 +56,7 @@
|
|
56
56
|
</tr>
|
57
57
|
<tr class="top-aligned-row">
|
58
58
|
<td><strong>Last Update:</strong></td>
|
59
|
-
<td>Mon
|
59
|
+
<td>Mon Sep 08 10:32:47 -0400 2008</td>
|
60
60
|
</tr>
|
61
61
|
</table>
|
62
62
|
</div>
|
@@ -76,7 +76,7 @@
|
|
76
76
|
<h3 class="section-bar">Methods</h3>
|
77
77
|
|
78
78
|
<div class="name-list">
|
79
|
-
<a href="#M000001">
|
79
|
+
<a href="#M000001">delivered_notifiers</a>
|
80
80
|
</div>
|
81
81
|
</div>
|
82
82
|
|
@@ -103,7 +103,7 @@
|
|
103
103
|
|
104
104
|
<div class="method-heading">
|
105
105
|
<a href="#M000001" class="method-signature">
|
106
|
-
<span class="method-name">
|
106
|
+
<span class="method-name">delivered_notifiers</span><span class="method-args">()</span>
|
107
107
|
</a>
|
108
108
|
</div>
|
109
109
|
|
@@ -118,10 +118,10 @@ These emails will get ‘flushed’ after each test.
|
|
118
118
|
onclick="toggleCode('M000001-source');return false;">[Source]</a></p>
|
119
119
|
<div class="method-source-code" id="M000001-source">
|
120
120
|
<pre>
|
121
|
-
<span class="ruby-comment cmt"># File lib/mack-notifier/testing.rb, line
|
122
|
-
|
123
|
-
|
124
|
-
|
121
|
+
<span class="ruby-comment cmt"># File lib/mack-notifier/testing.rb, line 7</span>
|
122
|
+
7: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delivered_notifiers</span>
|
123
|
+
8: <span class="ruby-constant">Mack</span><span class="ruby-operator">::</span><span class="ruby-constant">Notifier</span><span class="ruby-operator">::</span><span class="ruby-constant">DeliveryHandlers</span><span class="ruby-operator">::</span><span class="ruby-constant">Test</span><span class="ruby-operator">::</span><span class="ruby-constant">NotifierRegistry</span>.<span class="ruby-identifier">registered_items</span>
|
124
|
+
9: <span class="ruby-keyword kw">end</span>
|
125
125
|
</pre>
|
126
126
|
</div>
|
127
127
|
</div>
|
data/doc/fr_class_index.html
CHANGED
@@ -25,7 +25,7 @@
|
|
25
25
|
<a href="classes/Mack/Notifier/Adapters/Base.html">Mack::Notifier::Adapters::Base</a><br />
|
26
26
|
<a href="classes/Mack/Notifier/Adapters/Tmail.html">Mack::Notifier::Adapters::Tmail</a><br />
|
27
27
|
<a href="classes/Mack/Notifier/Attachment.html">Mack::Notifier::Attachment</a><br />
|
28
|
-
<a href="classes/Mack/Notifier/DeliveryHandlers/
|
28
|
+
<a href="classes/Mack/Notifier/DeliveryHandlers/Sendmail.html">Mack::Notifier::DeliveryHandlers::Sendmail</a><br />
|
29
29
|
<a href="classes/Mack/Notifier/DeliveryHandlers/Smtp.html">Mack::Notifier::DeliveryHandlers::Smtp</a><br />
|
30
30
|
<a href="classes/Mack/Notifier/DeliveryHandlers/Test.html">Mack::Notifier::DeliveryHandlers::Test</a><br />
|
31
31
|
<a href="classes/Mack/Notifier/Validatable.html">Mack::Notifier::Validatable</a><br />
|
data/doc/fr_method_index.html
CHANGED
@@ -28,24 +28,24 @@
|
|
28
28
|
<a href="classes/Mack/Notifier.html#M000013">attachments (Mack::Notifier)</a><br />
|
29
29
|
<a href="classes/Mack/Notifier.html#M000006">body (Mack::Notifier)</a><br />
|
30
30
|
<a href="classes/Mack/Notifier.html#M000005">build (Mack::Notifier)</a><br />
|
31
|
-
<a href="classes/Mack/Notifier/Validatable.html#
|
31
|
+
<a href="classes/Mack/Notifier/Validatable.html#M000021">common_notifier_validations (Mack::Notifier::Validatable)</a><br />
|
32
32
|
<a href="classes/Mack/Notifier.html#M000008">content_type (Mack::Notifier)</a><br />
|
33
|
-
<a href="classes/Mack/Notifier/Adapters/Tmail.html#
|
33
|
+
<a href="classes/Mack/Notifier/Adapters/Tmail.html#M000031">convert (Mack::Notifier::Adapters::Tmail)</a><br />
|
34
34
|
<a href="classes/Mack/Notifier.html#M000009">date_sent (Mack::Notifier)</a><br />
|
35
|
-
<a href="classes/Mack/Notifier/Validatable.html#M000031">deliver (Mack::Notifier::Validatable)</a><br />
|
36
35
|
<a href="classes/Mack/Notifier.html#M000014">deliver (Mack::Notifier)</a><br />
|
37
|
-
<a href="classes/Mack/Notifier/DeliveryHandlers/Test.html#
|
38
|
-
<a href="classes/Mack/Notifier/
|
39
|
-
<a href="classes/Mack/Notifier/DeliveryHandlers/Smtp.html#
|
36
|
+
<a href="classes/Mack/Notifier/DeliveryHandlers/Test.html#M000028">deliver (Mack::Notifier::DeliveryHandlers::Test)</a><br />
|
37
|
+
<a href="classes/Mack/Notifier/Validatable.html#M000025">deliver (Mack::Notifier::Validatable)</a><br />
|
38
|
+
<a href="classes/Mack/Notifier/DeliveryHandlers/Smtp.html#M000027">deliver (Mack::Notifier::DeliveryHandlers::Smtp)</a><br />
|
39
|
+
<a href="classes/Mack/Notifier/DeliveryHandlers/Sendmail.html#M000026">deliver (Mack::Notifier::DeliveryHandlers::Sendmail)</a><br />
|
40
40
|
<a href="classes/Mack/Notifier.html#M000015">deliver! (Mack::Notifier)</a><br />
|
41
|
-
<a href="classes/Mack/Notifier/Validatable.html#
|
41
|
+
<a href="classes/Mack/Notifier/Validatable.html#M000024">deliver! (Mack::Notifier::Validatable)</a><br />
|
42
42
|
<a href="classes/Mack/Notifier.html#M000019">deliver_with (Mack::Notifier)</a><br />
|
43
|
+
<a href="classes/Mack/Notifier/Adapters/Tmail.html#M000030">deliverable (Mack::Notifier::Adapters::Tmail)</a><br />
|
43
44
|
<a href="classes/Mack/Notifier.html#M000017">deliverable (Mack::Notifier)</a><br />
|
44
|
-
<a href="
|
45
|
-
<a href="
|
46
|
-
<a href="classes/Mack/Notifier/Validatable.html#M000029">email_validation_regex (Mack::Notifier::Validatable)</a><br />
|
45
|
+
<a href="files/lib/mack-notifier/testing_rb.html#M000001">delivered_notifiers (lib/mack-notifier/testing.rb)</a><br />
|
46
|
+
<a href="classes/Mack/Notifier/Validatable.html#M000023">email_validation_regex (Mack::Notifier::Validatable)</a><br />
|
47
47
|
<a href="classes/Mack/Notifier.html#M000012">has_attachments? (Mack::Notifier)</a><br />
|
48
|
-
<a href="classes/Mack/Notifier/Validatable.html#
|
48
|
+
<a href="classes/Mack/Notifier/Validatable.html#M000020">included (Mack::Notifier::Validatable)</a><br />
|
49
49
|
<a href="classes/Mack/Notifier.html#M000007">mime_version (Mack::Notifier)</a><br />
|
50
50
|
<a href="classes/Mack/Notifier/Attachment.html#M000032">new (Mack::Notifier::Attachment)</a><br />
|
51
51
|
<a href="classes/Mack/Paths.html#M000003">notifier_templates (Mack::Paths)</a><br />
|
@@ -53,8 +53,8 @@
|
|
53
53
|
<a href="classes/Mack/Paths.html#M000002">notifiers (Mack::Paths)</a><br />
|
54
54
|
<a href="classes/Mack/Notifier.html#M000016">recipients (Mack::Notifier)</a><br />
|
55
55
|
<a href="classes/Mack/Notifier.html#M000010">reply_to (Mack::Notifier)</a><br />
|
56
|
-
<a href="classes/Mack/Notifier/Adapters/Tmail.html#
|
57
|
-
<a href="classes/Mack/Notifier/Validatable.html#
|
56
|
+
<a href="classes/Mack/Notifier/Adapters/Tmail.html#M000029">transformed (Mack::Notifier::Adapters::Tmail)</a><br />
|
57
|
+
<a href="classes/Mack/Notifier/Validatable.html#M000022">validates_email_format_of (Mack::Notifier::Validatable)</a><br />
|
58
58
|
</div>
|
59
59
|
</div>
|
60
60
|
</body>
|
@@ -45,9 +45,18 @@ module Mack
|
|
45
45
|
html.body = mack_notifier.body(:html)
|
46
46
|
main_body.parts << html
|
47
47
|
end
|
48
|
+
|
48
49
|
unless main_body.parts.empty?
|
49
50
|
main_body.content_type = "multipart/alternative"
|
50
|
-
|
51
|
+
if mack_notifier.attachments.any? # there's an attachment
|
52
|
+
@tmail.parts << main_body
|
53
|
+
else
|
54
|
+
if main_body.parts.size == 1
|
55
|
+
@tmail.body = main_body.parts.first.body
|
56
|
+
else
|
57
|
+
@tmail.parts << main_body
|
58
|
+
end
|
59
|
+
end
|
51
60
|
end
|
52
61
|
|
53
62
|
# set attachments, if any.
|
@@ -2,7 +2,7 @@ module Mack
|
|
2
2
|
module Notifier
|
3
3
|
module DeliveryHandlers # :nodoc:
|
4
4
|
# Delivers Mack::Notifier objects using sendmail.
|
5
|
-
module
|
5
|
+
module Sendmail
|
6
6
|
|
7
7
|
def self.deliver(mail)
|
8
8
|
sendmail_settings = app_config.notifier.sendmail_settings
|
@@ -16,6 +16,10 @@ module Mack
|
|
16
16
|
end
|
17
17
|
|
18
18
|
end # SendMail
|
19
|
+
|
20
|
+
# Alias of SendMail to Sendmail
|
21
|
+
SendMail = Sendmail # :nodoc:
|
22
|
+
|
19
23
|
end # DeliveryHandlers
|
20
24
|
end # Notifier
|
21
25
|
end # Mack
|
@@ -4,11 +4,11 @@ module Mack
|
|
4
4
|
# Delivers Mack::Notifier objects to an Array.
|
5
5
|
module Test
|
6
6
|
|
7
|
-
def self.deliver(
|
8
|
-
|
7
|
+
def self.deliver(notifier)
|
8
|
+
NotifierRegistry.add(notifier)
|
9
9
|
end
|
10
10
|
|
11
|
-
class
|
11
|
+
class NotifierRegistry < Mack::Utils::RegistryList # :nodoc:
|
12
12
|
end
|
13
13
|
|
14
14
|
end # Test
|
data/lib/mack-notifier/paths.rb
CHANGED
@@ -3,7 +3,7 @@ module Mack # :nodoc:
|
|
3
3
|
|
4
4
|
# The path to the app/notifiers directory.
|
5
5
|
def self.notifiers(*args)
|
6
|
-
|
6
|
+
Mack::Paths.app("notifiers", args)
|
7
7
|
end
|
8
8
|
|
9
9
|
# The path to the app/notifiers/templates directory.
|
@@ -13,7 +13,7 @@ module Mack # :nodoc:
|
|
13
13
|
|
14
14
|
# The path the test/notifiers directory
|
15
15
|
def self.notifier_tests(*args)
|
16
|
-
|
16
|
+
Mack::Paths.test("notifiers", args)
|
17
17
|
end
|
18
18
|
|
19
19
|
end
|
@@ -1,9 +1,11 @@
|
|
1
1
|
if Mack.env == "test"
|
2
2
|
|
3
|
+
alias_deprecated_method :delivered_emails, :delivered_notifiers, '0.7.1', '0.8.0'
|
4
|
+
|
3
5
|
# Used for testing this method will return any emails that have been 'sent' using Mack::Notifier::DeliveryHandlers::Test.
|
4
6
|
# These emails will get 'flushed' after each test.
|
5
|
-
def
|
6
|
-
Mack::Notifier::DeliveryHandlers::Test::
|
7
|
+
def delivered_notifiers
|
8
|
+
Mack::Notifier::DeliveryHandlers::Test::NotifierRegistry.registered_items
|
7
9
|
end
|
8
10
|
|
9
11
|
module Spec # :nodoc:
|
@@ -16,7 +18,7 @@ if Mack.env == "test"
|
|
16
18
|
|
17
19
|
def execute(options, instance_variables)
|
18
20
|
@__res = email_spec_execute(options, instance_variables)
|
19
|
-
Mack::Notifier::DeliveryHandlers::Test::
|
21
|
+
Mack::Notifier::DeliveryHandlers::Test::NotifierRegistry.reset!
|
20
22
|
@__res
|
21
23
|
end
|
22
24
|
|
@@ -36,7 +38,7 @@ if Mack.env == "test"
|
|
36
38
|
# run a cleanup method if it exists
|
37
39
|
def run(result, &progress_block) # :nodoc:
|
38
40
|
@__res = super_run(result)
|
39
|
-
Mack::Notifier::DeliveryHandlers::Test::
|
41
|
+
Mack::Notifier::DeliveryHandlers::Test::NotifierRegistry.reset!
|
40
42
|
@__res
|
41
43
|
end
|
42
44
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mack-notifier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Bates
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-08
|
12
|
+
date: 2008-09-08 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -70,7 +70,7 @@ files:
|
|
70
70
|
- doc/classes/Mack/Notifier/Adapters/Base.html
|
71
71
|
- doc/classes/Mack/Notifier/Adapters/Tmail.html
|
72
72
|
- doc/classes/Mack/Notifier/Attachment.html
|
73
|
-
- doc/classes/Mack/Notifier/DeliveryHandlers/
|
73
|
+
- doc/classes/Mack/Notifier/DeliveryHandlers/Sendmail.html
|
74
74
|
- doc/classes/Mack/Notifier/DeliveryHandlers/Smtp.html
|
75
75
|
- doc/classes/Mack/Notifier/DeliveryHandlers/Test.html
|
76
76
|
- doc/classes/Mack/Notifier/Validatable.html
|