forklift_etl 1.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.gitignore +10 -0
- data/.rbenv-version +1 -0
- data/.travis.yml +10 -0
- data/Gemfile +10 -0
- data/Gemfile.lock +74 -0
- data/Rakefile +13 -0
- data/bin/forklift +61 -0
- data/doc/EmailSuffix.html +228 -0
- data/doc/Forklift.html +187 -0
- data/doc/Forklift/Base.html +167 -0
- data/doc/Forklift/Base/Connection.html +590 -0
- data/doc/Forklift/Base/Logger.html +453 -0
- data/doc/Forklift/Base/Mailer.html +399 -0
- data/doc/Forklift/Base/Mailer/ERBBinding.html +256 -0
- data/doc/Forklift/Base/Pid.html +489 -0
- data/doc/Forklift/Base/Utils.html +252 -0
- data/doc/Forklift/Connection.html +164 -0
- data/doc/Forklift/Connection/Elasticsearch.html +419 -0
- data/doc/Forklift/Connection/Mysql.html +939 -0
- data/doc/Forklift/Patterns.html +164 -0
- data/doc/Forklift/Patterns/Elasticsearch.html +169 -0
- data/doc/Forklift/Patterns/Mysql.html +402 -0
- data/doc/Forklift/Plan.html +704 -0
- data/doc/Gemfile.html +132 -0
- data/doc/Object.html +326 -0
- data/doc/Rakefile.html +138 -0
- data/doc/SpecClient.html +291 -0
- data/doc/SpecPlan.html +253 -0
- data/doc/SpecSeeds.html +303 -0
- data/doc/created.rid +35 -0
- data/doc/example/Gemfile.html +129 -0
- data/doc/images/add.png +0 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/delete.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_blue.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/transparent.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/index.html +122 -0
- data/doc/js/darkfish.js +155 -0
- data/doc/js/jquery.js +18 -0
- data/doc/js/navigation.js +142 -0
- data/doc/js/search.js +94 -0
- data/doc/js/search_index.js +1 -0
- data/doc/js/searcher.js +228 -0
- data/doc/rdoc.css +543 -0
- data/doc/table_of_contents.html +309 -0
- data/example/Gemfile +3 -0
- data/example/Gemfile.lock +55 -0
- data/example/config/connections/elasticsearch/source.yml +1 -0
- data/example/config/connections/mysql/destination.yml +6 -0
- data/example/config/connections/mysql/source.yml +6 -0
- data/example/config/email.yml +18 -0
- data/example/plan.rb +87 -0
- data/example/template/email.erb +6 -0
- data/example/transformations/cleanup.sql +1 -0
- data/example/transformations/combined_name.sql +7 -0
- data/example/transformations/email_suffix.rb +20 -0
- data/forklift.jpg +0 -0
- data/forklift_etl.gemspec +28 -0
- data/lib/forklift/base/connection.rb +72 -0
- data/lib/forklift/base/logger.rb +49 -0
- data/lib/forklift/base/mailer.rb +83 -0
- data/lib/forklift/base/pid.rb +55 -0
- data/lib/forklift/base/utils.rb +23 -0
- data/lib/forklift/forklift.rb +19 -0
- data/lib/forklift/patterns/elasticsearch_patterns.rb +7 -0
- data/lib/forklift/patterns/mysql_patterns.rb +87 -0
- data/lib/forklift/plan.rb +138 -0
- data/lib/forklift/transports/elasticsearch.rb +75 -0
- data/lib/forklift/transports/mysql.rb +241 -0
- data/lib/forklift/version.rb +3 -0
- data/readme.md +410 -0
- data/spec/config/connections/elasticsearch/forklift_test.yml +1 -0
- data/spec/config/connections/mysql/forklift_test_destination.yml +6 -0
- data/spec/config/connections/mysql/forklift_test_source_a.yml +6 -0
- data/spec/config/connections/mysql/forklift_test_source_b.yml +6 -0
- data/spec/config/connections/mysql/forklift_test_working.yml +6 -0
- data/spec/config/email.yml +4 -0
- data/spec/integration/basic_spec.rb +29 -0
- data/spec/integration/elasticsearch_patterns_spec.rb +5 -0
- data/spec/integration/elasticsearch_spec.rb +95 -0
- data/spec/integration/multi_transport_spec.rb +112 -0
- data/spec/integration/mysql_patterns_spec.rb +76 -0
- data/spec/integration/mysql_spec.rb +138 -0
- data/spec/spec_helper.rb +30 -0
- data/spec/support/dumps/elasticsearch/forklift_test.json +7 -0
- data/spec/support/dumps/mysql/forklift_test_source_a.sql +79 -0
- data/spec/support/dumps/mysql/forklift_test_source_b.sql +23 -0
- data/spec/support/spec_client.rb +30 -0
- data/spec/support/spec_plan.rb +15 -0
- data/spec/support/spec_seeds.rb +69 -0
- data/spec/template/spec_email_template.erb +4 -0
- data/spec/unit/connection/mysql_spec.rb +102 -0
- data/spec/unit/misc/email_spec.rb +37 -0
- data/spec/unit/misc/pid_spec.rb +25 -0
- data/spec/unit/misc/step_spec.rb +53 -0
- data/template/destination.yml +6 -0
- data/template/email.erb +1 -0
- data/template/email.yml +18 -0
- data/template/plan.rb +10 -0
- data/template/source.yml +6 -0
- metadata +289 -0
@@ -0,0 +1,399 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
6
|
+
|
7
|
+
<title>class Forklift::Base::Mailer - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<link type="text/css" media="screen" href="../../rdoc.css" rel="stylesheet">
|
10
|
+
|
11
|
+
<script type="text/javascript">
|
12
|
+
var rdoc_rel_prefix = "../../";
|
13
|
+
</script>
|
14
|
+
|
15
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
16
|
+
<script type="text/javascript" charset="utf-8" src="../../js/navigation.js"></script>
|
17
|
+
<script type="text/javascript" charset="utf-8" src="../../js/search_index.js"></script>
|
18
|
+
<script type="text/javascript" charset="utf-8" src="../../js/search.js"></script>
|
19
|
+
<script type="text/javascript" charset="utf-8" src="../../js/searcher.js"></script>
|
20
|
+
<script type="text/javascript" charset="utf-8" src="../../js/darkfish.js"></script>
|
21
|
+
|
22
|
+
|
23
|
+
<body id="top" class="class">
|
24
|
+
<nav id="metadata">
|
25
|
+
<nav id="home-section" class="section">
|
26
|
+
<h3 class="section-header">
|
27
|
+
<a href="../../index.html">Home</a>
|
28
|
+
<a href="../../table_of_contents.html#classes">Classes</a>
|
29
|
+
<a href="../../table_of_contents.html#methods">Methods</a>
|
30
|
+
</h3>
|
31
|
+
</nav>
|
32
|
+
|
33
|
+
|
34
|
+
<nav id="search-section" class="section project-section" class="initially-hidden">
|
35
|
+
<form action="#" method="get" accept-charset="utf-8">
|
36
|
+
<h3 class="section-header">
|
37
|
+
<input type="text" name="search" placeholder="Search" id="search-field"
|
38
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
39
|
+
</h3>
|
40
|
+
</form>
|
41
|
+
|
42
|
+
<ul id="search-results" class="initially-hidden"></ul>
|
43
|
+
</nav>
|
44
|
+
|
45
|
+
|
46
|
+
<div id="file-metadata">
|
47
|
+
<nav id="file-list-section" class="section">
|
48
|
+
<h3 class="section-header">Defined In</h3>
|
49
|
+
<ul>
|
50
|
+
<li>lib/forklift/base/mailer.rb
|
51
|
+
</ul>
|
52
|
+
</nav>
|
53
|
+
|
54
|
+
|
55
|
+
</div>
|
56
|
+
|
57
|
+
<div id="class-metadata">
|
58
|
+
|
59
|
+
<nav id="parent-class-section" class="section">
|
60
|
+
<h3 class="section-header">Parent</h3>
|
61
|
+
|
62
|
+
<p class="link"><a href="../../Object.html">Object</a>
|
63
|
+
|
64
|
+
</nav>
|
65
|
+
|
66
|
+
|
67
|
+
<!-- Method Quickref -->
|
68
|
+
<nav id="method-list-section" class="section">
|
69
|
+
<h3 class="section-header">Methods</h3>
|
70
|
+
|
71
|
+
<ul class="link-list">
|
72
|
+
|
73
|
+
<li><a href="#method-c-new">::new</a>
|
74
|
+
|
75
|
+
<li><a href="#method-i-config">#config</a>
|
76
|
+
|
77
|
+
<li><a href="#method-i-forklift">#forklift</a>
|
78
|
+
|
79
|
+
<li><a href="#method-i-message_defaults">#message_defaults</a>
|
80
|
+
|
81
|
+
<li><a href="#method-i-send">#send</a>
|
82
|
+
|
83
|
+
<li><a href="#method-i-send_template">#send_template</a>
|
84
|
+
|
85
|
+
</ul>
|
86
|
+
</nav>
|
87
|
+
|
88
|
+
</div>
|
89
|
+
|
90
|
+
<div id="project-metadata">
|
91
|
+
<nav id="fileindex-section" class="section project-section">
|
92
|
+
<h3 class="section-header">Pages</h3>
|
93
|
+
|
94
|
+
<ul>
|
95
|
+
|
96
|
+
<li class="file"><a href="../../Gemfile.html">Gemfile</a>
|
97
|
+
|
98
|
+
<li class="file"><a href="../../Rakefile.html">Rakefile</a>
|
99
|
+
|
100
|
+
<li class="file"><a href="../../example/Gemfile.html">Gemfile</a>
|
101
|
+
|
102
|
+
<li class="file"><a href="../../spec/pid/pidfile.html">pidfile</a>
|
103
|
+
|
104
|
+
</ul>
|
105
|
+
</nav>
|
106
|
+
|
107
|
+
<nav id="classindex-section" class="section project-section">
|
108
|
+
<h3 class="section-header">Class and Module Index</h3>
|
109
|
+
|
110
|
+
<ul class="link-list">
|
111
|
+
|
112
|
+
<li><a href="../../Forklift.html">Forklift</a>
|
113
|
+
|
114
|
+
<li><a href="../../Forklift/Base.html">Forklift::Base</a>
|
115
|
+
|
116
|
+
<li><a href="../../Forklift/Base/Connection.html">Forklift::Base::Connection</a>
|
117
|
+
|
118
|
+
<li><a href="../../Forklift/Base/Logger.html">Forklift::Base::Logger</a>
|
119
|
+
|
120
|
+
<li><a href="../../Forklift/Base/Mailer.html">Forklift::Base::Mailer</a>
|
121
|
+
|
122
|
+
<li><a href="../../Forklift/Base/Mailer/ERBBinding.html">Forklift::Base::Mailer::ERBBinding</a>
|
123
|
+
|
124
|
+
<li><a href="../../Forklift/Base/Pid.html">Forklift::Base::Pid</a>
|
125
|
+
|
126
|
+
<li><a href="../../Forklift/Base/Utils.html">Forklift::Base::Utils</a>
|
127
|
+
|
128
|
+
<li><a href="../../Forklift/Connection.html">Forklift::Connection</a>
|
129
|
+
|
130
|
+
<li><a href="../../Forklift/Connection/Elasticsearch.html">Forklift::Connection::Elasticsearch</a>
|
131
|
+
|
132
|
+
<li><a href="../../Forklift/Connection/Mysql.html">Forklift::Connection::Mysql</a>
|
133
|
+
|
134
|
+
<li><a href="../../Forklift/Patterns.html">Forklift::Patterns</a>
|
135
|
+
|
136
|
+
<li><a href="../../Forklift/Patterns/Elasticsearch.html">Forklift::Patterns::Elasticsearch</a>
|
137
|
+
|
138
|
+
<li><a href="../../Forklift/Patterns/Mysql.html">Forklift::Patterns::Mysql</a>
|
139
|
+
|
140
|
+
<li><a href="../../Forklift/Plan.html">Forklift::Plan</a>
|
141
|
+
|
142
|
+
<li><a href="../../EmailSuffix.html">EmailSuffix</a>
|
143
|
+
|
144
|
+
<li><a href="../../Object.html">Object</a>
|
145
|
+
|
146
|
+
<li><a href="../../SpecClient.html">SpecClient</a>
|
147
|
+
|
148
|
+
<li><a href="../../SpecPlan.html">SpecPlan</a>
|
149
|
+
|
150
|
+
<li><a href="../../SpecSeeds.html">SpecSeeds</a>
|
151
|
+
|
152
|
+
</ul>
|
153
|
+
</nav>
|
154
|
+
|
155
|
+
</div>
|
156
|
+
</nav>
|
157
|
+
|
158
|
+
<div id="documentation">
|
159
|
+
<h1 class="class">class Forklift::Base::Mailer</h1>
|
160
|
+
|
161
|
+
<div id="description" class="description">
|
162
|
+
|
163
|
+
</div><!-- description -->
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
<!-- Methods -->
|
178
|
+
|
179
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section section">
|
180
|
+
<h3 class="section-header">Public Class Methods</h3>
|
181
|
+
|
182
|
+
|
183
|
+
<div id="method-c-new" class="method-detail ">
|
184
|
+
|
185
|
+
<div class="method-heading">
|
186
|
+
<span class="method-name">new</span><span
|
187
|
+
class="method-args">(forklift)</span>
|
188
|
+
<span class="method-click-advice">click to toggle source</span>
|
189
|
+
</div>
|
190
|
+
|
191
|
+
|
192
|
+
<div class="method-description">
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
<div class="method-source-code" id="new-source">
|
199
|
+
<pre><span class="ruby-comment"># File lib/forklift/base/mailer.rb, line 9</span>
|
200
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">forklift</span>)
|
201
|
+
<span class="ruby-ivar">@forklift</span> = <span class="ruby-identifier">forklift</span>
|
202
|
+
<span class="ruby-keyword">end</span></pre>
|
203
|
+
</div><!-- new-source -->
|
204
|
+
|
205
|
+
</div>
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
</div><!-- new-method -->
|
211
|
+
|
212
|
+
|
213
|
+
</section><!-- public-class-method-details -->
|
214
|
+
|
215
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
|
216
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
217
|
+
|
218
|
+
|
219
|
+
<div id="method-i-config" class="method-detail ">
|
220
|
+
|
221
|
+
<div class="method-heading">
|
222
|
+
<span class="method-name">config</span><span
|
223
|
+
class="method-args">()</span>
|
224
|
+
<span class="method-click-advice">click to toggle source</span>
|
225
|
+
</div>
|
226
|
+
|
227
|
+
|
228
|
+
<div class="method-description">
|
229
|
+
|
230
|
+
<p>Public: Pull out the settings from config/email.yml.</p>
|
231
|
+
|
232
|
+
<p>Returns a Hash with all symbolized keys.</p>
|
233
|
+
|
234
|
+
|
235
|
+
|
236
|
+
<div class="method-source-code" id="config-source">
|
237
|
+
<pre><span class="ruby-comment"># File lib/forklift/base/mailer.rb, line 16</span>
|
238
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">config</span>
|
239
|
+
<span class="ruby-identifier">config_file</span> = <span class="ruby-node">"#{forklift.config[:project_root]}/config/email.yml"</span>
|
240
|
+
<span class="ruby-ivar">@config</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">forklift</span>.<span class="ruby-identifier">utils</span>.<span class="ruby-identifier">load_yml</span>(<span class="ruby-identifier">config_file</span>).<span class="ruby-identifier">deep_symbolize_keys</span>
|
241
|
+
<span class="ruby-keyword">end</span></pre>
|
242
|
+
</div><!-- config-source -->
|
243
|
+
|
244
|
+
</div>
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
</div><!-- config-method -->
|
250
|
+
|
251
|
+
|
252
|
+
<div id="method-i-forklift" class="method-detail ">
|
253
|
+
|
254
|
+
<div class="method-heading">
|
255
|
+
<span class="method-name">forklift</span><span
|
256
|
+
class="method-args">()</span>
|
257
|
+
<span class="method-click-advice">click to toggle source</span>
|
258
|
+
</div>
|
259
|
+
|
260
|
+
|
261
|
+
<div class="method-description">
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
<div class="method-source-code" id="forklift-source">
|
268
|
+
<pre><span class="ruby-comment"># File lib/forklift/base/mailer.rb, line 21</span>
|
269
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">forklift</span>
|
270
|
+
<span class="ruby-ivar">@forklift</span>
|
271
|
+
<span class="ruby-keyword">end</span></pre>
|
272
|
+
</div><!-- forklift-source -->
|
273
|
+
|
274
|
+
</div>
|
275
|
+
|
276
|
+
|
277
|
+
|
278
|
+
|
279
|
+
</div><!-- forklift-method -->
|
280
|
+
|
281
|
+
|
282
|
+
<div id="method-i-message_defaults" class="method-detail ">
|
283
|
+
|
284
|
+
<div class="method-heading">
|
285
|
+
<span class="method-name">message_defaults</span><span
|
286
|
+
class="method-args">()</span>
|
287
|
+
<span class="method-click-advice">click to toggle source</span>
|
288
|
+
</div>
|
289
|
+
|
290
|
+
|
291
|
+
<div class="method-description">
|
292
|
+
|
293
|
+
|
294
|
+
|
295
|
+
|
296
|
+
|
297
|
+
<div class="method-source-code" id="message_defaults-source">
|
298
|
+
<pre><span class="ruby-comment"># File lib/forklift/base/mailer.rb, line 25</span>
|
299
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">message_defaults</span>
|
300
|
+
{
|
301
|
+
<span class="ruby-value">:from</span> =<span class="ruby-operator">></span> <span class="ruby-string">"Forklift"</span>,
|
302
|
+
<span class="ruby-value">:subject</span> =<span class="ruby-operator">></span> <span class="ruby-node">"Forklift has moved your database @ #{Time.new}"</span>,
|
303
|
+
<span class="ruby-value">:body</span> =<span class="ruby-operator">></span> <span class="ruby-node">"Forklift has moved your database @ #{Time.new}"</span>,
|
304
|
+
}
|
305
|
+
<span class="ruby-keyword">end</span></pre>
|
306
|
+
</div><!-- message_defaults-source -->
|
307
|
+
|
308
|
+
</div>
|
309
|
+
|
310
|
+
|
311
|
+
|
312
|
+
|
313
|
+
</div><!-- message_defaults-method -->
|
314
|
+
|
315
|
+
|
316
|
+
<div id="method-i-send" class="method-detail ">
|
317
|
+
|
318
|
+
<div class="method-heading">
|
319
|
+
<span class="method-name">send</span><span
|
320
|
+
class="method-args">(args, attachment_lines=[])</span>
|
321
|
+
<span class="method-click-advice">click to toggle source</span>
|
322
|
+
</div>
|
323
|
+
|
324
|
+
|
325
|
+
<div class="method-description">
|
326
|
+
|
327
|
+
|
328
|
+
|
329
|
+
|
330
|
+
|
331
|
+
<div class="method-source-code" id="send-source">
|
332
|
+
<pre><span class="ruby-comment"># File lib/forklift/base/mailer.rb, line 41</span>
|
333
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">send</span>(<span class="ruby-identifier">args</span>, <span class="ruby-identifier">attachment_lines</span>=[])
|
334
|
+
<span class="ruby-identifier">params</span> = <span class="ruby-identifier">message_defaults</span>
|
335
|
+
[<span class="ruby-value">:to</span>, <span class="ruby-value">:from</span>, <span class="ruby-value">:subject</span>, <span class="ruby-value">:body</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
|
336
|
+
<span class="ruby-identifier">params</span>[<span class="ruby-identifier">i</span>] = <span class="ruby-identifier">args</span>[<span class="ruby-identifier">i</span>] <span class="ruby-keyword">unless</span> <span class="ruby-identifier">args</span>[<span class="ruby-identifier">i</span>].<span class="ruby-identifier">nil?</span>
|
337
|
+
<span class="ruby-keyword">end</span>
|
338
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">attachment_lines</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">></span> <span class="ruby-value">0</span>
|
339
|
+
<span class="ruby-identifier">params</span>[<span class="ruby-value">:attachments</span>] = {<span class="ruby-string">"log.txt"</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">attachment_lines</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">"\r\n"</span>)}
|
340
|
+
<span class="ruby-keyword">end</span>
|
341
|
+
<span class="ruby-identifier">deliver</span>(<span class="ruby-identifier">params</span>)
|
342
|
+
<span class="ruby-keyword">end</span></pre>
|
343
|
+
</div><!-- send-source -->
|
344
|
+
|
345
|
+
</div>
|
346
|
+
|
347
|
+
|
348
|
+
|
349
|
+
|
350
|
+
</div><!-- send-method -->
|
351
|
+
|
352
|
+
|
353
|
+
<div id="method-i-send_template" class="method-detail ">
|
354
|
+
|
355
|
+
<div class="method-heading">
|
356
|
+
<span class="method-name">send_template</span><span
|
357
|
+
class="method-args">(args, template_file, variables, attachment_lines=[])</span>
|
358
|
+
<span class="method-click-advice">click to toggle source</span>
|
359
|
+
</div>
|
360
|
+
|
361
|
+
|
362
|
+
<div class="method-description">
|
363
|
+
|
364
|
+
|
365
|
+
|
366
|
+
|
367
|
+
|
368
|
+
<div class="method-source-code" id="send_template-source">
|
369
|
+
<pre><span class="ruby-comment"># File lib/forklift/base/mailer.rb, line 33</span>
|
370
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">send_template</span>(<span class="ruby-identifier">args</span>, <span class="ruby-identifier">template_file</span>, <span class="ruby-identifier">variables</span>, <span class="ruby-identifier">attachment_lines</span>=[])
|
371
|
+
<span class="ruby-identifier">renderer</span> = <span class="ruby-constant">ERB</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">template_file</span>))
|
372
|
+
<span class="ruby-identifier">binder</span> = <span class="ruby-constant">ERBBinding</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">variables</span>)
|
373
|
+
<span class="ruby-identifier">body</span> = <span class="ruby-identifier">renderer</span>.<span class="ruby-identifier">result</span>(<span class="ruby-identifier">binder</span>.<span class="ruby-identifier">get_binding</span>)
|
374
|
+
<span class="ruby-identifier">args</span>[<span class="ruby-value">:body</span>] = <span class="ruby-identifier">body</span>
|
375
|
+
<span class="ruby-identifier">send</span>(<span class="ruby-identifier">args</span>, <span class="ruby-identifier">attachment_lines</span>)
|
376
|
+
<span class="ruby-keyword">end</span></pre>
|
377
|
+
</div><!-- send_template-source -->
|
378
|
+
|
379
|
+
</div>
|
380
|
+
|
381
|
+
|
382
|
+
|
383
|
+
|
384
|
+
</div><!-- send_template-method -->
|
385
|
+
|
386
|
+
|
387
|
+
</section><!-- public-instance-method-details -->
|
388
|
+
|
389
|
+
</section><!-- 5Buntitled-5D -->
|
390
|
+
|
391
|
+
</div><!-- documentation -->
|
392
|
+
|
393
|
+
|
394
|
+
<footer id="validator-badges">
|
395
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
396
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.2.
|
397
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
398
|
+
</footer>
|
399
|
+
|
@@ -0,0 +1,256 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
6
|
+
|
7
|
+
<title>class Forklift::Base::Mailer::ERBBinding - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<link type="text/css" media="screen" href="../../../rdoc.css" rel="stylesheet">
|
10
|
+
|
11
|
+
<script type="text/javascript">
|
12
|
+
var rdoc_rel_prefix = "../../../";
|
13
|
+
</script>
|
14
|
+
|
15
|
+
<script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
|
16
|
+
<script type="text/javascript" charset="utf-8" src="../../../js/navigation.js"></script>
|
17
|
+
<script type="text/javascript" charset="utf-8" src="../../../js/search_index.js"></script>
|
18
|
+
<script type="text/javascript" charset="utf-8" src="../../../js/search.js"></script>
|
19
|
+
<script type="text/javascript" charset="utf-8" src="../../../js/searcher.js"></script>
|
20
|
+
<script type="text/javascript" charset="utf-8" src="../../../js/darkfish.js"></script>
|
21
|
+
|
22
|
+
|
23
|
+
<body id="top" class="class">
|
24
|
+
<nav id="metadata">
|
25
|
+
<nav id="home-section" class="section">
|
26
|
+
<h3 class="section-header">
|
27
|
+
<a href="../../../index.html">Home</a>
|
28
|
+
<a href="../../../table_of_contents.html#classes">Classes</a>
|
29
|
+
<a href="../../../table_of_contents.html#methods">Methods</a>
|
30
|
+
</h3>
|
31
|
+
</nav>
|
32
|
+
|
33
|
+
|
34
|
+
<nav id="search-section" class="section project-section" class="initially-hidden">
|
35
|
+
<form action="#" method="get" accept-charset="utf-8">
|
36
|
+
<h3 class="section-header">
|
37
|
+
<input type="text" name="search" placeholder="Search" id="search-field"
|
38
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
39
|
+
</h3>
|
40
|
+
</form>
|
41
|
+
|
42
|
+
<ul id="search-results" class="initially-hidden"></ul>
|
43
|
+
</nav>
|
44
|
+
|
45
|
+
|
46
|
+
<div id="file-metadata">
|
47
|
+
<nav id="file-list-section" class="section">
|
48
|
+
<h3 class="section-header">Defined In</h3>
|
49
|
+
<ul>
|
50
|
+
<li>lib/forklift/base/mailer.rb
|
51
|
+
</ul>
|
52
|
+
</nav>
|
53
|
+
|
54
|
+
|
55
|
+
</div>
|
56
|
+
|
57
|
+
<div id="class-metadata">
|
58
|
+
|
59
|
+
<nav id="parent-class-section" class="section">
|
60
|
+
<h3 class="section-header">Parent</h3>
|
61
|
+
|
62
|
+
<p class="link"><a href="../../../Object.html">Object</a>
|
63
|
+
|
64
|
+
</nav>
|
65
|
+
|
66
|
+
|
67
|
+
<!-- Method Quickref -->
|
68
|
+
<nav id="method-list-section" class="section">
|
69
|
+
<h3 class="section-header">Methods</h3>
|
70
|
+
|
71
|
+
<ul class="link-list">
|
72
|
+
|
73
|
+
<li><a href="#method-c-new">::new</a>
|
74
|
+
|
75
|
+
<li><a href="#method-i-get_binding">#get_binding</a>
|
76
|
+
|
77
|
+
</ul>
|
78
|
+
</nav>
|
79
|
+
|
80
|
+
</div>
|
81
|
+
|
82
|
+
<div id="project-metadata">
|
83
|
+
<nav id="fileindex-section" class="section project-section">
|
84
|
+
<h3 class="section-header">Pages</h3>
|
85
|
+
|
86
|
+
<ul>
|
87
|
+
|
88
|
+
<li class="file"><a href="../../../Gemfile.html">Gemfile</a>
|
89
|
+
|
90
|
+
<li class="file"><a href="../../../Rakefile.html">Rakefile</a>
|
91
|
+
|
92
|
+
<li class="file"><a href="../../../example/Gemfile.html">Gemfile</a>
|
93
|
+
|
94
|
+
<li class="file"><a href="../../../spec/pid/pidfile.html">pidfile</a>
|
95
|
+
|
96
|
+
</ul>
|
97
|
+
</nav>
|
98
|
+
|
99
|
+
<nav id="classindex-section" class="section project-section">
|
100
|
+
<h3 class="section-header">Class and Module Index</h3>
|
101
|
+
|
102
|
+
<ul class="link-list">
|
103
|
+
|
104
|
+
<li><a href="../../../Forklift.html">Forklift</a>
|
105
|
+
|
106
|
+
<li><a href="../../../Forklift/Base.html">Forklift::Base</a>
|
107
|
+
|
108
|
+
<li><a href="../../../Forklift/Base/Connection.html">Forklift::Base::Connection</a>
|
109
|
+
|
110
|
+
<li><a href="../../../Forklift/Base/Logger.html">Forklift::Base::Logger</a>
|
111
|
+
|
112
|
+
<li><a href="../../../Forklift/Base/Mailer.html">Forklift::Base::Mailer</a>
|
113
|
+
|
114
|
+
<li><a href="../../../Forklift/Base/Mailer/ERBBinding.html">Forklift::Base::Mailer::ERBBinding</a>
|
115
|
+
|
116
|
+
<li><a href="../../../Forklift/Base/Pid.html">Forklift::Base::Pid</a>
|
117
|
+
|
118
|
+
<li><a href="../../../Forklift/Base/Utils.html">Forklift::Base::Utils</a>
|
119
|
+
|
120
|
+
<li><a href="../../../Forklift/Connection.html">Forklift::Connection</a>
|
121
|
+
|
122
|
+
<li><a href="../../../Forklift/Connection/Elasticsearch.html">Forklift::Connection::Elasticsearch</a>
|
123
|
+
|
124
|
+
<li><a href="../../../Forklift/Connection/Mysql.html">Forklift::Connection::Mysql</a>
|
125
|
+
|
126
|
+
<li><a href="../../../Forklift/Patterns.html">Forklift::Patterns</a>
|
127
|
+
|
128
|
+
<li><a href="../../../Forklift/Patterns/Elasticsearch.html">Forklift::Patterns::Elasticsearch</a>
|
129
|
+
|
130
|
+
<li><a href="../../../Forklift/Patterns/Mysql.html">Forklift::Patterns::Mysql</a>
|
131
|
+
|
132
|
+
<li><a href="../../../Forklift/Plan.html">Forklift::Plan</a>
|
133
|
+
|
134
|
+
<li><a href="../../../EmailSuffix.html">EmailSuffix</a>
|
135
|
+
|
136
|
+
<li><a href="../../../Object.html">Object</a>
|
137
|
+
|
138
|
+
<li><a href="../../../SpecClient.html">SpecClient</a>
|
139
|
+
|
140
|
+
<li><a href="../../../SpecPlan.html">SpecPlan</a>
|
141
|
+
|
142
|
+
<li><a href="../../../SpecSeeds.html">SpecSeeds</a>
|
143
|
+
|
144
|
+
</ul>
|
145
|
+
</nav>
|
146
|
+
|
147
|
+
</div>
|
148
|
+
</nav>
|
149
|
+
|
150
|
+
<div id="documentation">
|
151
|
+
<h1 class="class">class Forklift::Base::Mailer::ERBBinding</h1>
|
152
|
+
|
153
|
+
<div id="description" class="description">
|
154
|
+
|
155
|
+
</div><!-- description -->
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
<!-- Methods -->
|
170
|
+
|
171
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section section">
|
172
|
+
<h3 class="section-header">Public Class Methods</h3>
|
173
|
+
|
174
|
+
|
175
|
+
<div id="method-c-new" class="method-detail ">
|
176
|
+
|
177
|
+
<div class="method-heading">
|
178
|
+
<span class="method-name">new</span><span
|
179
|
+
class="method-args">(hash)</span>
|
180
|
+
<span class="method-click-advice">click to toggle source</span>
|
181
|
+
</div>
|
182
|
+
|
183
|
+
|
184
|
+
<div class="method-description">
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
|
190
|
+
<div class="method-source-code" id="new-source">
|
191
|
+
<pre><span class="ruby-comment"># File lib/forklift/base/mailer.rb, line 69</span>
|
192
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">hash</span>)
|
193
|
+
<span class="ruby-identifier">hash</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
|
194
|
+
<span class="ruby-identifier">v</span> = <span class="ruby-identifier">v</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-string">"'"</span>, <span class="ruby-string">" "</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">v</span>.<span class="ruby-identifier">class</span> <span class="ruby-operator">==</span> <span class="ruby-constant">String</span>
|
195
|
+
<span class="ruby-identifier">instance_variable_set</span>(<span class="ruby-node">"@#{k}"</span>, <span class="ruby-identifier">v</span>)
|
196
|
+
<span class="ruby-keyword">end</span>
|
197
|
+
<span class="ruby-keyword">end</span></pre>
|
198
|
+
</div><!-- new-source -->
|
199
|
+
|
200
|
+
</div>
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
</div><!-- new-method -->
|
206
|
+
|
207
|
+
|
208
|
+
</section><!-- public-class-method-details -->
|
209
|
+
|
210
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
|
211
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
212
|
+
|
213
|
+
|
214
|
+
<div id="method-i-get_binding" class="method-detail ">
|
215
|
+
|
216
|
+
<div class="method-heading">
|
217
|
+
<span class="method-name">get_binding</span><span
|
218
|
+
class="method-args">()</span>
|
219
|
+
<span class="method-click-advice">click to toggle source</span>
|
220
|
+
</div>
|
221
|
+
|
222
|
+
|
223
|
+
<div class="method-description">
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
<div class="method-source-code" id="get_binding-source">
|
230
|
+
<pre><span class="ruby-comment"># File lib/forklift/base/mailer.rb, line 76</span>
|
231
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_binding</span>
|
232
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">binding</span>()
|
233
|
+
<span class="ruby-keyword">end</span></pre>
|
234
|
+
</div><!-- get_binding-source -->
|
235
|
+
|
236
|
+
</div>
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
</div><!-- get_binding-method -->
|
242
|
+
|
243
|
+
|
244
|
+
</section><!-- public-instance-method-details -->
|
245
|
+
|
246
|
+
</section><!-- 5Buntitled-5D -->
|
247
|
+
|
248
|
+
</div><!-- documentation -->
|
249
|
+
|
250
|
+
|
251
|
+
<footer id="validator-badges">
|
252
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
253
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.2.
|
254
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
255
|
+
</footer>
|
256
|
+
|