object_tree 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +6 -6
- data/example/sample.rb +1 -1
- data/example/sample2.rb +6 -3
- data/lib/object_tree/version.rb +1 -1
- data/lib/object_tree.rb +5 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YjgzOWY2MGI0ZmUzMmIwZTZmYWI1NzZiODg0MmYxZjRlNjMzMWNmNQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
Zjg2ZDcwYWJiOTFkZGM0MjVlODc3YjM2NTY1OTBjZGI0YWQ5Y2M4YQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZjBhYWEwYjgyYjQyNTNhMGIzZWExMmMyOGQ4NDQxYmUwN2EzOTZjZGMzNjk4
|
10
|
+
OGE2ZTIzN2MxMjJiYzliYzE0MTA5MzMyYWQwMGJlMDgwYzNmOGRmYTdlMzdm
|
11
|
+
NDZkMTliZjIyMmUzMWY5MjU0MDMwOWVjNGJhMjQ3NzA4MTFmZDA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MmEwNjQ1ODg0MTVhYzhjNDUyODJhM2Q4ZmI1ZWE4MTI1YTkwYzMwNzM0NzM0
|
14
|
+
Y2VlMTE2MGMzZGQ4YmExZDA3MzBiODgzNTkzZDZjYTcxOTBjZjk1MGZjYjAz
|
15
|
+
MDVlMjlmYzc3YTBjNDNiNTRmM2VhNTAzMzk4YTBiOTNhMjlkMmI=
|
data/README.md
CHANGED
@@ -33,8 +33,8 @@ tree.draw
|
|
33
33
|
|
34
34
|
```zsh
|
35
35
|
<C>A
|
36
|
-
|
37
|
-
|
36
|
+
├──── <C>C
|
37
|
+
└──── <C>B
|
38
38
|
```
|
39
39
|
|
40
40
|
こんな感じでtreeっぽく出力してくれる。
|
@@ -66,10 +66,10 @@ tree.draw
|
|
66
66
|
|
67
67
|
```zsh
|
68
68
|
<M>D
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
69
|
+
└──── <C>A
|
70
|
+
├──── <M>E
|
71
|
+
│ └──── <C>C
|
72
|
+
└──── <C>B
|
73
73
|
```
|
74
74
|
|
75
75
|
第二引数をtrueにするとmoduleも表示してくれる。
|
data/example/sample.rb
CHANGED
data/example/sample2.rb
CHANGED
data/lib/object_tree/version.rb
CHANGED
data/lib/object_tree.rb
CHANGED
@@ -83,9 +83,9 @@ module ObjectTree
|
|
83
83
|
@last_check[nest] = true
|
84
84
|
|
85
85
|
nest.times do |column_number|
|
86
|
-
print ((@last_check[column_number])? "
|
86
|
+
print ((@last_check[column_number])? " " : "│") + " " * SPACE_SIZE
|
87
87
|
end
|
88
|
-
print "└────"
|
88
|
+
print "└──── "
|
89
89
|
nest += 1
|
90
90
|
end
|
91
91
|
end
|
@@ -96,7 +96,7 @@ module ObjectTree
|
|
96
96
|
@last_check[nest] = true if sub == subclasses.last
|
97
97
|
|
98
98
|
nest.times do |column_number|
|
99
|
-
print ((@last_check[column_number])? "
|
99
|
+
print ((@last_check[column_number])? " " : "│") + " " * SPACE_SIZE
|
100
100
|
end
|
101
101
|
|
102
102
|
if @tree.has_key?(sub)
|
@@ -118,7 +118,7 @@ module ObjectTree
|
|
118
118
|
@last_check[nest+add+1] = true
|
119
119
|
|
120
120
|
(nest+add+1).times do |column_number|
|
121
|
-
print ((@last_check[column_number])? "
|
121
|
+
print ((@last_check[column_number])? " " : "│") + " " * SPACE_SIZE
|
122
122
|
end
|
123
123
|
print "└──── "
|
124
124
|
nest_count += 1
|
@@ -131,7 +131,7 @@ module ObjectTree
|
|
131
131
|
|
132
132
|
prepended_modules.each_with_index do |m, add|
|
133
133
|
(nest+nest_count+add+1).times do |column_number|
|
134
|
-
print ((@last_check[column_number])? "
|
134
|
+
print ((@last_check[column_number])? " " : "│") + " " * SPACE_SIZE
|
135
135
|
end
|
136
136
|
puts "└──── \e[#{MCOLOR}m<M>\e[m#{m.inspect}"
|
137
137
|
@last_check[nest+add+1] = true
|