spoonerize 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/README.md +2 -4
  4. data/Rakefile +1 -1
  5. data/lib/spoonerize/version.rb +1 -1
  6. data/spoonerize.gemspec +1 -1
  7. metadata +3 -53
  8. data/doc/README_md.html +0 -238
  9. data/doc/Spoonerize.html +0 -125
  10. data/doc/Spoonerize/Bumper.html +0 -287
  11. data/doc/Spoonerize/Cli.html +0 -545
  12. data/doc/Spoonerize/Log.html +0 -362
  13. data/doc/Spoonerize/Spoonerism.html +0 -759
  14. data/doc/created.rid +0 -8
  15. data/doc/css/fonts.css +0 -167
  16. data/doc/css/rdoc.css +0 -619
  17. data/doc/fonts/Lato-Light.ttf +0 -0
  18. data/doc/fonts/Lato-LightItalic.ttf +0 -0
  19. data/doc/fonts/Lato-Regular.ttf +0 -0
  20. data/doc/fonts/Lato-RegularItalic.ttf +0 -0
  21. data/doc/fonts/SourceCodePro-Bold.ttf +0 -0
  22. data/doc/fonts/SourceCodePro-Regular.ttf +0 -0
  23. data/doc/images/add.png +0 -0
  24. data/doc/images/arrow_up.png +0 -0
  25. data/doc/images/brick.png +0 -0
  26. data/doc/images/brick_link.png +0 -0
  27. data/doc/images/bug.png +0 -0
  28. data/doc/images/bullet_black.png +0 -0
  29. data/doc/images/bullet_toggle_minus.png +0 -0
  30. data/doc/images/bullet_toggle_plus.png +0 -0
  31. data/doc/images/date.png +0 -0
  32. data/doc/images/delete.png +0 -0
  33. data/doc/images/find.png +0 -0
  34. data/doc/images/loadingAnimation.gif +0 -0
  35. data/doc/images/macFFBgHack.png +0 -0
  36. data/doc/images/package.png +0 -0
  37. data/doc/images/page_green.png +0 -0
  38. data/doc/images/page_white_text.png +0 -0
  39. data/doc/images/page_white_width.png +0 -0
  40. data/doc/images/plugin.png +0 -0
  41. data/doc/images/ruby.png +0 -0
  42. data/doc/images/tag_blue.png +0 -0
  43. data/doc/images/tag_green.png +0 -0
  44. data/doc/images/transparent.png +0 -0
  45. data/doc/images/wrench.png +0 -0
  46. data/doc/images/wrench_orange.png +0 -0
  47. data/doc/images/zoom.png +0 -0
  48. data/doc/index.html +0 -241
  49. data/doc/js/darkfish.js +0 -84
  50. data/doc/js/navigation.js +0 -105
  51. data/doc/js/navigation.js.gz +0 -0
  52. data/doc/js/search.js +0 -110
  53. data/doc/js/search_index.js +0 -1
  54. data/doc/js/search_index.js.gz +0 -0
  55. data/doc/js/searcher.js +0 -229
  56. data/doc/js/searcher.js.gz +0 -0
  57. data/doc/table_of_contents.html +0 -257
