shenanigans 1.0.10 → 1.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/doc/Array.html +25 -25
- data/doc/Fixnum.html +9 -9
- data/doc/Hash.html +30 -30
- data/doc/Kernel.html +30 -30
- data/doc/Module.html +2 -2
- data/doc/Object.html +12 -12
- data/doc/String.html +82 -11
- data/doc/_index.html +2 -2
- data/doc/file.README.html +8 -8
- data/doc/index.html +8 -8
- data/doc/method_list.html +20 -14
- data/doc/top-level-namespace.html +2 -2
- data/lib/shenanigans/string.rb +1 -0
- data/lib/shenanigans/string/cmpi.rb +8 -0
- data/test/string/test_cmpi.rb +10 -0
- metadata +44 -43
- data/test/string/test_display.rb +0 -36
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9053b8f68fa13d513448f8ac266a9cade66c4352
|
4
|
+
data.tar.gz: 0d030150d1978caf219710b256aad90ab7f708c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fdc433aa82c73dce7da543c65cf4a7dfa5c3566e24e5a1a314ae998fc942bfe5a6320d5d3e8b1850dfb856e70c6f08e5d573ec27a749cfa2dd5ecd11a8ceb215
|
7
|
+
data.tar.gz: b6a6e67c9e57677d7482dabc71054a9dd2c17df8e383c56fb6e4cd5e286974c384a040d6182041c5ec9c65dda79e99682cd774227fff6c5b26e09541b99efb91
|
data/doc/Array.html
CHANGED
@@ -237,9 +237,9 @@ symbol.</p>
|
|
237
237
|
|
238
238
|
<p>Returns an array containing elements exclusive between two arrays.</p>
|
239
239
|
|
240
|
-
<pre class="ruby"
|
241
|
-
<span class=
|
242
|
-
</pre>
|
240
|
+
<pre class="code ruby"><code class="ruby"><span class='lbracket'>[</span><span class='int'>1</span><span class='comma'>,</span> <span class='int'>2</span><span class='comma'>,</span> <span class='int'>3</span><span class='rbracket'>]</span> <span class='op'>^</span> <span class='lbracket'>[</span><span class='int'>1</span><span class='comma'>,</span> <span class='int'>2</span><span class='comma'>,</span> <span class='int'>4</span><span class='rbracket'>]</span>
|
241
|
+
<span class='comment'>#=> [3, 4]
|
242
|
+
</span></code></pre>
|
243
243
|
|
244
244
|
|
245
245
|
</div>
|
@@ -283,10 +283,10 @@ symbol.</p>
|
|
283
283
|
<p>Generates random subarrays. Uses random numbers and bit-fiddling to assure
|
284
284
|
performant uniform distributions even for large arrays.</p>
|
285
285
|
|
286
|
-
<pre class="ruby"><
|
287
|
-
<span class=
|
288
|
-
<span class=
|
289
|
-
</pre>
|
286
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_a'>a</span> <span class='op'>=</span> <span class='op'>*</span><span class='int'>1</span><span class='op'>..</span><span class='int'>5</span>
|
287
|
+
<span class='id identifier rubyid_a'>a</span><span class='period'>.</span><span class='id identifier rubyid_random_subarray'>random_subarray</span><span class='lparen'>(</span><span class='int'>3</span><span class='rparen'>)</span>
|
288
|
+
<span class='comment'>#=> [[1, 3, 5], [2, 4], [1, 3, 4, 5]]
|
289
|
+
</span></code></pre>
|
290
290
|
|
291
291
|
|
292
292
|
</div>
|
@@ -354,14 +354,14 @@ intermediate values. Has the same interface as
|
|
354
354
|
both can be supplied. This method may eventually be moved to the
|
355
355
|
<code>Enumerable</code> module.</p>
|
356
356
|
|
357
|
-
<pre class="ruby"><
|
358
|
-
<span class=
|
359
|
-
<span class=
|
360
|
-
|
361
|
-
<span class=
|
362
|
-
|
363
|
-
<span class=
|
364
|
-
</pre>
|
357
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_a'>a</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='op'>*</span><span class='int'>1</span><span class='op'>..</span><span class='int'>4</span><span class='rbracket'>]</span>
|
358
|
+
<span class='id identifier rubyid_a'>a</span><span class='period'>.</span><span class='id identifier rubyid_reductions'>reductions</span><span class='lparen'>(</span><span class='symbol'>:+</span><span class='rparen'>)</span>
|
359
|
+
<span class='comment'>#=> 10
|
360
|
+
</span><span class='id identifier rubyid_a'>a</span><span class='period'>.</span><span class='id identifier rubyid_reductions'>reductions</span><span class='lparen'>(</span><span class='int'>50</span><span class='comma'>,</span> <span class='symbol'>:+</span><span class='rparen'>)</span>
|
361
|
+
<span class='comment'>#=> 60
|
362
|
+
</span><span class='qwords_beg'>%w(</span><span class='tstring_content'>a</span><span class='words_sep'> </span><span class='tstring_content'>b</span><span class='words_sep'> </span><span class='tstring_content'>c</span><span class='words_sep'>)</span><span class='period'>.</span><span class='id identifier rubyid_reductions'>reductions</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_s1'>s1</span><span class='comma'>,</span> <span class='id identifier rubyid_s2'>s2</span><span class='op'>|</span> <span class='id identifier rubyid_s1'>s1</span><span class='op'>+</span><span class='id identifier rubyid_s2'>s2</span> <span class='rbrace'>}</span>
|
363
|
+
<span class='comment'>#=> ["a", "ab", "abc"]
|
364
|
+
</span></code></pre>
|
365
365
|
|
366
366
|
|
367
367
|
</div>
|
@@ -449,17 +449,17 @@ both can be supplied. This method may eventually be moved to the
|
|
449
449
|
the provided block or symbol. The resulting array will be as long as the
|
450
450
|
shorter of the two arrays.</p>
|
451
451
|
|
452
|
-
<pre class="ruby"
|
453
|
-
<span class=
|
454
|
-
|
455
|
-
<span class=
|
456
|
-
</pre>
|
452
|
+
<pre class="code ruby"><code class="ruby"><span class='lbracket'>[</span><span class='int'>1</span><span class='comma'>,</span><span class='int'>2</span><span class='comma'>,</span><span class='int'>3</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_zip_with'>zip_with</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='int'>6</span><span class='comma'>,</span><span class='int'>5</span><span class='comma'>,</span><span class='int'>4</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='symbol'>:+</span><span class='rparen'>)</span>
|
453
|
+
<span class='comment'>#=> [7, 7, 7]
|
454
|
+
</span><span class='qwords_beg'>%w(</span><span class='tstring_content'>a</span><span class='words_sep'> </span><span class='tstring_content'>b</span><span class='words_sep'>)</span><span class='period'>.</span><span class='id identifier rubyid_zip_with'>zip_with</span><span class='lparen'>(</span><span class='qwords_beg'>%w(</span><span class='tstring_content'>c</span><span class='words_sep'> </span><span class='tstring_content'>d</span><span class='words_sep'>)</span><span class='comma'>,</span> <span class='symbol'>:+</span><span class='rparen'>)</span>
|
455
|
+
<span class='comment'>#=> ["ac", "bd"]
|
456
|
+
</span></code></pre>
|
457
457
|
|
458
458
|
<p>For more complex combinations, a block can be provided:</p>
|
459
459
|
|
460
|
-
<pre class="ruby"
|
461
|
-
<span class=
|
462
|
-
</pre>
|
460
|
+
<pre class="code ruby"><code class="ruby"><span class='lbracket'>[</span><span class='int'>1</span><span class='comma'>,</span><span class='int'>2</span><span class='comma'>,</span><span class='int'>3</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_zip_with'>zip_with</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='int'>6</span><span class='comma'>,</span><span class='int'>5</span><span class='comma'>,</span><span class='int'>4</span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_a'>a</span><span class='comma'>,</span><span class='id identifier rubyid_b'>b</span><span class='op'>|</span> <span class='int'>3</span><span class='op'>*</span><span class='id identifier rubyid_a'>a</span><span class='op'>+</span><span class='int'>2</span><span class='op'>*</span><span class='id identifier rubyid_b'>b</span> <span class='rbrace'>}</span>
|
461
|
+
<span class='comment'>#=> [15, 16, 17]
|
462
|
+
</span></code></pre>
|
463
463
|
|
464
464
|
|
465
465
|
</div>
|
@@ -509,9 +509,9 @@ shorter of the two arrays.</p>
|
|
509
509
|
</div>
|
510
510
|
|
511
511
|
<div id="footer">
|
512
|
-
Generated on
|
512
|
+
Generated on Fri Jan 24 17:13:27 2014 by
|
513
513
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
514
|
-
0.8.7.3 (ruby-2.
|
514
|
+
0.8.7.3 (ruby-2.1.0).
|
515
515
|
</div>
|
516
516
|
|
517
517
|
</body>
|
data/doc/Fixnum.html
CHANGED
@@ -161,13 +161,13 @@
|
|
161
161
|
|
162
162
|
<p>Returns the length of the number's string representation.</p>
|
163
163
|
|
164
|
-
<pre class="ruby"><
|
165
|
-
<span class=
|
166
|
-
|
167
|
-
<span class=
|
168
|
-
|
169
|
-
<span class=
|
170
|
-
</pre>
|
164
|
+
<pre class="code ruby"><code class="ruby"><span class='int'>0</span><span class='period'>.</span><span class='id identifier rubyid_string_length'>string_length</span>
|
165
|
+
<span class='comment'>#=> 1
|
166
|
+
</span><span class='int'>123</span><span class='period'>.</span><span class='id identifier rubyid_string_length'>string_length</span>
|
167
|
+
<span class='comment'>#=> 3
|
168
|
+
</span><span class='op'>-</span><span class='int'>1</span><span class='period'>.</span><span class='id identifier rubyid_string_length'>string_length</span>
|
169
|
+
<span class='comment'>#=> 2
|
170
|
+
</span></code></pre>
|
171
171
|
|
172
172
|
|
173
173
|
</div>
|
@@ -205,9 +205,9 @@
|
|
205
205
|
</div>
|
206
206
|
|
207
207
|
<div id="footer">
|
208
|
-
Generated on
|
208
|
+
Generated on Fri Jan 24 17:13:28 2014 by
|
209
209
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
210
|
-
0.8.7.3 (ruby-2.
|
210
|
+
0.8.7.3 (ruby-2.1.0).
|
211
211
|
</div>
|
212
212
|
|
213
213
|
</body>
|
data/doc/Hash.html
CHANGED
@@ -211,12 +211,12 @@
|
|
211
211
|
|
212
212
|
<p>Returns a new hash only with the specified keys (if present).</p>
|
213
213
|
|
214
|
-
<pre class="ruby"><
|
215
|
-
<span class=
|
216
|
-
<span class=
|
217
|
-
|
218
|
-
<span class=
|
219
|
-
</pre>
|
214
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_hash'>hash</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>a:</span> <span class='int'>1</span><span class='comma'>,</span> <span class='label'>b:</span> <span class='int'>2</span><span class='comma'>,</span> <span class='label'>c:</span> <span class='int'>3</span> <span class='rbrace'>}</span>
|
215
|
+
<span class='id identifier rubyid_hash'>hash</span><span class='period'>.</span><span class='id identifier rubyid_extract'>extract</span><span class='lparen'>(</span><span class='symbol'>:b</span><span class='comma'>,</span> <span class='symbol'>:a</span><span class='rparen'>)</span>
|
216
|
+
<span class='comment'>#=> { a: 1, b: 2 }
|
217
|
+
</span><span class='id identifier rubyid_hash'>hash</span><span class='period'>.</span><span class='id identifier rubyid_extract'>extract</span><span class='lparen'>(</span><span class='symbol'>:a</span><span class='comma'>,</span> <span class='symbol'>:d</span><span class='rparen'>)</span>
|
218
|
+
<span class='comment'>#=> { a: 1}
|
219
|
+
</span></code></pre>
|
220
220
|
|
221
221
|
|
222
222
|
</div>
|
@@ -261,20 +261,20 @@
|
|
261
261
|
|
262
262
|
<p>Checks if a hash has a certain structure.</p>
|
263
263
|
|
264
|
-
<pre class="ruby"><
|
265
|
-
<span class=
|
266
|
-
<span class=
|
267
|
-
|
268
|
-
<span class=
|
269
|
-
</pre>
|
264
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_h'>h</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>k1:</span> <span class='int'>1</span><span class='comma'>,</span> <span class='label'>k2:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>1</span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span>
|
265
|
+
<span class='id identifier rubyid_h'>h</span><span class='period'>.</span><span class='id identifier rubyid_has_shape?'>has_shape?</span><span class='lparen'>(</span><span class='label'>k1:</span> <span class='const'>Fixnum</span><span class='comma'>,</span> <span class='label'>k2:</span> <span class='const'>String</span><span class='rparen'>)</span>
|
266
|
+
<span class='comment'>#=> true
|
267
|
+
</span><span class='id identifier rubyid_h'>h</span><span class='period'>.</span><span class='id identifier rubyid_has_shape?'>has_shape?</span><span class='lparen'>(</span><span class='label'>k1:</span> <span class='const'>Class</span><span class='comma'>,</span> <span class='label'>k2:</span> <span class='const'>String</span><span class='rparen'>)</span>
|
268
|
+
<span class='comment'>#=> false
|
269
|
+
</span></code></pre>
|
270
270
|
|
271
271
|
<p>It also works with compound data structures.</p>
|
272
272
|
|
273
|
-
<pre class="ruby"><
|
274
|
-
<span class=
|
275
|
-
<span class=
|
276
|
-
<span class=
|
277
|
-
</pre>
|
273
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_h'>h</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>k1:</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='label'>k2:</span> <span class='lbrace'>{</span> <span class='label'>k3:</span> <span class='const'>Struct</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Foo</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='rbrace'>}</span> <span class='rbrace'>}</span>
|
274
|
+
<span class='id identifier rubyid_shape'>shape</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>k1:</span> <span class='const'>Array</span><span class='comma'>,</span> <span class='label'>k2:</span> <span class='lbrace'>{</span> <span class='label'>k3:</span> <span class='const'>Module</span> <span class='rbrace'>}</span> <span class='rbrace'>}</span>
|
275
|
+
<span class='id identifier rubyid_h'>h</span><span class='period'>.</span><span class='id identifier rubyid_has_shape?'>has_shape?</span><span class='lparen'>(</span><span class='id identifier rubyid_shape'>shape</span><span class='rparen'>)</span>
|
276
|
+
<span class='comment'>#=> true
|
277
|
+
</span></code></pre>
|
278
278
|
|
279
279
|
|
280
280
|
</div>
|
@@ -335,8 +335,8 @@
|
|
335
335
|
<p>Recursively converts a <code>Hash</code> and all nested <code>Hash</code>es
|
336
336
|
to <code>OpenStruct</code>s. Especially useful for parsing YAML.</p>
|
337
337
|
|
338
|
-
<pre class="ruby"><
|
339
|
-
subject: Programming Languages
|
338
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_yaml'>yaml</span><span class='op'>=</span><span class='heredoc_beg'><<EOY</span>
|
339
|
+
<span class='tstring_content'>subject: Programming Languages
|
340
340
|
languages:
|
341
341
|
- name : Ruby
|
342
342
|
creator : Matz
|
@@ -344,15 +344,15 @@ languages:
|
|
344
344
|
creator : Guido van Rossum
|
345
345
|
- name : Perl
|
346
346
|
creator : Larry Wall
|
347
|
-
|
348
|
-
|
349
|
-
<span class=
|
350
|
-
<span class=
|
351
|
-
|
352
|
-
<span class=
|
353
|
-
|
354
|
-
<span class=
|
355
|
-
</pre>
|
347
|
+
</span><span class='heredoc_end'>EOY
|
348
|
+
</span><span class='id identifier rubyid_struct'>struct</span> <span class='op'>=</span> <span class='const'>YAML</span><span class='period'>.</span><span class='id identifier rubyid_load'>load</span><span class='lparen'>(</span><span class='id identifier rubyid_yaml'>yaml</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_ostruct'>to_ostruct</span>
|
349
|
+
<span class='id identifier rubyid_struct'>struct</span><span class='period'>.</span><span class='id identifier rubyid_subject'>subject</span>
|
350
|
+
<span class='comment'>#=> "Programming Languages"
|
351
|
+
</span><span class='id identifier rubyid_struct'>struct</span><span class='period'>.</span><span class='id identifier rubyid_languages'>languages</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
|
352
|
+
<span class='comment'>#=> #<OpenStruct name="Ruby", creator="Matz">
|
353
|
+
</span><span class='id identifier rubyid_struct'>struct</span><span class='period'>.</span><span class='id identifier rubyid_languages'>languages</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='period'>.</span><span class='id identifier rubyid_creator'>creator</span>
|
354
|
+
<span class='comment'>#=> "Matz"
|
355
|
+
</span></code></pre>
|
356
356
|
|
357
357
|
|
358
358
|
</div>
|
@@ -406,9 +406,9 @@ EOY</span>
|
|
406
406
|
</div>
|
407
407
|
|
408
408
|
<div id="footer">
|
409
|
-
Generated on
|
409
|
+
Generated on Fri Jan 24 17:13:27 2014 by
|
410
410
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
411
|
-
0.8.7.3 (ruby-2.
|
411
|
+
0.8.7.3 (ruby-2.1.0).
|
412
412
|
</div>
|
413
413
|
|
414
414
|
</body>
|
data/doc/Kernel.html
CHANGED
@@ -246,12 +246,12 @@
|
|
246
246
|
<p>Composes a list of functions. Functions can be specified as symbols or
|
247
247
|
lambdas.</p>
|
248
248
|
|
249
|
-
<pre class="ruby">[
|
250
|
-
<span class=
|
251
|
-
|
252
|
-
|
253
|
-
<span class=
|
254
|
-
</pre>
|
249
|
+
<pre class="code ruby"><code class="ruby"><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>foo bar</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>baz qux</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='op'>&</span><span class='id identifier rubyid_fn'>fn</span><span class='lparen'>(</span><span class='symbol'>:split</span><span class='comma'>,</span> <span class='symbol'>:last</span><span class='rparen'>)</span>
|
250
|
+
<span class='comment'>#=> ["bar", "qux"]
|
251
|
+
</span>
|
252
|
+
<span class='lparen'>(</span><span class='int'>1</span><span class='op'>..</span><span class='int'>3</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='op'>&</span><span class='id identifier rubyid_fn'>fn</span><span class='lparen'>(</span><span class='symbol'>:next</span><span class='comma'>,</span> <span class='tlambda'>-></span> <span class='id identifier rubyid_x'>x</span> <span class='tlambeg'>{</span> <span class='id identifier rubyid_x'>x</span> <span class='op'>*</span> <span class='id identifier rubyid_x'>x</span> <span class='rbrace'>}</span><span class='comma'>,</span> <span class='tlambda'>-></span> <span class='id identifier rubyid_x'>x</span> <span class='tlambeg'>{</span> <span class='id identifier rubyid_x'>x</span><span class='period'>.</span><span class='id identifier rubyid_to_f'>to_f</span> <span class='op'>/</span> <span class='int'>2</span> <span class='rbrace'>}</span> <span class='rparen'>)</span>
|
253
|
+
<span class='comment'>#=> [2.0, 4.5, 8.0]
|
254
|
+
</span></code></pre>
|
255
255
|
|
256
256
|
|
257
257
|
</div>
|
@@ -304,14 +304,14 @@ lambdas.</p>
|
|
304
304
|
method <code>raw_input</code>, but also can be supplied with an optional
|
305
305
|
conversion method.</p>
|
306
306
|
|
307
|
-
<pre class="ruby"><
|
308
|
-
<span class=
|
309
|
-
<span class=
|
310
|
-
|
311
|
-
<span class=
|
312
|
-
<span class=
|
313
|
-
<span class=
|
314
|
-
</pre>
|
307
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_prompt'>prompt</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Prompt> </span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
308
|
+
<span class='const'>Prompt</span><span class='op'>></span> <span class='int'>12</span>
|
309
|
+
<span class='comment'>#=> "12"
|
310
|
+
</span>
|
311
|
+
<span class='id identifier rubyid_prompt'>prompt</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Prompt> </span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='symbol'>:to_f</span><span class='rparen'>)</span>
|
312
|
+
<span class='const'>Prompt</span><span class='op'>></span> <span class='int'>12</span>
|
313
|
+
<span class='comment'>#=> 12.0
|
314
|
+
</span></code></pre>
|
315
315
|
|
316
316
|
|
317
317
|
</div>
|
@@ -359,14 +359,14 @@ conversion method.</p>
|
|
359
359
|
<p>Optionally require a gem. If it is not available, <code>nil</code> will be
|
360
360
|
returned. Alternatively, a block can be provided with code to run.</p>
|
361
361
|
|
362
|
-
<pre class="ruby"><
|
363
|
-
<span class=
|
364
|
-
|
365
|
-
<span class=
|
366
|
-
<span class=
|
367
|
-
<span class=
|
368
|
-
<span class=
|
369
|
-
</pre>
|
362
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>non_existent</span><span class='tstring_end'>'</span></span>
|
363
|
+
<span class='comment'>#=> nil
|
364
|
+
</span>
|
365
|
+
<span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>non_existent</span><span class='tstring_end'>'</span></span> <span class='kw'>do</span>
|
366
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Something went wrong</span><span class='tstring_end'>'</span></span>
|
367
|
+
<span class='kw'>end</span>
|
368
|
+
<span class='comment'>#=> Outputs 'Something went wrong'
|
369
|
+
</span></code></pre>
|
370
370
|
|
371
371
|
|
372
372
|
</div>
|
@@ -414,12 +414,12 @@ returned. Alternatively, a block can be provided with code to run.</p>
|
|
414
414
|
<p>A Pascal/ActionScript like <code>with</code> method. Yields its argument to
|
415
415
|
the provided block and then returns it.</p>
|
416
416
|
|
417
|
-
<pre class="ruby"><
|
418
|
-
<span class=
|
419
|
-
<span class=
|
420
|
-
<span class=
|
421
|
-
<span class=
|
422
|
-
</pre>
|
417
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_with'>with</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_a'>a</span><span class='op'>|</span>
|
418
|
+
<span class='id identifier rubyid_a'>a</span> <span class='op'><<</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>a</span><span class='tstring_end'>"</span></span>
|
419
|
+
<span class='id identifier rubyid_a'>a</span> <span class='op'><<</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>b</span><span class='tstring_end'>"</span></span>
|
420
|
+
<span class='kw'>end</span>
|
421
|
+
<span class='comment'>#=> ["a", "b"]
|
422
|
+
</span></code></pre>
|
423
423
|
|
424
424
|
|
425
425
|
</div>
|
@@ -453,9 +453,9 @@ the provided block and then returns it.</p>
|
|
453
453
|
</div>
|
454
454
|
|
455
455
|
<div id="footer">
|
456
|
-
Generated on
|
456
|
+
Generated on Fri Jan 24 17:13:27 2014 by
|
457
457
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
458
|
-
0.8.7.3 (ruby-2.
|
458
|
+
0.8.7.3 (ruby-2.1.0).
|
459
459
|
</div>
|
460
460
|
|
461
461
|
</body>
|
data/doc/Module.html
CHANGED
@@ -227,9 +227,9 @@ href="https://github.com/citizen428/ivar_encapsulation">ivar_encapsulation</a>.<
|
|
227
227
|
</div>
|
228
228
|
|
229
229
|
<div id="footer">
|
230
|
-
Generated on
|
230
|
+
Generated on Fri Jan 24 17:13:28 2014 by
|
231
231
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
232
|
-
0.8.7.3 (ruby-2.
|
232
|
+
0.8.7.3 (ruby-2.1.0).
|
233
233
|
</div>
|
234
234
|
|
235
235
|
</body>
|
data/doc/Object.html
CHANGED
@@ -187,13 +187,13 @@
|
|
187
187
|
<code>new_line</code> is <code>true</code> and <code>print</code>
|
188
188
|
otherwise.</p>
|
189
189
|
|
190
|
-
<pre class="ruby"><
|
191
|
-
<span class=
|
192
|
-
<span class=
|
193
|
-
|
194
|
-
<span class=
|
195
|
-
<span class=
|
196
|
-
</pre>
|
190
|
+
<pre class="code ruby"><code class="ruby"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>foo</span><span class='tstring_end'>"</span></span><span class='period'>.</span><span class='id identifier rubyid_display'>display</span>
|
191
|
+
<span class='id identifier rubyid_foo'>foo</span>
|
192
|
+
<span class='comment'>#=> "foo"
|
193
|
+
</span>
|
194
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>foo</span><span class='tstring_end'>"</span></span><span class='period'>.</span><span class='id identifier rubyid_display'>display</span><span class='lparen'>(</span><span class='kw'>false</span><span class='rparen'>)</span>
|
195
|
+
<span class='id identifier rubyid_foo'>foo</span><span class='comment'>#=> "foo"
|
196
|
+
</span></code></pre>
|
197
197
|
|
198
198
|
|
199
199
|
</div>
|
@@ -239,9 +239,9 @@ otherwise.</p>
|
|
239
239
|
<p>An identity method that provides access to an object's
|
240
240
|
<code>self</code>.</p>
|
241
241
|
|
242
|
-
<pre class="ruby"
|
243
|
-
<span class=
|
244
|
-
</pre>
|
242
|
+
<pre class="code ruby"><code class="ruby"><span class='lbracket'>[</span><span class='int'>1</span><span class='comma'>,</span><span class='int'>2</span><span class='comma'>,</span><span class='int'>3</span><span class='comma'>,</span><span class='int'>4</span><span class='comma'>,</span><span class='int'>5</span><span class='comma'>,</span><span class='int'>1</span><span class='comma'>,</span><span class='int'>2</span><span class='comma'>,</span><span class='int'>2</span><span class='comma'>,</span><span class='int'>3</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_group_by'>group_by</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:it</span><span class='rparen'>)</span>
|
243
|
+
<span class='comment'>#=> {1=>[1, 1], 2=>[2, 2, 2], 3=>[3, 3], 4=>[4], 5=>[5]}
|
244
|
+
</span></code></pre>
|
245
245
|
|
246
246
|
|
247
247
|
</div>
|
@@ -275,9 +275,9 @@ otherwise.</p>
|
|
275
275
|
</div>
|
276
276
|
|
277
277
|
<div id="footer">
|
278
|
-
Generated on
|
278
|
+
Generated on Fri Jan 24 17:13:27 2014 by
|
279
279
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
280
|
-
0.8.7.3 (ruby-2.
|
280
|
+
0.8.7.3 (ruby-2.1.0).
|
281
281
|
</div>
|
282
282
|
|
283
283
|
</body>
|
data/doc/String.html
CHANGED
@@ -94,7 +94,9 @@
|
|
94
94
|
|
95
95
|
|
96
96
|
<dt class="r2 last">Defined in:</dt>
|
97
|
-
<dd class="r2 last">lib/shenanigans/string/
|
97
|
+
<dd class="r2 last">lib/shenanigans/string/cmpi.rb<span class="defines">,<br />
|
98
|
+
lib/shenanigans/string/in_groups_of.rb</span>
|
99
|
+
</dd>
|
98
100
|
|
99
101
|
</dl>
|
100
102
|
<div class="clear"></div>
|
@@ -117,6 +119,30 @@
|
|
117
119
|
<li class="public ">
|
118
120
|
<span class="summary_signature">
|
119
121
|
|
122
|
+
<a href="#cmpi-instance_method" title="#cmpi (instance method)">- (Object) <strong>cmpi</strong>(other) </a>
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
</span>
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
<span class="summary_desc"><div class='inline'>
|
137
|
+
<p>Compares strings ignoring case “test”.cmpi(“tesT”) #=> true.</p>
|
138
|
+
</div></span>
|
139
|
+
|
140
|
+
</li>
|
141
|
+
|
142
|
+
|
143
|
+
<li class="public ">
|
144
|
+
<span class="summary_signature">
|
145
|
+
|
120
146
|
<a href="#in_groups_of-instance_method" title="#in_groups_of (instance method)">- (Object) <strong>in_groups_of</strong>(size) </a>
|
121
147
|
|
122
148
|
|
@@ -148,7 +174,52 @@
|
|
148
174
|
|
149
175
|
|
150
176
|
<div class="method_details first">
|
151
|
-
<h3 class="signature first" id="
|
177
|
+
<h3 class="signature first" id="cmpi-instance_method">
|
178
|
+
|
179
|
+
- (<tt><span class='object_link'><a href="Object.html" title="Object (class)">Object</a></span></tt>) <strong>cmpi</strong>(other)
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
</h3><div class="docstring">
|
186
|
+
<div class="discussion">
|
187
|
+
|
188
|
+
<p>Compares strings ignoring case</p>
|
189
|
+
|
190
|
+
<pre class="code ruby"><code class="ruby"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>test</span><span class='tstring_end'>"</span></span><span class='period'>.</span><span class='id identifier rubyid_cmpi'>cmpi</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>tesT</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
191
|
+
<span class='comment'>#=> true
|
192
|
+
</span></code></pre>
|
193
|
+
|
194
|
+
|
195
|
+
</div>
|
196
|
+
</div>
|
197
|
+
<div class="tags">
|
198
|
+
|
199
|
+
|
200
|
+
</div><table class="source_code">
|
201
|
+
<tr>
|
202
|
+
<td>
|
203
|
+
<pre class="lines">
|
204
|
+
|
205
|
+
|
206
|
+
5
|
207
|
+
6
|
208
|
+
7</pre>
|
209
|
+
</td>
|
210
|
+
<td>
|
211
|
+
<pre class="code"><span class="info file"># File 'lib/shenanigans/string/cmpi.rb', line 5</span>
|
212
|
+
|
213
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_cmpi'>cmpi</span><span class='lparen'>(</span><span class='id identifier rubyid_other'>other</span><span class='rparen'>)</span>
|
214
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_casecmp'>casecmp</span><span class='lparen'>(</span><span class='id identifier rubyid_other'>other</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_zero?'>zero?</span>
|
215
|
+
<span class='kw'>end</span></pre>
|
216
|
+
</td>
|
217
|
+
</tr>
|
218
|
+
</table>
|
219
|
+
</div>
|
220
|
+
|
221
|
+
<div class="method_details ">
|
222
|
+
<h3 class="signature " id="in_groups_of-instance_method">
|
152
223
|
|
153
224
|
- (<tt><span class='object_link'><a href="Object.html" title="Object (class)">Object</a></span></tt>) <strong>in_groups_of</strong>(size)
|
154
225
|
|
@@ -162,13 +233,13 @@
|
|
162
233
|
<p>Returns an array of the string broken down into groups of <code>size</code>
|
163
234
|
characters.</p>
|
164
235
|
|
165
|
-
<pre class="ruby"><
|
166
|
-
<span class=
|
167
|
-
|
168
|
-
<span class=
|
169
|
-
|
170
|
-
<span class=
|
171
|
-
</pre>
|
236
|
+
<pre class="code ruby"><code class="ruby"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>aabbcc</span><span class='tstring_end'>"</span></span><span class='period'>.</span><span class='id identifier rubyid_in_groups_of'>in_groups_of</span><span class='lparen'>(</span><span class='int'>2</span><span class='rparen'>)</span>
|
237
|
+
<span class='comment'>#=> ['aa', 'bb', 'cc']
|
238
|
+
</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span><span class='period'>.</span><span class='id identifier rubyid_in_groups_of'>in_groups_of</span><span class='lparen'>(</span><span class='int'>2</span><span class='rparen'>)</span>
|
239
|
+
<span class='comment'>#=> []
|
240
|
+
</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span><span class='period'>.</span><span class='id identifier rubyid_in_groups_of'>in_groups_of</span><span class='lparen'>(</span><span class='int'>0</span><span class='rparen'>)</span>
|
241
|
+
<span class='comment'>#=> ArgumentError
|
242
|
+
</span></code></pre>
|
172
243
|
|
173
244
|
|
174
245
|
</div>
|
@@ -217,9 +288,9 @@ characters.</p>
|
|
217
288
|
</div>
|
218
289
|
|
219
290
|
<div id="footer">
|
220
|
-
Generated on
|
291
|
+
Generated on Fri Jan 24 17:13:27 2014 by
|
221
292
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
222
|
-
0.8.7.3 (ruby-2.
|
293
|
+
0.8.7.3 (ruby-2.1.0).
|
223
294
|
</div>
|
224
295
|
|
225
296
|
</body>
|
data/doc/_index.html
CHANGED
@@ -179,9 +179,9 @@
|
|
179
179
|
</div>
|
180
180
|
|
181
181
|
<div id="footer">
|
182
|
-
Generated on
|
182
|
+
Generated on Fri Jan 24 17:13:27 2014 by
|
183
183
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
184
|
-
0.8.7.3 (ruby-2.
|
184
|
+
0.8.7.3 (ruby-2.1.0).
|
185
185
|
</div>
|
186
186
|
|
187
187
|
</body>
|
data/doc/file.README.html
CHANGED
@@ -105,18 +105,18 @@ Ruby release.</p>
|
|
105
105
|
|
106
106
|
<p>If you really want the whole shebang, you can get it this way:</p>
|
107
107
|
|
108
|
-
<pre class="ruby"><
|
109
|
-
</pre>
|
108
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>shenanigans</span><span class='tstring_end'>'</span></span>
|
109
|
+
</code></pre>
|
110
110
|
|
111
111
|
<p>Requiring a single method works as follows:</p>
|
112
112
|
|
113
|
-
<pre class="ruby"><
|
114
|
-
</pre>
|
113
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>shenanigans/<class|module>/<method></span><span class='tstring_end'>'</span></span>
|
114
|
+
</code></pre>
|
115
115
|
|
116
116
|
<p>Requiring all the extensions of a class or module also works:</p>
|
117
117
|
|
118
|
-
<pre class="ruby"><
|
119
|
-
</pre>
|
118
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>shenanigans/kernel</span><span class='tstring_end'>'</span></span>
|
119
|
+
</code></pre>
|
120
120
|
|
121
121
|
<h2 id="label-Contribute">Contribute</h2>
|
122
122
|
|
@@ -153,9 +153,9 @@ DEALINGS IN THE SOFTWARE.</p>
|
|
153
153
|
</div></div>
|
154
154
|
|
155
155
|
<div id="footer">
|
156
|
-
Generated on
|
156
|
+
Generated on Fri Jan 24 17:13:27 2014 by
|
157
157
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
158
|
-
0.8.7.3 (ruby-2.
|
158
|
+
0.8.7.3 (ruby-2.1.0).
|
159
159
|
</div>
|
160
160
|
|
161
161
|
</body>
|
data/doc/index.html
CHANGED
@@ -105,18 +105,18 @@ Ruby release.</p>
|
|
105
105
|
|
106
106
|
<p>If you really want the whole shebang, you can get it this way:</p>
|
107
107
|
|
108
|
-
<pre class="ruby"><
|
109
|
-
</pre>
|
108
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>shenanigans</span><span class='tstring_end'>'</span></span>
|
109
|
+
</code></pre>
|
110
110
|
|
111
111
|
<p>Requiring a single method works as follows:</p>
|
112
112
|
|
113
|
-
<pre class="ruby"><
|
114
|
-
</pre>
|
113
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>shenanigans/<class|module>/<method></span><span class='tstring_end'>'</span></span>
|
114
|
+
</code></pre>
|
115
115
|
|
116
116
|
<p>Requiring all the extensions of a class or module also works:</p>
|
117
117
|
|
118
|
-
<pre class="ruby"><
|
119
|
-
</pre>
|
118
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>shenanigans/kernel</span><span class='tstring_end'>'</span></span>
|
119
|
+
</code></pre>
|
120
120
|
|
121
121
|
<h2 id="label-Contribute">Contribute</h2>
|
122
122
|
|
@@ -153,9 +153,9 @@ DEALINGS IN THE SOFTWARE.</p>
|
|
153
153
|
</div></div>
|
154
154
|
|
155
155
|
<div id="footer">
|
156
|
-
Generated on
|
156
|
+
Generated on Fri Jan 24 17:13:27 2014 by
|
157
157
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
158
|
-
0.8.7.3 (ruby-2.
|
158
|
+
0.8.7.3 (ruby-2.1.0).
|
159
159
|
</div>
|
160
160
|
|
161
161
|
</body>
|
data/doc/method_list.html
CHANGED
@@ -54,90 +54,96 @@
|
|
54
54
|
|
55
55
|
|
56
56
|
<li class="r2 ">
|
57
|
+
<span class='object_link'><a href="String.html#cmpi-instance_method" title="String#cmpi (method)">#cmpi</a></span>
|
58
|
+
<small>String</small>
|
59
|
+
</li>
|
60
|
+
|
61
|
+
|
62
|
+
<li class="r1 ">
|
57
63
|
<span class='object_link'><a href="Object.html#display-instance_method" title="Object#display (method)">#display</a></span>
|
58
64
|
<small>Object</small>
|
59
65
|
</li>
|
60
66
|
|
61
67
|
|
62
|
-
<li class="
|
68
|
+
<li class="r2 ">
|
63
69
|
<span class='object_link'><a href="Hash.html#extract-instance_method" title="Hash#extract (method)">#extract</a></span>
|
64
70
|
<small>Hash</small>
|
65
71
|
</li>
|
66
72
|
|
67
73
|
|
68
|
-
<li class="
|
74
|
+
<li class="r1 ">
|
69
75
|
<span class='object_link'><a href="Kernel.html#fn-instance_method" title="Kernel#fn (method)">#fn</a></span>
|
70
76
|
<small>Kernel</small>
|
71
77
|
</li>
|
72
78
|
|
73
79
|
|
74
|
-
<li class="
|
80
|
+
<li class="r2 ">
|
75
81
|
<span class='object_link'><a href="Hash.html#has_shape%3F-instance_method" title="Hash#has_shape? (method)">#has_shape?</a></span>
|
76
82
|
<small>Hash</small>
|
77
83
|
</li>
|
78
84
|
|
79
85
|
|
80
|
-
<li class="
|
86
|
+
<li class="r1 ">
|
81
87
|
<span class='object_link'><a href="String.html#in_groups_of-instance_method" title="String#in_groups_of (method)">#in_groups_of</a></span>
|
82
88
|
<small>String</small>
|
83
89
|
</li>
|
84
90
|
|
85
91
|
|
86
|
-
<li class="
|
92
|
+
<li class="r2 ">
|
87
93
|
<span class='object_link'><a href="Object.html#it-instance_method" title="Object#it (method)">#it</a></span>
|
88
94
|
<small>Object</small>
|
89
95
|
</li>
|
90
96
|
|
91
97
|
|
92
|
-
<li class="
|
98
|
+
<li class="r1 ">
|
93
99
|
<span class='object_link'><a href="Module.html#private_accessor-instance_method" title="Module#private_accessor (method)">#private_accessor</a></span>
|
94
100
|
<small>Module</small>
|
95
101
|
</li>
|
96
102
|
|
97
103
|
|
98
|
-
<li class="
|
104
|
+
<li class="r2 ">
|
99
105
|
<span class='object_link'><a href="Kernel.html#prompt-instance_method" title="Kernel#prompt (method)">#prompt</a></span>
|
100
106
|
<small>Kernel</small>
|
101
107
|
</li>
|
102
108
|
|
103
109
|
|
104
|
-
<li class="
|
110
|
+
<li class="r1 ">
|
105
111
|
<span class='object_link'><a href="Array.html#random_subarray-instance_method" title="Array#random_subarray (method)">#random_subarray</a></span>
|
106
112
|
<small>Array</small>
|
107
113
|
</li>
|
108
114
|
|
109
115
|
|
110
|
-
<li class="
|
116
|
+
<li class="r2 ">
|
111
117
|
<span class='object_link'><a href="Array.html#reductions-instance_method" title="Array#reductions (method)">#reductions</a></span>
|
112
118
|
<small>Array</small>
|
113
119
|
</li>
|
114
120
|
|
115
121
|
|
116
|
-
<li class="
|
122
|
+
<li class="r1 ">
|
117
123
|
<span class='object_link'><a href="Kernel.html#require_optional-instance_method" title="Kernel#require_optional (method)">#require_optional</a></span>
|
118
124
|
<small>Kernel</small>
|
119
125
|
</li>
|
120
126
|
|
121
127
|
|
122
|
-
<li class="
|
128
|
+
<li class="r2 ">
|
123
129
|
<span class='object_link'><a href="Fixnum.html#string_length-instance_method" title="Fixnum#string_length (method)">#string_length</a></span>
|
124
130
|
<small>Fixnum</small>
|
125
131
|
</li>
|
126
132
|
|
127
133
|
|
128
|
-
<li class="
|
134
|
+
<li class="r1 ">
|
129
135
|
<span class='object_link'><a href="Hash.html#to_ostruct-instance_method" title="Hash#to_ostruct (method)">#to_ostruct</a></span>
|
130
136
|
<small>Hash</small>
|
131
137
|
</li>
|
132
138
|
|
133
139
|
|
134
|
-
<li class="
|
140
|
+
<li class="r2 ">
|
135
141
|
<span class='object_link'><a href="Kernel.html#with-instance_method" title="Kernel#with (method)">#with</a></span>
|
136
142
|
<small>Kernel</small>
|
137
143
|
</li>
|
138
144
|
|
139
145
|
|
140
|
-
<li class="
|
146
|
+
<li class="r1 ">
|
141
147
|
<span class='object_link'><a href="Array.html#zip_with-instance_method" title="Array#zip_with (method)">#zip_with</a></span>
|
142
148
|
<small>Array</small>
|
143
149
|
</li>
|
@@ -105,9 +105,9 @@
|
|
105
105
|
</div>
|
106
106
|
|
107
107
|
<div id="footer">
|
108
|
-
Generated on
|
108
|
+
Generated on Fri Jan 24 17:13:27 2014 by
|
109
109
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
110
|
-
0.8.7.3 (ruby-2.
|
110
|
+
0.8.7.3 (ruby-2.1.0).
|
111
111
|
</div>
|
112
112
|
|
113
113
|
</body>
|
data/lib/shenanigans/string.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shenanigans
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Kohl
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-01-24 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A collection of extensions for various Ruby core classes.
|
14
14
|
email: citizen428@gmail.com
|
@@ -19,68 +19,69 @@ files:
|
|
19
19
|
- Gemfile
|
20
20
|
- LICENSE
|
21
21
|
- README.rdoc
|
22
|
-
- doc/
|
23
|
-
- doc/top-level-namespace.html
|
24
|
-
- doc/file_list.html
|
22
|
+
- doc/Array.html
|
25
23
|
- doc/Fixnum.html
|
26
|
-
- doc/Object.html
|
27
24
|
- doc/Hash.html
|
28
|
-
- doc/
|
25
|
+
- doc/Kernel.html
|
29
26
|
- doc/Module.html
|
30
|
-
- doc/
|
31
|
-
- doc/
|
32
|
-
- doc/
|
27
|
+
- doc/Object.html
|
28
|
+
- doc/String.html
|
29
|
+
- doc/_index.html
|
30
|
+
- doc/class_list.html
|
33
31
|
- doc/css/common.css
|
34
32
|
- doc/css/full_list.css
|
35
|
-
- doc/
|
36
|
-
- doc/
|
37
|
-
- doc/
|
38
|
-
- doc/
|
33
|
+
- doc/css/style.css
|
34
|
+
- doc/file.README.html
|
35
|
+
- doc/file_list.html
|
36
|
+
- doc/frames.html
|
37
|
+
- doc/index.html
|
39
38
|
- doc/js/app.js
|
40
39
|
- doc/js/full_list.js
|
41
|
-
- doc/
|
42
|
-
- doc/
|
40
|
+
- doc/js/jquery.js
|
41
|
+
- doc/method_list.html
|
42
|
+
- doc/top-level-namespace.html
|
43
43
|
- lib/shenanigans.rb
|
44
|
-
- lib/shenanigans/fixnum/string_length.rb
|
45
|
-
- lib/shenanigans/object.rb
|
46
|
-
- lib/shenanigans/kernel.rb
|
47
|
-
- lib/shenanigans/string.rb
|
48
|
-
- lib/shenanigans/kernel/prompt.rb
|
49
|
-
- lib/shenanigans/kernel/fn.rb
|
50
|
-
- lib/shenanigans/kernel/with.rb
|
51
|
-
- lib/shenanigans/kernel/require_optional.rb
|
52
44
|
- lib/shenanigans/array.rb
|
53
|
-
- lib/shenanigans/array/zip_with.rb
|
54
45
|
- lib/shenanigans/array/caret.rb
|
55
46
|
- lib/shenanigans/array/random_subarray.rb
|
56
47
|
- lib/shenanigans/array/reductions.rb
|
48
|
+
- lib/shenanigans/array/zip_with.rb
|
57
49
|
- lib/shenanigans/fixnum.rb
|
50
|
+
- lib/shenanigans/fixnum/string_length.rb
|
51
|
+
- lib/shenanigans/hash.rb
|
52
|
+
- lib/shenanigans/hash/extract.rb
|
58
53
|
- lib/shenanigans/hash/has_shape_pred.rb
|
59
54
|
- lib/shenanigans/hash/to_ostruct.rb
|
60
|
-
- lib/shenanigans/
|
55
|
+
- lib/shenanigans/kernel.rb
|
56
|
+
- lib/shenanigans/kernel/fn.rb
|
57
|
+
- lib/shenanigans/kernel/prompt.rb
|
58
|
+
- lib/shenanigans/kernel/require_optional.rb
|
59
|
+
- lib/shenanigans/kernel/with.rb
|
61
60
|
- lib/shenanigans/module.rb
|
62
61
|
- lib/shenanigans/module/private_accessor.rb
|
63
|
-
- lib/shenanigans/
|
64
|
-
- lib/shenanigans/object/it.rb
|
62
|
+
- lib/shenanigans/object.rb
|
65
63
|
- lib/shenanigans/object/display.rb
|
66
|
-
- lib/shenanigans/
|
67
|
-
-
|
68
|
-
-
|
69
|
-
-
|
70
|
-
- test/
|
71
|
-
- test/kernel/test_require_optional.rb
|
72
|
-
- test/array/test_zip_with.rb
|
64
|
+
- lib/shenanigans/object/it.rb
|
65
|
+
- lib/shenanigans/string.rb
|
66
|
+
- lib/shenanigans/string/cmpi.rb
|
67
|
+
- lib/shenanigans/string/in_groups_of.rb
|
68
|
+
- test/array/test_caret.rb
|
73
69
|
- test/array/test_random_subarray.rb
|
74
70
|
- test/array/test_reductions.rb
|
75
|
-
- test/array/
|
71
|
+
- test/array/test_zip_with.rb
|
72
|
+
- test/fixnum/test_string_length.rb
|
76
73
|
- test/hash/test_extract.rb
|
77
|
-
- test/hash/test_to_ostruct.rb
|
78
74
|
- test/hash/test_has_shape_pred.rb
|
75
|
+
- test/hash/test_to_ostruct.rb
|
76
|
+
- test/kernel/test_fn.rb
|
77
|
+
- test/kernel/test_prompt.rb
|
78
|
+
- test/kernel/test_require_optional.rb
|
79
|
+
- test/kernel/test_with.rb
|
79
80
|
- test/module/test_private_accessor.rb
|
80
|
-
- test/string/test_in_groups_of.rb
|
81
|
-
- test/string/test_display.rb
|
82
|
-
- test/object/test_it.rb
|
83
81
|
- test/object/test_display.rb
|
82
|
+
- test/object/test_it.rb
|
83
|
+
- test/string/test_cmpi.rb
|
84
|
+
- test/string/test_in_groups_of.rb
|
84
85
|
homepage: http://rubydoc.info/gems/shenanigans/frames
|
85
86
|
licenses:
|
86
87
|
- MIT
|
@@ -91,17 +92,17 @@ require_paths:
|
|
91
92
|
- lib
|
92
93
|
required_ruby_version: !ruby/object:Gem::Requirement
|
93
94
|
requirements:
|
94
|
-
- -
|
95
|
+
- - ">="
|
95
96
|
- !ruby/object:Gem::Version
|
96
97
|
version: '0'
|
97
98
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
98
99
|
requirements:
|
99
|
-
- -
|
100
|
+
- - ">="
|
100
101
|
- !ruby/object:Gem::Version
|
101
102
|
version: '0'
|
102
103
|
requirements: []
|
103
104
|
rubyforge_project:
|
104
|
-
rubygems_version: 2.0
|
105
|
+
rubygems_version: 2.2.0
|
105
106
|
signing_key:
|
106
107
|
specification_version: 4
|
107
108
|
summary: Think Facets, just less useful
|
data/test/string/test_display.rb
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
require 'minitest/autorun'
|
2
|
-
require 'shenanigans/object/display'
|
3
|
-
require 'stringio'
|
4
|
-
|
5
|
-
class Display < MiniTest::Unit::TestCase
|
6
|
-
def setup
|
7
|
-
@orig_stdout = $stdout
|
8
|
-
$stdout = StringIO.new("", "r+")
|
9
|
-
end
|
10
|
-
|
11
|
-
def teardown
|
12
|
-
$stdout = @orig_stdout
|
13
|
-
end
|
14
|
-
|
15
|
-
def test_display
|
16
|
-
str = "foo"
|
17
|
-
assert str.display == str
|
18
|
-
$stdout.rewind
|
19
|
-
assert $stdout.gets.chomp == str
|
20
|
-
end
|
21
|
-
|
22
|
-
def test_display_alias
|
23
|
-
str = "foo"
|
24
|
-
assert str.d == str
|
25
|
-
$stdout.rewind
|
26
|
-
assert $stdout.gets.chomp == str
|
27
|
-
end
|
28
|
-
|
29
|
-
def test_display_no_new_line
|
30
|
-
str = "foo"
|
31
|
-
assert str.display(false) == str
|
32
|
-
$stdout.rewind
|
33
|
-
assert $stdout.gets == str
|
34
|
-
end
|
35
|
-
|
36
|
-
end
|