short_find 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c7e2604b0920ba5f87e8f0c8758900c84a091f0392afa0882746703d15dbb466
4
- data.tar.gz: f3ba322df4b08fe4a5b8aecf9af8bc35e9993b6ec8ae22d885d251fb80a8199d
3
+ metadata.gz: 450b56fbd7b41c02d293d529b0b65718a301e8889bd769f9549052720f377945
4
+ data.tar.gz: 8455863583605fd74d9e4d5846c30e9dc6f77180b25056184ebac01692309970
5
5
  SHA512:
6
- metadata.gz: bf6f7a3985a9b010dd88cf460abb7ef6b26cff31708e735ab48032d81cba551c07edf6c39849a6cdba8b69d0d24106f6ebbc6438d0af379d4cf68b9c2d0dece7
7
- data.tar.gz: 9ea91392184f996b470fd6956da0e76957bf3cbb69d25edcff18d3a931f9d1d013c21cffbe034b9107cc343f8b1d3c71635ff0b49c81dd9b653eeedd2765df1f
6
+ metadata.gz: c78adfb9842426813140c91cb96f4408cd891f4fa166d4722e9081d9bef6e7f5e6fbc2a90fa2dee13338c2509409630a410a29571a533ac1425f0ae891112d93
7
+ data.tar.gz: 66694d24525020a8c0102e9d05bc45bae2e56a035d71e0b3a8a2cd51fe30dfb0f637ae7d658cec1a0b1db0bff2657ff17969dc95f0f0e4e4ba6c26a5b79d0f8c
data/.yardoc/checksums CHANGED
@@ -1 +1 @@
1
- lib/short_find.rb 74bc4fd51fb2287538a863f93b7e27cdcf1a2b5e
1
+ lib/short_find.rb a642c97761f9796051c7efd38a9c41b245f0caf5
Binary file
data/doc/ShortFind.html CHANGED
@@ -138,7 +138,7 @@
138
138
  <li class="public ">
139
139
  <span class="summary_signature">
140
140
 
141
- <a href="#in_array-class_method" title="in_array (class method)">.<strong>in_array</strong>(array) &#x21d2; Object </a>
141
+ <a href="#in_array-class_method" title="in_array (class method)">.<strong>in_array</strong>(array) &#x21d2; Element </a>
142
142
 
143
143
 
144
144
 
@@ -152,7 +152,9 @@
152
152
 
153
153
 
154
154
 
155
- <span class="summary_desc"><div class='inline'></div></span>
155
+ <span class="summary_desc"><div class='inline'>
156
+ <p>Use shorthand to return an element from an array.</p>
157
+ </div></span>
156
158
 
157
159
  </li>
158
160
 
@@ -160,7 +162,7 @@
160
162
  <li class="public ">
161
163
  <span class="summary_signature">
162
164
 
163
- <a href="#in_hash-class_method" title="in_hash (class method)">.<strong>in_hash</strong>(hash, by = :value) &#x21d2; Object </a>
165
+ <a href="#in_hash-class_method" title="in_hash (class method)">.<strong>in_hash</strong>(hash, by = :value) &#x21d2; Element </a>
164
166
 
165
167
 
166
168
 
@@ -174,7 +176,9 @@
174
176
 
175
177
 
176
178
 
177
- <span class="summary_desc"><div class='inline'></div></span>
179
+ <span class="summary_desc"><div class='inline'>
180
+ <p>Use shorthand to return an element from a hash.</p>
181
+ </div></span>
178
182
 
179
183
  </li>
180
184
 
@@ -196,7 +200,9 @@
196
200
 
197
201
 
198
202
 
199
- <span class="summary_desc"><div class='inline'></div></span>
203
+ <span class="summary_desc"><div class='inline'>
204
+ <p>Use shorthand to return an object from an array.</p>
205
+ </div></span>
200
206
 
201
207
  </li>
202
208
 
@@ -279,36 +285,75 @@
279
285
  <div class="method_details first">
280
286
  <h3 class="signature first" id="in_array-class_method">
281
287
 
