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 +4 -4
- data/README.org +28 -24
- data/lib/tree_support/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a7797157069c7f57939c4580221e0fc8c0483244166e86d91e094029b58f8917
|
4
|
+
data.tar.gz: f7ffbf8cdf143ac689e585d57de779ae1fb08a7608b609e7f7fc4bd69f069bcd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
-
|
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
|
data/lib/tree_support/version.rb
CHANGED
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.
|
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:
|
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
|
-
|
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
|