tree_slava 0.0.3 → 0.0.4
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 +4 -4
- data/bin/tree_slava +1 -1
- data/lib/data_tree/tree.rb +6 -4
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2c65c80a8074797db632e4068909922b747890e15d3373a233aca78359000114
|
|
4
|
+
data.tar.gz: 6c45185ddd7456b1a2385ad06cbfd6cd77b570c50384c655e59edc0b2a188914
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b87fa20cf110a782170a3807a930f2259b5fc7e7ce4787bf66d94c443bb7f03bb385ba9a9fcf97e44d697d434cf32309fad61377760012587c569802592e2008
|
|
7
|
+
data.tar.gz: f36bd88eff1fbfa79610730eb5c44de85aa04ae71a35cc23a11a988cfa6887730064f713209aaa01572d73f39347a0950a96bc77997156d00135ee3cfdc3ebd9
|
data/bin/tree_slava
CHANGED
data/lib/data_tree/tree.rb
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
require 'parallel'
|
|
2
|
+
|
|
1
3
|
class Tree
|
|
2
4
|
def make_tree(path_arr, root)
|
|
3
5
|
tree_data = path_arr
|
|
@@ -8,7 +10,7 @@ class Tree
|
|
|
8
10
|
space = ' '
|
|
9
11
|
tree_data.sort!
|
|
10
12
|
i = tree_data.length
|
|
11
|
-
while i
|
|
13
|
+
while i != 1
|
|
12
14
|
i -= 1
|
|
13
15
|
level = tree_data[i].to_s.count('/') - root.to_s.count('/')
|
|
14
16
|
tree_hash[i] = []
|
|
@@ -27,9 +29,9 @@ class Tree
|
|
|
27
29
|
elsif tree_hash[i + 1].nil?
|
|
28
30
|
next
|
|
29
31
|
elsif tree_hash[i][index] == space &&
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
(tree_hash[i + 1][index] == branch ||
|
|
33
|
+
tree_hash[i + 1][index] == pipe ||
|
|
34
|
+
tree_hash[i + 1][index] == leaf)
|
|
33
35
|
tree_hash[i][index] = pipe
|
|
34
36
|
elsif tree_hash[i][index] == branch &&
|
|
35
37
|
(tree_hash[i + 1][index] != branch &&
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: tree_slava
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- somestyl3
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-06-
|
|
11
|
+
date: 2019-06-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Data tree utility gem
|
|
14
14
|
email:
|