282
- .<strong>in_array</strong>(array) &#x21d2; <tt>Object</tt>
288
+ .<strong>in_array</strong>(array) &#x21d2; <tt>Element</tt>
283
289
 
284
290
 
285
291
 
286
292
 
287
293
 
288
- </h3><table class="source_code">
294
+ </h3><div class="docstring">
295
+ <div class="discussion">
296
+
297
+ <p>Use shorthand to return an element from an array</p>
298
+
299
+
300
+ </div>
301
+ </div>
302
+ <div class="tags">
303
+ <p class="tag_title">Parameters:</p>
304
+ <ul class="param">
305
+
306
+ <li>
307
+
308
+ <span class='name'>array</span>
309
+
310
+
311
+ <span class='type'>(<tt>Array</tt>)</span>
312
+
313
+
314
+
315
+ </li>
316
+
317
+ </ul>
318
+
319
+ <p class="tag_title">Returns:</p>
320
+ <ul class="return">
321
+
322
+ <li>
323
+
324
+
325
+ <span class='type'>(<tt>Element</tt>)</span>
326
+
327
+
328
+
329
+ </li>
330
+
331
+ </ul>
332
+
333
+ </div><table class="source_code">
289
334
  <tr>
290
335
  <td>
291
336
  <pre class="lines">
292
337
 
293
338
 
294
- 34
295
- 35
296
- 36
297
- 37
298
- 38
299
- 39
300
- 40
301
- 41
302
- 42
303
- 43
304
339
  44
305
340
  45
306
341
  46
307
342
  47
308
- 48</pre>
343
+ 48
344
+ 49
345
+ 50
346
+ 51
347
+ 52
348
+ 53
349
+ 54
350
+ 55
351
+ 56
352
+ 57
353
+ 58</pre>
309
354
  </td>
310
355
  <td>
311
- <pre class="code"><span class="info file"># File 'lib/short_find.rb', line 34</span>
356
+ <pre class="code"><span class="info file"># File 'lib/short_find.rb', line 44</span>
312
357
 
313
358
  <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_in_array'>in_array</span><span class='lparen'>(</span><span class='id identifier rubyid_array'>array</span><span class='rparen'>)</span>
314
359
  <span class='id identifier rubyid_r_format'>r_format</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>first</span><span class='tstring_end'>&quot;</span></span>
@@ -333,42 +378,81 @@
333
378
  <div class="method_details ">
334
379
  <h3 class="signature " id="in_hash-class_method">
335
380
 
336
- .<strong>in_hash</strong>(hash, by = :value) &#x21d2; <tt>Object</tt>
381
+ .<strong>in_hash</strong>(hash, by = :value) &#x21d2; <tt>Element</tt>
337
382
 
338
383
 
339
384
 
340
385
 
341
386
 
342
- </h3><table class="source_code">
387
+ </h3><div class="docstring">
388
+ <div class="discussion">
389
+
390
+ <p>Use shorthand to return an element from a hash</p>
391
+
392
+
393
+ </div>
394
+ </div>
395
+ <div class="tags">
396
+ <p class="tag_title">Parameters:</p>
397
+ <ul class="param">
398
+
399
+ <li>
400
+
401
+ <span class='name'>hash</span>
402
+
403
+
404
+ <span class='type'>(<tt>Hash</tt>)</span>
405
+
406
+
407
+
408
+ </li>
409
+
410
+ </ul>
411
+
412
+ <p class="tag_title">Returns:</p>
413
+ <ul class="return">
414
+
415
+ <li>
416
+
417
+
418
+ <span class='type'>(<tt>Element</tt>)</span>
419
+
420
+
421
+
422
+ </li>
423
+
424
+ </ul>
425
+
426
+ </div><table class="source_code">
343
427
  <tr>
344
428
  <td>
345
429
  <pre class="lines">
346
430
 
347
431
 
348
- 50
349
- 51
350
- 52
351
- 53
352
- 54
353
- 55
354
- 56
355
- 57
356
- 58
357
- 59
358
- 60
359
- 61
360
- 62
361
- 63
362
- 64
363
432
  65
