betterlorem 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/doc/BetterLorem.html +26 -13
- data/doc/created.rid +5 -5
- data/doc/index.html +1 -1
- data/doc/table_of_contents.html +1 -1
- data/lib/betterlorem.rb +3 -3
- data/spec/betterlorem_spec.rb +0 -1
- metadata +4 -4
data/doc/BetterLorem.html
CHANGED
@@ -81,7 +81,7 @@
|
|
81
81
|
|
82
82
|
<ul>
|
83
83
|
|
84
|
-
<li class="file"><a href="./lorem_txt.html">lorem</a>
|
84
|
+
<li class="file"><a href="./lib/lorem_txt.html">lorem</a>
|
85
85
|
|
86
86
|
</ul>
|
87
87
|
</nav>
|
@@ -152,7 +152,7 @@ href="http://statebuilt.com">statebuilt.com</a></p>
|
|
152
152
|
|
153
153
|
<div class="method-heading">
|
154
154
|
<span class="method-name">c</span><span
|
155
|
-
class="method-args">(count
|
155
|
+
class="method-args">(count = 100, plainText = false)</span>
|
156
156
|
<span class="method-click-advice">click to toggle source</span>
|
157
157
|
</div>
|
158
158
|
|
@@ -164,8 +164,8 @@ href="http://statebuilt.com">statebuilt.com</a></p>
|
|
164
164
|
|
165
165
|
|
166
166
|
<div class="method-source-code" id="c-source">
|
167
|
-
<pre><span class="ruby-comment"># File lib/betterlorem.rb, line
|
168
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">c</span>(<span class="ruby-identifier">count</span
|
167
|
+
<pre><span class="ruby-comment"># File lib/betterlorem.rb, line 73</span>
|
168
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">c</span>(<span class="ruby-identifier">count</span> = <span class="ruby-value">100</span>, <span class="ruby-identifier">plainText</span> = <span class="ruby-keyword">false</span>)
|
169
169
|
<span class="ruby-identifier">loader</span> = <span class="ruby-constant">Loader</span>.<span class="ruby-identifier">new</span>
|
170
170
|
|
171
171
|
<span class="ruby-comment"># Merge paragraphs into one line</span>
|
@@ -190,7 +190,12 @@ href="http://statebuilt.com">statebuilt.com</a></p>
|
|
190
190
|
<span class="ruby-comment"># Capitalize the sentence</span>
|
191
191
|
<span class="ruby-identifier">sentence</span> = <span class="ruby-identifier">lines</span>[<span class="ruby-identifier">start_inx</span>, <span class="ruby-identifier">count</span>]
|
192
192
|
<span class="ruby-identifier">sentence</span>[<span class="ruby-value">0</span>] = <span class="ruby-identifier">sentence</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">capitalize</span>
|
193
|
-
|
193
|
+
|
194
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">plainText</span>
|
195
|
+
<span class="ruby-node">"#{sentence}\n"</span>
|
196
|
+
<span class="ruby-keyword">else</span>
|
197
|
+
<span class="ruby-node">"<p>#{sentence}</p>"</span>
|
198
|
+
<span class="ruby-keyword">end</span>
|
194
199
|
<span class="ruby-keyword">end</span></pre>
|
195
200
|
</div><!-- c-source -->
|
196
201
|
|
@@ -206,7 +211,7 @@ href="http://statebuilt.com">statebuilt.com</a></p>
|
|
206
211
|
|
207
212
|
<div class="method-heading">
|
208
213
|
<span class="method-name">p</span><span
|
209
|
-
class="method-args">(count
|
214
|
+
class="method-args">(count = 5, plainText = false)</span>
|
210
215
|
<span class="method-click-advice">click to toggle source</span>
|
211
216
|
</div>
|
212
217
|
|
@@ -218,8 +223,8 @@ href="http://statebuilt.com">statebuilt.com</a></p>
|
|
218
223
|
|
219
224
|
|
220
225
|
<div class="method-source-code" id="p-source">
|
221
|
-
<pre><span class="ruby-comment"># File lib/betterlorem.rb, line
|
222
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">p</span>(<span class="ruby-identifier">count</span
|
226
|
+
<pre><span class="ruby-comment"># File lib/betterlorem.rb, line 48</span>
|
227
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">p</span>(<span class="ruby-identifier">count</span> = <span class="ruby-value">5</span>, <span class="ruby-identifier">plainText</span> = <span class="ruby-keyword">false</span>)
|
223
228
|
<span class="ruby-identifier">loader</span> = <span class="ruby-constant">Loader</span>.<span class="ruby-identifier">new</span>
|
224
229
|
|
225
230
|
<span class="ruby-comment"># Start at a random index in the array but do not overrun array</span>
|
@@ -233,10 +238,14 @@ href="http://statebuilt.com">statebuilt.com</a></p>
|
|
233
238
|
|
234
239
|
<span class="ruby-comment"># Build final format based on parameters</span>
|
235
240
|
<span class="ruby-identifier">paragraphs</span>.<span class="ruby-identifier">map!</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span>
|
236
|
-
<span class="ruby-
|
241
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">plainText</span>
|
242
|
+
<span class="ruby-identifier">line</span> = <span class="ruby-node">"#{line}\n"</span>
|
243
|
+
<span class="ruby-keyword">else</span>
|
244
|
+
<span class="ruby-identifier">line</span> = <span class="ruby-node">"<p>#{line}</p>"</span>
|
245
|
+
<span class="ruby-keyword">end</span>
|
237
246
|
<span class="ruby-keyword">end</span>
|
238
247
|
|
239
|
-
<span class="ruby-identifier">paragraphs</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">'
|
248
|
+
<span class="ruby-identifier">paragraphs</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">''</span>)
|
240
249
|
<span class="ruby-keyword">end</span></pre>
|
241
250
|
</div><!-- p-source -->
|
242
251
|
|
@@ -252,7 +261,7 @@ href="http://statebuilt.com">statebuilt.com</a></p>
|
|
252
261
|
|
253
262
|
<div class="method-heading">
|
254
263
|
<span class="method-name">w</span><span
|
255
|
-
class="method-args">(count
|
264
|
+
class="method-args">(count = 15, plainText = false)</span>
|
256
265
|
<span class="method-click-advice">click to toggle source</span>
|
257
266
|
</div>
|
258
267
|
|
@@ -265,7 +274,7 @@ href="http://statebuilt.com">statebuilt.com</a></p>
|
|
265
274
|
|
266
275
|
<div class="method-source-code" id="w-source">
|
267
276
|
<pre><span class="ruby-comment"># File lib/betterlorem.rb, line 16</span>
|
268
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">w</span>(<span class="ruby-identifier">count</span
|
277
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">w</span>(<span class="ruby-identifier">count</span> = <span class="ruby-value">15</span>, <span class="ruby-identifier">plainText</span> = <span class="ruby-keyword">false</span>)
|
269
278
|
<span class="ruby-identifier">loader</span> = <span class="ruby-constant">Loader</span>.<span class="ruby-identifier">new</span>
|
270
279
|
|
271
280
|
<span class="ruby-comment"># Merge paragraphs into one line and split into words</span>
|
@@ -289,7 +298,11 @@ href="http://statebuilt.com">statebuilt.com</a></p>
|
|
289
298
|
<span class="ruby-comment"># Correct the sentence's punctuation</span>
|
290
299
|
<span class="ruby-identifier">correct_punctuation</span>(<span class="ruby-identifier">return_words</span>)
|
291
300
|
|
292
|
-
<span class="ruby-
|
301
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">plainText</span>
|
302
|
+
<span class="ruby-node">"#{return_words}\n"</span>
|
303
|
+
<span class="ruby-keyword">else</span>
|
304
|
+
<span class="ruby-node">"<p>#{return_words}</p>"</span>
|
305
|
+
<span class="ruby-keyword">end</span>
|
293
306
|
<span class="ruby-keyword">end</span></pre>
|
294
307
|
</div><!-- w-source -->
|
295
308
|
|
data/doc/created.rid
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
Tue, 09 Oct 2012
|
2
|
-
./
|
3
|
-
./
|
4
|
-
./
|
5
|
-
./
|
1
|
+
Tue, 09 Oct 2012 21:44:18 -0500
|
2
|
+
./spec/betterlorem_spec.rb Tue, 09 Oct 2012 21:20:41 -0500
|
3
|
+
./spec/spec_helper.rb Tue, 09 Oct 2012 21:20:41 -0500
|
4
|
+
./lib/betterlorem.rb Tue, 09 Oct 2012 21:20:41 -0500
|
5
|
+
./lib/lorem.txt Tue, 09 Oct 2012 21:20:41 -0500
|
data/doc/index.html
CHANGED
data/doc/table_of_contents.html
CHANGED
data/lib/betterlorem.rb
CHANGED
@@ -38,7 +38,7 @@ module BetterLorem
|
|
38
38
|
correct_punctuation(return_words)
|
39
39
|
|
40
40
|
if plainText
|
41
|
-
"#{return_words}
|
41
|
+
"#{return_words}"
|
42
42
|
else
|
43
43
|
"<p>#{return_words}</p>"
|
44
44
|
end
|
@@ -60,7 +60,7 @@ module BetterLorem
|
|
60
60
|
# Build final format based on parameters
|
61
61
|
paragraphs.map! do |line|
|
62
62
|
if plainText
|
63
|
-
line = "#{line}
|
63
|
+
line = "#{line}"
|
64
64
|
else
|
65
65
|
line = "<p>#{line}</p>"
|
66
66
|
end
|
@@ -97,7 +97,7 @@ module BetterLorem
|
|
97
97
|
sentence[0] = sentence[0].to_s.capitalize
|
98
98
|
|
99
99
|
if plainText
|
100
|
-
"#{sentence}
|
100
|
+
"#{sentence}"
|
101
101
|
else
|
102
102
|
"<p>#{sentence}</p>"
|
103
103
|
end
|
data/spec/betterlorem_spec.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: betterlorem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -22,11 +22,11 @@ files:
|
|
22
22
|
- spec/betterlorem_spec.rb
|
23
23
|
- spec/spec_helper.rb
|
24
24
|
- doc/BetterLorem.html
|
25
|
-
- doc/table_of_contents.html
|
26
|
-
- doc/lorem_txt.html
|
27
|
-
- doc/rdoc.css
|
28
25
|
- doc/created.rid
|
29
26
|
- doc/index.html
|
27
|
+
- doc/lorem_txt.html
|
28
|
+
- doc/rdoc.css
|
29
|
+
- doc/table_of_contents.html
|
30
30
|
homepage: https://github.com/statedigital/BetterLorem
|
31
31
|
licenses: []
|
32
32
|
post_install_message:
|