spoonerize 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.github/workflows/ruby.yml +24 -0
- data/.gitignore +1 -0
- data/Gemfile +7 -0
- data/LICENSE +21 -0
- data/README.md +106 -0
- data/Rakefile +19 -0
- data/_config.yml +1 -0
- data/bin/spoonerize +5 -0
- data/doc/README_md.html +200 -0
- data/doc/Spoonerize/Bumper.html +287 -0
- data/doc/Spoonerize/Cli.html +544 -0
- data/doc/Spoonerize/Log.html +362 -0
- data/doc/Spoonerize/Spoonerism.html +590 -0
- data/doc/Spoonerize.html +125 -0
- data/doc/created.rid +8 -0
- data/doc/css/fonts.css +167 -0
- data/doc/css/rdoc.css +619 -0
- data/doc/fonts/Lato-Light.ttf +0 -0
- data/doc/fonts/Lato-LightItalic.ttf +0 -0
- data/doc/fonts/Lato-Regular.ttf +0 -0
- data/doc/fonts/Lato-RegularItalic.ttf +0 -0
- data/doc/fonts/SourceCodePro-Bold.ttf +0 -0
- data/doc/fonts/SourceCodePro-Regular.ttf +0 -0
- data/doc/images/add.png +0 -0
- data/doc/images/arrow_up.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 +203 -0
- data/doc/js/darkfish.js +84 -0
- data/doc/js/navigation.js +105 -0
- data/doc/js/navigation.js.gz +0 -0
- data/doc/js/search.js +110 -0
- data/doc/js/search_index.js +1 -0
- data/doc/js/search_index.js.gz +0 -0
- data/doc/js/searcher.js +229 -0
- data/doc/js/searcher.js.gz +0 -0
- data/doc/table_of_contents.html +242 -0
- data/lib/config/lazy_words.yml +21 -0
- data/lib/spoonerize/bumper.rb +61 -0
- data/lib/spoonerize/cli.rb +158 -0
- data/lib/spoonerize/log.rb +68 -0
- data/lib/spoonerize/spoonerism.rb +166 -0
- data/lib/spoonerize/version.rb +5 -0
- data/lib/spoonerize.rb +21 -0
- data/pkg/spoonerize-0.0.7.gem +0 -0
- data/spoonerize.gemspec +38 -0
- metadata +154 -0
@@ -0,0 +1,362 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class Spoonerize::Log - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "../";
|
11
|
+
var index_rel_prefix = "../";
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<script src="../js/navigation.js" defer></script>
|
15
|
+
<script src="../js/search.js" defer></script>
|
16
|
+
<script src="../js/search_index.js" defer></script>
|
17
|
+
<script src="../js/searcher.js" defer></script>
|
18
|
+
<script src="../js/darkfish.js" defer></script>
|
19
|
+
|
20
|
+
<link href="../css/fonts.css" rel="stylesheet">
|
21
|
+
<link href="../css/rdoc.css" rel="stylesheet">
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
<body id="top" role="document" class="class">
|
27
|
+
<nav role="navigation">
|
28
|
+
<div id="project-navigation">
|
29
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
30
|
+
<h2>
|
31
|
+
<a href="../index.html" rel="home">Home</a>
|
32
|
+
</h2>
|
33
|
+
|
34
|
+
<div id="table-of-contents-navigation">
|
35
|
+
<a href="../table_of_contents.html#pages">Pages</a>
|
36
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
37
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
38
|
+
</div>
|
39
|
+
</div>
|
40
|
+
|
41
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
42
|
+
<form action="#" method="get" accept-charset="utf-8">
|
43
|
+
<div id="search-field-wrapper">
|
44
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
45
|
+
aria-autocomplete="list" aria-controls="search-results"
|
46
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
47
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
48
|
+
</div>
|
49
|
+
|
50
|
+
<ul id="search-results" aria-label="Search Results"
|
51
|
+
aria-busy="false" aria-expanded="false"
|
52
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
53
|
+
</form>
|
54
|
+
</div>
|
55
|
+
|
56
|
+
</div>
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
<div id="class-metadata">
|
61
|
+
|
62
|
+
<div id="parent-class-section" class="nav-section">
|
63
|
+
<h3>Parent</h3>
|
64
|
+
|
65
|
+
|
66
|
+
<p class="link">Object
|
67
|
+
|
68
|
+
</div>
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
<!-- Method Quickref -->
|
73
|
+
<div id="method-list-section" class="nav-section">
|
74
|
+
<h3>Methods</h3>
|
75
|
+
|
76
|
+
<ul class="link-list" role="directory">
|
77
|
+
|
78
|
+
<li ><a href="#method-c-new">::new</a>
|
79
|
+
|
80
|
+
<li ><a href="#method-i-contents">#contents</a>
|
81
|
+
|
82
|
+
<li ><a href="#method-i-each">#each</a>
|
83
|
+
|
84
|
+
<li ><a href="#method-i-size">#size</a>
|
85
|
+
|
86
|
+
<li ><a href="#method-i-write">#write</a>
|
87
|
+
|
88
|
+
</ul>
|
89
|
+
</div>
|
90
|
+
|
91
|
+
</div>
|
92
|
+
</nav>
|
93
|
+
|
94
|
+
<main role="main" aria-labelledby="class-Spoonerize::Log">
|
95
|
+
<h1 id="class-Spoonerize::Log" class="class">
|
96
|
+
class Spoonerize::Log
|
97
|
+
</h1>
|
98
|
+
|
99
|
+
<section class="description">
|
100
|
+
|
101
|
+
<p>Class that handles reading/writing logs.</p>
|
102
|
+
|
103
|
+
</section>
|
104
|
+
|
105
|
+
|
106
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
<section class="attribute-method-details" class="method-section">
|
115
|
+
<header>
|
116
|
+
<h3>Attributes</h3>
|
117
|
+
</header>
|
118
|
+
|
119
|
+
|
120
|
+
<div id="attribute-i-directory" class="method-detail">
|
121
|
+
<div class="method-heading attribute-method-heading">
|
122
|
+
<span class="method-name">directory</span><span
|
123
|
+
class="attribute-access-type">[R]</span>
|
124
|
+
</div>
|
125
|
+
|
126
|
+
<div class="method-description">
|
127
|
+
|
128
|
+
<p>The directory the file is located.</p>
|
129
|
+
|
130
|
+
<p>@return [String]</p>
|
131
|
+
|
132
|
+
</div>
|
133
|
+
</div>
|
134
|
+
|
135
|
+
<div id="attribute-i-file" class="method-detail">
|
136
|
+
<div class="method-heading attribute-method-heading">
|
137
|
+
<span class="method-name">file</span><span
|
138
|
+
class="attribute-access-type">[R]</span>
|
139
|
+
</div>
|
140
|
+
|
141
|
+
<div class="method-description">
|
142
|
+
|
143
|
+
<p>The file name to use.</p>
|
144
|
+
|
145
|
+
<p>@return [String]</p>
|
146
|
+
|
147
|
+
</div>
|
148
|
+
</div>
|
149
|
+
|
150
|
+
</section>
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
155
|
+
<header>
|
156
|
+
<h3>Public Class Methods</h3>
|
157
|
+
</header>
|
158
|
+
|
159
|
+
|
160
|
+
<div id="method-c-new" class="method-detail ">
|
161
|
+
|
162
|
+
<div class="method-heading">
|
163
|
+
<span class="method-name">new</span><span
|
164
|
+
class="method-args">(file)</span>
|
165
|
+
|
166
|
+
<span class="method-click-advice">click to toggle source</span>
|
167
|
+
|
168
|
+
</div>
|
169
|
+
|
170
|
+
|
171
|
+
<div class="method-description">
|
172
|
+
|
173
|
+
<p>Constructor for <a href="Log.html"><code>Log</code></a>.</p>
|
174
|
+
|
175
|
+
<p>@param [String] file</p>
|
176
|
+
|
177
|
+
<p>@return [Spoonerize::Log]</p>
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
<div class="method-source-code" id="new-source">
|
183
|
+
<pre><span class="ruby-comment"># File lib/spoonerize/log.rb, line 27</span>
|
184
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">file</span>)
|
185
|
+
<span class="ruby-ivar">@file</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">file</span>)
|
186
|
+
<span class="ruby-ivar">@directory</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-identifier">file</span>)
|
187
|
+
<span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>(<span class="ruby-identifier">directory</span>) <span class="ruby-keyword">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-identifier">directory</span>)
|
188
|
+
<span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">touch</span>(<span class="ruby-identifier">file</span>) <span class="ruby-keyword">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">file?</span>(<span class="ruby-identifier">file</span>)
|
189
|
+
<span class="ruby-keyword">end</span></pre>
|
190
|
+
</div>
|
191
|
+
|
192
|
+
</div>
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
</div>
|
198
|
+
|
199
|
+
|
200
|
+
</section>
|
201
|
+
|
202
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
203
|
+
<header>
|
204
|
+
<h3>Public Instance Methods</h3>
|
205
|
+
</header>
|
206
|
+
|
207
|
+
|
208
|
+
<div id="method-i-contents" class="method-detail ">
|
209
|
+
|
210
|
+
<div class="method-heading">
|
211
|
+
<span class="method-name">contents</span><span
|
212
|
+
class="method-args">()</span>
|
213
|
+
|
214
|
+
<span class="method-click-advice">click to toggle source</span>
|
215
|
+
|
216
|
+
</div>
|
217
|
+
|
218
|
+
|
219
|
+
<div class="method-description">
|
220
|
+
|
221
|
+
<p>The contents of the log file.</p>
|
222
|
+
|
223
|
+
<p>@return [Array]</p>
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
|
228
|
+
<div class="method-source-code" id="contents-source">
|
229
|
+
<pre><span class="ruby-comment"># File lib/spoonerize/log.rb, line 38</span>
|
230
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">contents</span>
|
231
|
+
<span class="ruby-operator">::</span><span class="ruby-constant">CSV</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">file</span>)
|
232
|
+
<span class="ruby-keyword">end</span></pre>
|
233
|
+
</div>
|
234
|
+
|
235
|
+
</div>
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
</div>
|
241
|
+
|
242
|
+
|
243
|
+
<div id="method-i-each" class="method-detail ">
|
244
|
+
|
245
|
+
<div class="method-heading">
|
246
|
+
<span class="method-name">each</span><span
|
247
|
+
class="method-args">() { |row| ... }</span>
|
248
|
+
|
249
|
+
<span class="method-click-advice">click to toggle source</span>
|
250
|
+
|
251
|
+
</div>
|
252
|
+
|
253
|
+
|
254
|
+
<div class="method-description">
|
255
|
+
|
256
|
+
<p>Iterate through each line of the file.</p>
|
257
|
+
|
258
|
+
<p>@return [Array]</p>
|
259
|
+
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
<div class="method-source-code" id="each-source">
|
264
|
+
<pre><span class="ruby-comment"># File lib/spoonerize/log.rb, line 56</span>
|
265
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">each</span>
|
266
|
+
<span class="ruby-identifier">contents</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">row</span><span class="ruby-operator">|</span> <span class="ruby-keyword">yield</span> <span class="ruby-identifier">row</span> }
|
267
|
+
<span class="ruby-keyword">end</span></pre>
|
268
|
+
</div>
|
269
|
+
|
270
|
+
</div>
|
271
|
+
|
272
|
+
|
273
|
+
|
274
|
+
|
275
|
+
</div>
|
276
|
+
|
277
|
+
|
278
|
+
<div id="method-i-size" class="method-detail ">
|
279
|
+
|
280
|
+
<div class="method-heading">
|
281
|
+
<span class="method-name">size</span><span
|
282
|
+
class="method-args">()</span>
|
283
|
+
|
284
|
+
<span class="method-click-advice">click to toggle source</span>
|
285
|
+
|
286
|
+
</div>
|
287
|
+
|
288
|
+
|
289
|
+
<div class="method-description">
|
290
|
+
|
291
|
+
<p>Number of entries in the file.</p>
|
292
|
+
|
293
|
+
<p>@return [Integer]</p>
|
294
|
+
|
295
|
+
|
296
|
+
|
297
|
+
|
298
|
+
<div class="method-source-code" id="size-source">
|
299
|
+
<pre><span class="ruby-comment"># File lib/spoonerize/log.rb, line 64</span>
|
300
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">size</span>
|
301
|
+
<span class="ruby-identifier">contents</span>.<span class="ruby-identifier">size</span>
|
302
|
+
<span class="ruby-keyword">end</span></pre>
|
303
|
+
</div>
|
304
|
+
|
305
|
+
</div>
|
306
|
+
|
307
|
+
|
308
|
+
|
309
|
+
|
310
|
+
</div>
|
311
|
+
|
312
|
+
|
313
|
+
<div id="method-i-write" class="method-detail ">
|
314
|
+
|
315
|
+
<div class="method-heading">
|
316
|
+
<span class="method-name">write</span><span
|
317
|
+
class="method-args">(row)</span>
|
318
|
+
|
319
|
+
<span class="method-click-advice">click to toggle source</span>
|
320
|
+
|
321
|
+
</div>
|
322
|
+
|
323
|
+
|
324
|
+
<div class="method-description">
|
325
|
+
|
326
|
+
<p>Writes a line to the log.</p>
|
327
|
+
|
328
|
+
<p>@param [Array] row</p>
|
329
|
+
|
330
|
+
<p>@return [Array]</p>
|
331
|
+
|
332
|
+
|
333
|
+
|
334
|
+
|
335
|
+
<div class="method-source-code" id="write-source">
|
336
|
+
<pre><span class="ruby-comment"># File lib/spoonerize/log.rb, line 48</span>
|
337
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">write</span>(<span class="ruby-identifier">row</span>)
|
338
|
+
<span class="ruby-operator">::</span><span class="ruby-constant">CSV</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">file</span>, <span class="ruby-string">'a'</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">csv</span><span class="ruby-operator">|</span> <span class="ruby-identifier">csv</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">row</span> }
|
339
|
+
<span class="ruby-keyword">end</span></pre>
|
340
|
+
</div>
|
341
|
+
|
342
|
+
</div>
|
343
|
+
|
344
|
+
|
345
|
+
|
346
|
+
|
347
|
+
</div>
|
348
|
+
|
349
|
+
|
350
|
+
</section>
|
351
|
+
|
352
|
+
</section>
|
353
|
+
|
354
|
+
</main>
|
355
|
+
|
356
|
+
|
357
|
+
<footer id="validator-badges" role="contentinfo">
|
358
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
359
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.2.1.
|
360
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
361
|
+
</footer>
|
362
|
+
|