364
433
  66
365
434
  67
366
435
  68
367
436
  69
368
- 70</pre>
437
+ 70
438
+ 71
439
+ 72
440
+ 73
441
+ 74
442
+ 75
443
+ 76
444
+ 77
445
+ 78
446
+ 79
447
+ 80
448
+ 81
449
+ 82
450
+ 83
451
+ 84
452
+ 85</pre>
369
453
  </td>
370
454
  <td>
371
- <pre class="code"><span class="info file"># File 'lib/short_find.rb', line 50</span>
455
+ <pre class="code"><span class="info file"># File 'lib/short_find.rb', line 65</span>
372
456
 
373
457
  <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_in_hash'>in_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_hash'>hash</span><span class='comma'>,</span> <span class='id identifier rubyid_by'>by</span><span class='op'>=</span><span class='symbol'>:value</span><span class='rparen'>)</span>
374
458
  <span class='id identifier rubyid_by'>by</span> <span class='op'>=</span> <span class='id identifier rubyid_by'>by</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
@@ -405,17 +489,56 @@
405
489
 
406
490
 
407
491
 
408
- </h3><table class="source_code">
492
+ </h3><div class="docstring">
493
+ <div class="discussion">
494
+
495
+ <p>Use shorthand to return an object from an array</p>
496
+
497
+
498
+ </div>
499
+ </div>
500
+ <div class="tags">
501
+ <p class="tag_title">Parameters:</p>
502
+ <ul class="param">
503
+
504
+ <li>
505
+
506
+ <span class='name'>array</span>
507
+
508
+
509
+ <span class='type'></span>
510
+
511
+
512
+
513
+ &mdash;
514
+ <div class='inline'>
515
+ <p>of objects [Array]</p>
516
+ </div>
517
+
518
+ </li>
519
+
520
+ </ul>
521
+
522
+ <p class="tag_title">Returns:</p>
523
+ <ul class="return">
524
+
525
+ <li>
526
+
527
+
528
+ <span class='type'>(<tt>Object</tt>)</span>
529
+
530
+
531
+
532
+ </li>
533
+
534
+ </ul>
535
+
536
+ </div><table class="source_code">
409
537
  <tr>
410
538
  <td>
411
539
  <pre class="lines">
412
540
 
413
541
 
414
- 18
415
- 19
416
- 20
417
- 21
418
- 22
419
542
  23
420
543
  24
421
544
  25
@@ -425,10 +548,15 @@
425
548
  29
426
549
  30
427
550
  31
428
- 32</pre>
551
+ 32
552
+ 33
553
+ 34
554
+ 35
555
+ 36
556
+ 37</pre>
429
557
  </td>
430
558
  <td>
431
- <pre class="code"><span class="info file"># File 'lib/short_find.rb', line 18</span>
559
+ <pre class="code"><span class="info file"># File 'lib/short_find.rb', line 23</span>
432
560
 
433
561
  <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_object'>object</span><span class='lparen'>(</span><span class='id identifier rubyid_objects'>objects</span><span class='comma'>,</span> <span class='id identifier rubyid_attr'>attr</span><span class='op'>=</span><span class='symbol'>:name</span><span class='rparen'>)</span>
434
562
  <span class='id identifier rubyid_attr'>attr</span> <span class='op'>=</span> <span class='id identifier rubyid_attr'>attr</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
@@ -547,7 +675,7 @@
547
675
  </div>
548
676
 
549
677
  <div id="footer">
550
- Generated on Thu Jan 3 16:55:14 2019 by
678
+ Generated on Thu Jan 3 17:41:57 2019 by
551
679
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
552
680
  0.9.16 (ruby-2.5.3).
553
681
  </div>
data/doc/_index.html CHANGED
@@ -97,7 +97,7 @@
97
97
  </div>
98
98
 
99
99
  <div id="footer">
100
- Generated on Thu Jan 3 16:55:14 2019 by
100
+ Generated on Thu Jan 3 17:41:57 2019 by
101
101
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
102
102
  0.9.16 (ruby-2.5.3).
