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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YWViMzAxNGUwMDU5NTAzNjdhZTkzZTcyMGFhZmE0ZjdkZTM4NDFiOA==
4
+ YjgzOWY2MGI0ZmUzMmIwZTZmYWI1NzZiODg0MmYxZjRlNjMzMWNmNQ==
5
5
  data.tar.gz: !binary |-
6
- NTgyMTBkNjc4MzZhNWU4MzFlYWIxNGE1Y2ZlYmZlNThmM2VmZWQ4OA==
6
+ Zjg2ZDcwYWJiOTFkZGM0MjVlODc3YjM2NTY1OTBjZGI0YWQ5Y2M4YQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MzI4ZGVlOTI3MWFkZWVhZjRhYjQzOTQ0YzQwYTBhMzM0ZGM3ZDg2NmFlM2I3
10
- MDI4MmFlZWE3OWQ0NzFkYmYzOTc0ZjYzYWVjMWExNTM2Yzk5NzVjNDRiMDY3
11
- OWIzOTE2Y2U0NWI2YWMxMzcxMjViYmZhZTViYzk0YjZlZDI1NjI=
9
+ ZjBhYWEwYjgyYjQyNTNhMGIzZWExMmMyOGQ4NDQxYmUwN2EzOTZjZGMzNjk4
10
+ OGE2ZTIzN2MxMjJiYzliYzE0MTA5MzMyYWQwMGJlMDgwYzNmOGRmYTdlMzdm
11
+ NDZkMTliZjIyMmUzMWY5MjU0MDMwOWVjNGJhMjQ3NzA4MTFmZDA=
12
12
  data.tar.gz: !binary |-
13
- ZTUzYTI5ODVkOGU2YWZhOWMzN2VmMWQ0NjRhNTViNzczYzUxMzhhNzUzN2Q4
14
- YWI3ZmIyN2E0ODFjYzE2YWEwZDc5NzU0ZDEzZDJkNzQ3YTBiMjA5Yzk3M2Jl
15
- MTFjYmQzMWY5Y2NhNzNhZWMyYTA1NDFiNjMxZjAxNjcwMTM1YzE=
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
- ├─ ─ ── <C>C
37
- └─ ─ ── <C>B
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
- └─ ─ ── <C>A
70
- ├─ ─ ── <M>E
71
- └─ ─ ── <C>C
72
- └─ ─ ── <C>B
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
@@ -9,5 +9,5 @@ end
9
9
  class C < A
10
10
  end
11
11
 
12
- tree = ObjectTree::Tree.create(BasicObject, true)
12
+ tree = ObjectTree::Tree.create(A, true)
13
13
  tree.draw
data/example/sample2.rb CHANGED
@@ -1,13 +1,16 @@
1
1
  require 'object_tree'
2
2
 
3
- module D; end
4
- module E; end
3
+ module D
4
+ end
5
+
6
+ module E
7
+ end
5
8
 
6
9
  class A
10
+ include D
7
11
  end
8
12
 
9
13
  class B < A
10
- include D
11
14
  end
12
15
 
13
16
  class C < A
@@ -1,3 +1,3 @@
1
1
  module ObjectTree
2
- VERSION = "0.0.9"
2
+ VERSION = "0.0.10"
3
3
  end
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])? " " : "│ ") + " " * SPACE_SIZE
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])? " " : "│ ") + " " * SPACE_SIZE
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])? " " : "│ ") + " " * SPACE_SIZE
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])? " " : "│ ") + " " * SPACE_SIZE
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: object_tree
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - siman-man