@@ -1,287 +0,0 @@
1
- <!DOCTYPE html>
2
-
3
- <html>
4
- <head>
5
- <meta charset="UTF-8">
6
-
7
- <title>class Spoonerize::Bumper - 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-bump">#bump</a>
81
-
82
- <li ><a href="#method-i-reverse-3F">#reverse?</a>
83
-
84
- </ul>
85
- </div>
86
-
87
- </div>
88
- </nav>
89
-
90
- <main role="main" aria-labelledby="class-Spoonerize::Bumper">
91
- <h1 id="class-Spoonerize::Bumper" class="class">
92
- class Spoonerize::Bumper
93
- </h1>
94
-
95
- <section class="description">
96
-
97
- <p>Class that handles bumping an index.</p>
98
-
99
- </section>
100
-
101
-
102
- <section id="5Buntitled-5D" class="documentation-section">
103
-
104
-
105
-
106
-
107
-
108
-
109
-
110
- <section class="attribute-method-details" class="method-section">
111
- <header>
112
- <h3>Attributes</h3>
113
- </header>
114
-
115
-
116
- <div id="attribute-i-max_value" class="method-detail">
117
- <div class="method-heading attribute-method-heading">
118
- <span class="method-name">max_value</span><span
119
- class="attribute-access-type">[R]</span>
120
- </div>
121
-
122
- <div class="method-description">
123
-
124
- <p>The maximum before index wraps back to zero.</p>
125
-
126
- <p>@return [Integer]</p>
127
-
128
- </div>
129
- </div>
130
-
131
- <div id="attribute-i-value" class="method-detail">
132
- <div class="method-heading attribute-method-heading">
133
- <span class="method-name">value</span><span
134
- class="attribute-access-type">[R]</span>
135
- </div>
136
-
137
- <div class="method-description">
138
-
139
- <p>The number after being bumped.</p>
140
-
141
- <p>@return [Integer]</p>
142
-
143
- </div>
144
- </div>
145
-
146
- </section>
147
-
148
-
149
-
150
- <section id="public-class-5Buntitled-5D-method-details" class="method-section">
151
- <header>
152
- <h3>Public Class Methods</h3>
153
- </header>
154
-
155
-
156
- <div id="method-c-new" class="method-detail ">
157
-
158
- <div class="method-heading">
159
- <span class="method-name">new</span><span
160
- class="method-args">(initial_value, max_value, reverse = false)</span>
161
-
162
- <span class="method-click-advice">click to toggle source</span>
163
-
164
- </div>
165
-
166
-
167
- <div class="method-description">
168
-
169
- <p>Sets the bumper relative to the current index of words array. The value is automatically bumped once when instantiated. If on the last element of the words array, sets the bumper to 0.</p>
170
-
171
- <p>@param [Integer] initial_value</p>
172
-
173
- <p>@param [Integer] <a href="Bumper.html#attribute-i-max_value"><code>max_value</code></a></p>
174
-
175
- <p>@param [Boolean] reverse Flip the order</p>
176
-
177
-
178
-
179
-
180
- <div class="method-source-code" id="new-source">
181
- <pre><span class="ruby-comment"># File lib/spoonerize/bumper.rb, line 28</span>
182
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">initial_value</span>, <span class="ruby-identifier">max_value</span>, <span class="ruby-identifier">reverse</span> = <span class="ruby-keyword">false</span>)
183
- <span class="ruby-ivar">@max_value</span> = <span class="ruby-identifier">max_value</span>
184
- <span class="ruby-ivar">@reverse</span> = <span class="ruby-identifier">reverse</span>
185
- <span class="ruby-ivar">@value</span> = <span class="ruby-identifier">bump_value</span>(<span class="ruby-identifier">initial_value</span>)
186
- <span class="ruby-keyword">end</span></pre>
187
- </div>
188
-
189
- </div>
190
-
191
-
192
-
193
-
194
- </div>
195
-
196
-
197
- </section>
198
-
199
- <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
200
- <header>
201
- <h3>Public Instance Methods</h3>
202
- </header>
203
-
204
-
205
- <div id="method-i-bump" class="method-detail ">
206
-
207
- <div class="method-heading">
208
- <span class="method-name">bump</span><span
209
- class="method-args">()</span>
210
-
211
- <span class="method-click-advice">click to toggle source</span>
212
-
213
- </div>
214
-
215
-
216
- <div class="method-description">
217
-
218
- <p>Increments/Decrements the bumper. If on the last element of the words array, sets the bumper to 0. We don&#39;t need to worry about resetting the value to 0 when going in reverse, because when the array index is negative, it reads from the end of the array, which is already what we want.</p>
219
-
220
- <p>@return [Integer]</p>
221
-
222
-
223
-
224
-
225
- <div class="method-source-code" id="bump-source">
226
- <pre><span class="ruby-comment"># File lib/spoonerize/bumper.rb, line 42</span>
227
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">bump</span>
228
- <span class="ruby-ivar">@value</span> = <span class="ruby-identifier">bump_value</span>(<span class="ruby-identifier">value</span>)
229
- <span class="ruby-keyword">end</span></pre>
230
- </div>
231
-
232
- </div>
233
-
234
-
235
-
236
-
237
- </div>
238
-
239
-
240
- <div id="method-i-reverse-3F" class="method-detail ">
241
-
242
- <div class="method-heading">
243
- <span class="method-name">reverse?</span><span
244
- class="method-args">()</span>
245
-
246
- <span class="method-click-advice">click to toggle source</span>
247
-
248
- </div>
249
-
250
-
251
- <div class="method-description">
252
-
253
- <p>Should we decrement instead of increment?</p>
254
-
255
- <p>@return [Boolean]</p>
256
-
257
-
258
-
259
-
260
- <div class="method-source-code" id="reverse-3F-source">
261
- <pre><span class="ruby-comment"># File lib/spoonerize/bumper.rb, line 50</span>
262
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">reverse?</span>
263
- <span class="ruby-ivar">@reverse</span>
264
- <span class="ruby-keyword">end</span></pre>
265
- </div>
266
-
267
- </div>
268
-
269
-
270
-
271
-
272
- </div>
273
-
274
-
275
- </section>
276
-
277
- </section>
278
-
279
- </main>
280
-
281
-
282
- <footer id="validator-badges" role="contentinfo">
283
- <p><a href="https://validator.w3.org/check/referer">Validate</a>
284
- <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.2.1.
285
- <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
286
- </footer>
287
-
@@ -1,545 +0,0 @@
1
- <!DOCTYPE html>
2
-
3
- <html>
4
- <head>
5
- <meta charset="UTF-8">
6
-
7
- <title>class Spoonerize::Cli - 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-execute">::execute</a>
79
-
80
- <li ><a href="#method-c-new">::new</a>
81
-
82
- <li ><a href="#method-i-longest_word_length">#longest_word_length</a>
83
-
84
- <li ><a href="#method-i-map-3F">#map?</a>
85
-
86
- <li ><a href="#method-i-print-3F">#print?</a>
87
-
88
- <li ><a href="#method-i-print_log">#print_log</a>
89
-
90
- <li ><a href="#method-i-print_mappings">#print_mappings</a>
91
-
92
- <li ><a href="#method-i-save-3F">#save?</a>
93
-
94
- <li ><a href="#method-i-spoonerism">#spoonerism</a>
95
-
96
- </ul>
97
- </div>
98
-
99
- </div>
100
- </nav>
101
-
102
- <main role="main" aria-labelledby="class-Spoonerize::Cli">
103
- <h1 id="class-Spoonerize::Cli" class="class">
104
- class Spoonerize::Cli
105
- </h1>
106
-
107
- <section class="description">
108
-
109
- <p>The class for handling the command-line interface.</p>
110
-
111
- </section>
112
-
113
-
114
- <section id="5Buntitled-5D" class="documentation-section">
115
-
116
-
117
-
118
-
119
-
120
- <section class="constants-list">
121
- <header>
122
- <h3>Constants</h3>
123
- </header>
124
- <dl>
125
-
126
- <dt id="PREFERENCE_FILE">PREFERENCE_FILE
127
-
128
- <dd><p>The preferences file the user can create to change runtime options.</p>
129
-
130
- <p>@return [String]</p>
131
-
132
-
133
- </dl>
134
- </section>
135
-
136
-
137
-
138
- <section class="attribute-method-details" class="method-section">
139
- <header>
140
- <h3>Attributes</h3>
141
- </header>
142
-
143
-
144
- <div id="attribute-i-options" class="method-detail">
145
- <div class="method-heading attribute-method-heading">
146
- <span class="method-name">options</span><span
147
- class="attribute-access-type">[R]</span>
148
- </div>
149
-
150
- <div class="method-description">
151
-
152
- <p>Arguments passed at runtime.</p>
153
-
154
- <p>@return [Array] ARGV</p>
155
-
156
- </div>
157
- </div>
158
-
159
- <div id="attribute-i-preferences" class="method-detail">
160
- <div class="method-heading attribute-method-heading">
161
- <span class="method-name">preferences</span><span
162
- class="attribute-access-type">[R]</span>
163
- </div>
164
-
165
- <div class="method-description">
166
-
167
- <p>Preferences after reading config file and parsing ARGV.</p>
168
-
169
- <p>@return [Array]</p>
170
-
171
- </div>
172
- </div>
173
-
174
- </section>
175
-
176
-
177
-
178
- <section id="public-class-5Buntitled-5D-method-details" class="method-section">
179
- <header>
180
- <h3>Public Class Methods</h3>
181
- </header>
182
-
183
-
184
- <div id="method-c-execute" class="method-detail ">
185
-
186
- <div class="method-heading">
187
- <span class="method-name">execute</span><span
188
- class="method-args">(options = [])</span>
189
-
190
- <span class="method-click-advice">click to toggle source</span>
191
-
192
- </div>
193
-
194
-
195
- <div class="method-description">
196
-
197
- <p>Creates an instance of <code>Spoonerism</code> and runs what the user requested.</p>
198
-
199
- <p>@param [Array] options</p>
200
-
201
-
202
-
203
-
204
- <div class="method-source-code" id="execute-source">
205
- <pre><span class="ruby-comment"># File lib/spoonerize/cli.rb, line 20</span>
206
- <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">execute</span>(<span class="ruby-identifier">options</span> = [])
207
- <span class="ruby-identifier">exe</span> = <span class="ruby-identifier">new</span>(<span class="ruby-identifier">options</span>)
208
-
209
- <span class="ruby-keyword">if</span> <span class="ruby-identifier">exe</span>.<span class="ruby-identifier">print?</span>
210
- <span class="ruby-identifier">exe</span>.<span class="ruby-identifier">print_log</span>
211
- <span class="ruby-keyword">return</span>
212
- <span class="ruby-keyword">end</span>
213
-
214
- <span class="ruby-identifier">puts</span> <span class="ruby-identifier">exe</span>.<span class="ruby-identifier">spoonerism</span>.<span class="ruby-identifier">to_s</span>
215
- <span class="ruby-identifier">exe</span>.<span class="ruby-identifier">print_mappings</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">exe</span>.<span class="ruby-identifier">map?</span>
216
-
217
- <span class="ruby-keyword">if</span> <span class="ruby-identifier">exe</span>.<span class="ruby-identifier">save?</span>
218
- <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;Saving...&quot;</span>
219
- <span class="ruby-identifier">exe</span>.<span class="ruby-identifier">spoonerism</span>.<span class="ruby-identifier">save</span>
220
- <span class="ruby-keyword">end</span>
221
- <span class="ruby-keyword">end</span></pre>
222
- </div>
223
-
224
- </div>
225
-
226
-
227
-
228
-
229
- </div>
230
-
231
-
232
- <div id="method-c-new" class="method-detail ">
233
-
234
- <div class="method-heading">
235
- <span class="method-name">new</span><span
236
- class="method-args">(options)</span>
237
-
238
- <span class="method-click-advice">click to toggle source</span>
239
-
240
- </div>
241
-
242
-
243
- <div class="method-description">
244
-
245
- <p>Create instance of <code>Cli</code></p>
246
-
247
- <p>@param [Array] options</p>
248
-
249
- <p>@return [self]</p>
250
-
251
-
252
-
253
-
254
- <div class="method-source-code" id="new-source">
255
- <pre><span class="ruby-comment"># File lib/spoonerize/cli.rb, line 55</span>
256
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">options</span>)
257
- <span class="ruby-ivar">@map</span> = <span class="ruby-keyword">false</span>
258
- <span class="ruby-ivar">@save</span> = <span class="ruby-keyword">false</span>
259
- <span class="ruby-ivar">@print</span> = <span class="ruby-keyword">false</span>
260
- <span class="ruby-ivar">@options</span> = <span class="ruby-identifier">options</span>
261
- <span class="ruby-ivar">@preferences</span> = <span class="ruby-identifier">get_preferences</span>
262
- <span class="ruby-keyword">end</span></pre>
263
- </div>
264
-
265
- </div>
266
-
267
-
268
-
269
-
270
- </div>
271
-
272
-
273
- </section>
274
-
275
- <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
276
- <header>
277
- <h3>Public Instance Methods</h3>
278
- </header>
279
-
280
-
281
- <div id="method-i-longest_word_length" class="method-detail ">
282
-
283
- <div class="method-heading">
284
- <span class="method-name">longest_word_length</span><span
285
- class="method-args">()</span>
286
-
287
- <span class="method-click-advice">click to toggle source</span>
288
-
289
- </div>
290
-
291
-
292
- <div class="method-description">
293
-
294
- <p>The length of the longest word in the phrase.</p>
295
-
296
- <p>@return [Integer]</p>
297
-
298
-
299
-
300
-
301
- <div class="method-source-code" id="longest_word_length-source">
302
- <pre><span class="ruby-comment"># File lib/spoonerize/cli.rb, line 103</span>
303
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">longest_word_length</span>
304
- <span class="ruby-ivar">@longest_word_length</span> <span class="ruby-operator">||=</span>
305
- <span class="ruby-identifier">spoonerism</span>.<span class="ruby-identifier">spoonerize</span>.<span class="ruby-identifier">group_by</span>(<span class="ruby-operator">&amp;</span><span class="ruby-value">:size</span>).<span class="ruby-identifier">max</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">size</span>
306
- <span class="ruby-keyword">end</span></pre>
307
- </div>
308
-
309
- </div>
310
-
311
-
312
-
313
-
314
- </div>
315
-
316
-
317
- <div id="method-i-map-3F" class="method-detail ">
318
-
319
- <div class="method-heading">
320
- <span class="method-name">map?</span><span
321
- class="method-args">()</span>
322
-
323
- <span class="method-click-advice">click to toggle source</span>
324
-
325
- </div>
326
-
327
-
328
- <div class="method-description">
329
-
330
- <p>Should we print the mappings to the command line?</p>
331
-
332
- <p>@return [Boolean]</p>
333
-
334
-
335
-
336
-
337
- <div class="method-source-code" id="map-3F-source">
338
- <pre><span class="ruby-comment"># File lib/spoonerize/cli.rb, line 87</span>
339
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">map?</span>
340
- <span class="ruby-ivar">@map</span>
341
- <span class="ruby-keyword">end</span></pre>
342
- </div>
343
-
344
- </div>
345
-
346
-
347
-
348
-
349
- </div>
350
-
351
-
352
- <div id="method-i-print-3F" class="method-detail ">
353
-
354
- <div class="method-heading">
355
- <span class="method-name">print?</span><span
356
- class="method-args">()</span>
357
-
358
- <span class="method-click-advice">click to toggle source</span>
359
-
360
- </div>
361
-
362
-
363
- <div class="method-description">
364
-
365
- <p>Should we print to the command line?</p>
366
-
367
- <p>@return [Boolean]</p>
368
-
369
-
370
-
371
-
372
- <div class="method-source-code" id="print-3F-source">
373
- <pre><span class="ruby-comment"># File lib/spoonerize/cli.rb, line 95</span>
374
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">print?</span>
375
- <span class="ruby-ivar">@print</span>
376
- <span class="ruby-keyword">end</span></pre>
377
- </div>
378
-
379
- </div>
380
-
381
-
382
-
383
-
384
- </div>
385
-
386
-
387
- <div id="method-i-print_log" class="method-detail ">
388
-
389
- <div class="method-heading">
390
- <span class="method-name">print_log</span><span
391
- class="method-args">()</span>
392
-
393
- <span class="method-click-advice">click to toggle source</span>
394
-
395
- </div>
396
-
397
-
398
- <div class="method-description">
399
-
400
- <p>Print the log file contents to the command line.</p>
401
-
402
- <p>@return [nil]</p>
403
-
404
-
405
-
406
-
407
- <div class="method-source-code" id="print_log-source">
408
- <pre><span class="ruby-comment"># File lib/spoonerize/cli.rb, line 112</span>
409
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">print_log</span>
410
- <span class="ruby-identifier">s</span> = <span class="ruby-constant">Spoonerize</span><span class="ruby-operator">::</span><span class="ruby-constant">Log</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">spoonerism</span>.<span class="ruby-identifier">logfile_name</span>)
411
- <span class="ruby-identifier">s</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-identifier">print</span> <span class="ruby-identifier">row</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&#39; | &#39;</span>) <span class="ruby-operator">+</span> <span class="ruby-string">&quot;\n&quot;</span> }
412
- <span class="ruby-keyword">end</span></pre>
413
- </div>
414
-
415
- </div>
416
-
417
-
418
-
419
-
420
- </div>
421
-
422
-
423
- <div id="method-i-print_mappings" class="method-detail ">
424
-
425
- <div class="method-heading">
426
- <span class="method-name">print_mappings</span><span
427
- class="method-args">()</span>
428
-
429
- <span class="method-click-advice">click to toggle source</span>
430
-
431
- </div>
432
-
433
-
434
- <div class="method-description">
435
-
436
- <p>Print the hash of mappings to the command line.</p>
437
-
438
- <p>@return [nil]</p>
439
-
440
-
441
-
442
-
443
- <div class="method-source-code" id="print_mappings-source">
444
- <pre><span class="ruby-comment"># File lib/spoonerize/cli.rb, line 121</span>
445
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">print_mappings</span>
446
- <span class="ruby-identifier">spoonerism</span>.<span class="ruby-identifier">to_h</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>
447
- <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;%-#{longest_word_length}s =&gt; %s&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-identifier">k</span>, <span class="ruby-identifier">v</span>]
448
- <span class="ruby-keyword">end</span>
449
- <span class="ruby-keyword">end</span></pre>
450
- </div>
451
-
452
- </div>
453
-
454
-
455
-
456
-
457
- </div>
458
-
459
-
460
- <div id="method-i-save-3F" class="method-detail ">
461
-
462
- <div class="method-heading">
463
- <span class="method-name">save?</span><span
464
- class="method-args">()</span>
465
-
466
- <span class="method-click-advice">click to toggle source</span>
467
-
468
- </div>
469
-
470
-
471
- <div class="method-description">
472
-
473
- <p>Should we save to the log file?</p>
474
-
475
- <p>@return [Boolean]</p>
476
-
477
-
478
-
479
-
480
- <div class="method-source-code" id="save-3F-source">
481
- <pre><span class="ruby-comment"># File lib/spoonerize/cli.rb, line 79</span>
482
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">save?</span>
483
- <span class="ruby-ivar">@save</span>
484
- <span class="ruby-keyword">end</span></pre>
485
- </div>
486
-
487
- </div>
488
-
489
-
490
-
491
-
492
- </div>
493
-
494
-
495
- <div id="method-i-spoonerism" class="method-detail ">
496
-
497
- <div class="method-heading">
498
- <span class="method-name">spoonerism</span><span
499
- class="method-args">()</span>
500
-
501
- <span class="method-click-advice">click to toggle source</span>
502
-
503
- </div>
504
-
505
-
506
- <div class="method-description">
507
-
508
- <p>Sets up an instance of <code>Spoonerize::Spoonerism</code> and passes all user preferences.</p>
509
-
510
- <p>@return [Spoonerize::Spoonerism]</p>
511
-
512
-
513
-
514
-
515
- <div class="method-source-code" id="spoonerism-source">
516
- <pre><span class="ruby-comment"># File lib/spoonerize/cli.rb, line 68</span>
517
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">spoonerism</span>
518
- <span class="ruby-identifier">pf</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">file?</span>(<span class="ruby-constant">PREFERENCE_FILE</span>) <span class="ruby-operator">?</span> <span class="ruby-constant">PREFERENCE_FILE</span> <span class="ruby-operator">:</span> <span class="ruby-keyword">nil</span>
519
- <span class="ruby-ivar">@spoonerism</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Spoonerism</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">options</span>, <span class="ruby-identifier">pf</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span>
520
- <span class="ruby-identifier">preferences</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>, <span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">send</span>(<span class="ruby-node">&quot;#{k}=&quot;</span>, <span class="ruby-identifier">v</span>) }
521
- <span class="ruby-keyword">end</span>
522
- <span class="ruby-keyword">end</span></pre>
523
- </div>
524
-
525
- </div>
526
-
527
-
528
-
529
-
530
- </div>
531
-
532
-
533
- </section>
534
-
535
- </section>
536
-
537
- </main>
538
-
539
-
540
- <footer id="validator-badges" role="contentinfo">
541
- <p><a href="https://validator.w3.org/check/referer">Validate</a>
542
- <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.2.1.
543
- <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
544
- </footer>
545
-