tree_support 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8490b76d2456c35bc4b9a891c9126872aa85b75cf082c6fcb3dd0cfde39ad10f
4
- data.tar.gz: 2a4032b5f7371ae6f6a14fd68129b847914d2ca4600990c911048ffb1044ba94
3
+ metadata.gz: a7797157069c7f57939c4580221e0fc8c0483244166e86d91e094029b58f8917
4
+ data.tar.gz: f7ffbf8cdf143ac689e585d57de779ae1fb08a7608b609e7f7fc4bd69f069bcd
5
5
  SHA512:
6
- metadata.gz: 9f4823684332133d005d6b214e2a523565b275c7738058e9e9d4c3eb3f5494b97982137da3440e7c8282e2967c3e48ad93728708e779c980e5557f34fdd0c111
7
- data.tar.gz: 9f07e3b6fd40238fa35d44c20ec365c85fa0776fa4ec468c00171f6a1a58e99ffe6f3a9ce888220bd0e83e41e6ff00aca128979d7daafc57c47fe809ecdb8b73
6
+ metadata.gz: 07a55a59219684b3f047578d9c5a9d76493302860c43280c6a2883fb000f1bfff21a7f027ca3b5a939dea76c1d4588b9b10b657f4bf87a2afc9b5c4df5e95b14
7
+ data.tar.gz: 393e8c1ebe95c676a4e67ac7fcdf19c03122e7a10bb2cd4b076790c227a1511b990ce124cd10be4b9524c7d4fcca48087962f0705c53065c6eef5c7f68a7dad5
data/README.org CHANGED
@@ -403,9 +403,32 @@ puts TreeSupport.tree(root, take: 3, drop: 1)
403
403
  # >> └─Recover
404
404
  #+END_SRC
405
405
 
406
+ *** Image version also has similar options
407
+
408
+ #+BEGIN_SRC ruby
409
+ gv = TreeSupport.graphviz(root, drop: 1)
410
+ gv.output("drop.png")
411
+ #+END_SRC
412
+
413
+ [[https://raw.github.com/akicho8/tree_support/master/images/drop.png]]
414
+
415
+ #+BEGIN_SRC ruby
416
+ gv = TreeSupport.graphviz(root, take: 3)
417
+ gv.output("take.png")
418
+ #+END_SRC
419
+
420
+ [[https://raw.github.com/akicho8/tree_support/master/images/take.png]]
421
+
422
+ #+BEGIN_SRC ruby
423
+ gv = TreeSupport.graphviz(root, take: 3, drop: 1)
424
+ gv.output("take_drop.png")
425
+ #+END_SRC
426
+
427
+ [[https://raw.github.com/akicho8/tree_support/master/images/take_drop.png]]
428
+
406
429
  *** Methods for easily making trees from data like CSV
407
430
 
408
- Array -> Tree
431
+ Conversion from Array to Tree
409
432
 
410
433
  #+BEGIN_SRC ruby
411
434
  require "tree_support"
@@ -428,8 +451,11 @@ puts TreeSupport.records_to_tree(records, root_key: :root).to_s_tree
428
451
  # >> └─a
429
452
  # >> └─b
430
453
  # >> └─c
454
+ #+END_SRC
431
455
 
432
- # Convert from tree to array
456
+ Conversion from Tree to Array
457
+
458
+ #+BEGIN_SRC ruby
433
459
  tree = TreeSupport.records_to_tree(records)
434
460
  pp TreeSupport.tree_to_records(tree.first)
435
461
  # >> [
@@ -437,30 +463,8 @@ pp TreeSupport.tree_to_records(tree.first)
437
463
  # >> {:key=>:b, :parent=>:a},
438
464
  # >> {:key=>:c, :parent=>:b},
439
465
  # >> ]
440
-
441
- *** Image version also has similar options
442
-
443
- #+BEGIN_SRC ruby
444
- gv = TreeSupport.graphviz(root, drop: 1)
445
- gv.output("drop.png")
446
- #+END_SRC
447
-
448
- [[https://raw.github.com/akicho8/tree_support/master/images/drop.png]]
449
-
450
- #+BEGIN_SRC ruby
451
- gv = TreeSupport.graphviz(root, take: 3)
452
- gv.output("take.png")
453
- #+END_SRC
454
-
455
- [[https://raw.github.com/akicho8/tree_support/master/images/take.png]]
456
-
457
- #+BEGIN_SRC ruby
458
- gv = TreeSupport.graphviz(root, take: 3, drop: 1)
459
- gv.output("take_drop.png")
460
466
  #+END_SRC
461
467
 
462
- [[https://raw.github.com/akicho8/tree_support/master/images/take_drop.png]]
463
-
464
468
  *** How to use acts_as_tree equivalent?
465
469
 
466
470
  Migration
@@ -1,3 +1,3 @@
1
1
  module TreeSupport
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tree_support
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - akicho8
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-18 00:00:00.000000000 Z
11
+ date: 2019-11-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -184,8 +184,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
184
184
  - !ruby/object:Gem::Version
185
185
  version: '0'
186
186
  requirements: []
187
- rubyforge_project:
188
- rubygems_version: 2.7.6
187
+ rubygems_version: 3.0.3
189
188
  signing_key:
190
189
  specification_version: 4
191
190
  summary: Tree structure visualization function library