103
103
  </div>
data/doc/file.README.html CHANGED
@@ -111,7 +111,7 @@ program when “exit” is entered in the command line.</p>
111
111
  </div></div>
112
112
 
113
113
  <div id="footer">
114
- Generated on Thu Jan 3 16:55:14 2019 by
114
+ Generated on Thu Jan 3 17:41:57 2019 by
115
115
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
116
116
  0.9.16 (ruby-2.5.3).
117
117
  </div>
data/doc/index.html CHANGED
@@ -111,7 +111,7 @@ program when “exit” is entered in the command line.</p>
111
111
  </div></div>
112
112
 
113
113
  <div id="footer">
114
- Generated on Thu Jan 3 16:55:14 2019 by
114
+ Generated on Thu Jan 3 17:41:57 2019 by
115
115
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
116
116
  0.9.16 (ruby-2.5.3).
117
117
  </div>
@@ -100,7 +100,7 @@
100
100
  </div>
101
101
 
102
102
  <div id="footer">
103
- Generated on Thu Jan 3 16:55:14 2019 by
103
+ Generated on Thu Jan 3 17:41:57 2019 by
104
104
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
105
105
  0.9.16 (ruby-2.5.3).
106
106
  </div>
data/lib/short_find.rb CHANGED
@@ -15,6 +15,11 @@ class ShortFind
15
15
  @@exit = boolean
16
16
  end
17
17
 
18
+ # Use shorthand to return an object from an array
19
+ #
20
+ # @param array of objects [Array]
21
+ # @return [Object]
22
+
18
23
  def self.object(objects, attr=:name)
19
24
  attr = attr.to_s
20
25
  r_format = "first"
@@ -31,6 +36,11 @@ class ShortFind
31
36
  end
32
37
  end
33
38
 
39
+ # Use shorthand to return an element from an array
40
+ #
41
+ # @param array [Array]
42
+ # @return [Element]
43
+
34
44
  def self.in_array(array)
35
45
  r_format = "first"
36
46
  attr = "to_s"
@@ -47,6 +57,11 @@ class ShortFind
47
57
  end
48
58
  end
49
59
 
60
+ # Use shorthand to return an element from a hash
61
+ #
62
+ # @param hash [Hash]
63
+ # @return [Element]
64
+
50
65
  def self.in_hash(hash, by=:value)
51
66
  by = by.to_s
52
67
  r_format = "to_h"
Binary file
data/short_find.gemspec CHANGED
@@ -1,13 +1,21 @@
1
+ lib = File.expand_path("../lib", __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+
1
4
  Gem::Specification.new do |s|
2
5
  s.name = 'short_find'
3
- s.version = '1.0.4'
6
+ s.version = '1.0.5'
4
7
  s.date = '2019-01-03'
5
8
  s.summary = "Allow a user to find things by typing just enough letters to make it unique."
6
9
  s.description = "Allow a user to find things by typing just enough letters and/or numbers to make it unique. The user can enter a string of letters. Ignoring case, spaces, and special characters, if there is only one match, short_find will return the item that starts with those characters. If no item is matched, or if more than one item is matched it will give an error and allow the user to try again."
7
10
  s.authors = ["Arthur Torres"]
8
11
  s.email = 'arthurtorres002@gmail.com'
9
- s.files = `git ls-files`.split($/)
12
+ s.files = Dir.chdir(File.expand_path('..', __FILE__)) do
13
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
14
+ end
10
15
  s.homepage =
11
16
  'http://rubygems.org/gems/short_find'
12
17
  s.license = 'MIT'
18
+ s.require_paths = ["lib"]
19
+ s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
+
13
21
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: short_find
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arthur Torres
@@ -46,6 +46,7 @@ files:
46
46
  - short_find-1.0.1.gem
47
47
  - short_find-1.0.2.gem
48
48
  - short_find-1.0.3.gem
49
+ - short_find-1.0.4.gem
49
50
  - short_find.gemspec
50
51
  - test.rb
51
52
  homepage: http://rubygems.org/gems/short_find