object_tree 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/example/sample.rb +0 -14
- data/example/sample2.rb +18 -0
- data/lib/object_tree/version.rb +1 -1
- data/lib/object_tree.rb +5 -5
- metadata +47 -69
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
YWViMzAxNGUwMDU5NTAzNjdhZTkzZTcyMGFhZmE0ZjdkZTM4NDFiOA==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
NTgyMTBkNjc4MzZhNWU4MzFlYWIxNGE1Y2ZlYmZlNThmM2VmZWQ4OA==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
MzI4ZGVlOTI3MWFkZWVhZjRhYjQzOTQ0YzQwYTBhMzM0ZGM3ZDg2NmFlM2I3
|
10
|
+
MDI4MmFlZWE3OWQ0NzFkYmYzOTc0ZjYzYWVjMWExNTM2Yzk5NzVjNDRiMDY3
|
11
|
+
OWIzOTE2Y2U0NWI2YWMxMzcxMjViYmZhZTViYzk0YjZlZDI1NjI=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
ZTUzYTI5ODVkOGU2YWZhOWMzN2VmMWQ0NjRhNTViNzczYzUxMzhhNzUzN2Q4
|
14
|
+
YWI3ZmIyN2E0ODFjYzE2YWEwZDc5NzU0ZDEzZDJkNzQ3YTBiMjA5Yzk3M2Jl
|
15
|
+
MTFjYmQzMWY5Y2NhNzNhZWMyYTA1NDFiNjMxZjAxNjcwMTM1YzE=
|
data/example/sample.rb
CHANGED
@@ -1,27 +1,13 @@
|
|
1
1
|
require 'object_tree'
|
2
2
|
|
3
|
-
module D
|
4
|
-
end
|
5
|
-
|
6
|
-
module E
|
7
|
-
end
|
8
|
-
|
9
3
|
class A
|
10
|
-
include D
|
11
4
|
end
|
12
5
|
|
13
6
|
class B < A
|
14
7
|
end
|
15
8
|
|
16
9
|
class C < A
|
17
|
-
include E
|
18
10
|
end
|
19
11
|
|
20
|
-
tree = ObjectTree::Tree.create(A)
|
21
|
-
tree.draw
|
22
|
-
|
23
|
-
puts
|
24
|
-
|
25
|
-
# include module
|
26
12
|
tree = ObjectTree::Tree.create(BasicObject, true)
|
27
13
|
tree.draw
|
data/example/sample2.rb
ADDED
data/lib/object_tree/version.rb
CHANGED
data/lib/object_tree.rb
CHANGED
@@ -85,7 +85,7 @@ module ObjectTree
|
|
85
85
|
nest.times do |column_number|
|
86
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
|
@@ -100,14 +100,14 @@ module ObjectTree
|
|
100
100
|
end
|
101
101
|
|
102
102
|
if @tree.has_key?(sub)
|
103
|
-
print ( sub == subclasses.last )? "
|
103
|
+
print ( sub == subclasses.last )? "└──── " : "├──── "
|
104
104
|
if sub == subclasses.last
|
105
105
|
draw_tree({ sub => @tree[sub]}, nest + 1, false, true)
|
106
106
|
else
|
107
107
|
draw_tree({ sub => @tree[sub]}, nest + 1, false, false)
|
108
108
|
end
|
109
109
|
else
|
110
|
-
print "#{( sub == subclasses.last )? '
|
110
|
+
print "#{( sub == subclasses.last )? '└──── ' : '├──── '}"
|
111
111
|
nest_count = 0
|
112
112
|
if( @mflag && sub.kind_of?(Class) )
|
113
113
|
module_list = sub.ancestors[0..sub.ancestors.find_index(klass)-1].reverse - ([sub, klass] + sub.prepended_modules)
|
@@ -120,7 +120,7 @@ module ObjectTree
|
|
120
120
|
(nest+add+1).times do |column_number|
|
121
121
|
print ((@last_check[column_number])? " " : "│ ") + " " * SPACE_SIZE
|
122
122
|
end
|
123
|
-
print "
|
123
|
+
print "└──── "
|
124
124
|
nest_count += 1
|
125
125
|
end
|
126
126
|
end
|
@@ -133,7 +133,7 @@ module ObjectTree
|
|
133
133
|
(nest+nest_count+add+1).times do |column_number|
|
134
134
|
print ((@last_check[column_number])? " " : "│ ") + " " * SPACE_SIZE
|
135
135
|
end
|
136
|
-
puts "
|
136
|
+
puts "└──── \e[#{MCOLOR}m<M>\e[m#{m.inspect}"
|
137
137
|
@last_check[nest+add+1] = true
|
138
138
|
end
|
139
139
|
end
|
metadata
CHANGED
@@ -1,104 +1,82 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: object_tree
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 0
|
9
|
-
- 8
|
10
|
-
version: 0.0.8
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.9
|
11
5
|
platform: ruby
|
12
|
-
authors:
|
6
|
+
authors:
|
13
7
|
- siman-man
|
14
8
|
autorequire:
|
15
9
|
bindir: bin
|
16
10
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
dependencies:
|
21
|
-
- !ruby/object:Gem::Dependency
|
11
|
+
date: 2013-09-20 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
22
14
|
name: bundler
|
23
|
-
|
24
|
-
|
25
|
-
none: false
|
26
|
-
requirements:
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
27
17
|
- - ~>
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
|
30
|
-
segments:
|
31
|
-
- 1
|
32
|
-
- 3
|
33
|
-
version: "1.3"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.3'
|
34
20
|
type: :development
|
35
|
-
version_requirements: *id001
|
36
|
-
- !ruby/object:Gem::Dependency
|
37
|
-
name: rake
|
38
21
|
prerelease: false
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ! '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
48
34
|
type: :development
|
49
|
-
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ! '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
50
41
|
description: this is ruby object tree show like tree commnad!
|
51
|
-
email:
|
42
|
+
email:
|
52
43
|
- k128585@ie.u-ryukyu.ac.jp
|
53
44
|
executables: []
|
54
|
-
|
55
45
|
extensions: []
|
56
|
-
|
57
46
|
extra_rdoc_files: []
|
58
|
-
|
59
|
-
files:
|
47
|
+
files:
|
60
48
|
- .gitignore
|
61
49
|
- Gemfile
|
62
50
|
- LICENSE.txt
|
63
51
|
- README.md
|
64
52
|
- Rakefile
|
65
53
|
- example/sample.rb
|
54
|
+
- example/sample2.rb
|
66
55
|
- lib/object_tree.rb
|
67
56
|
- lib/object_tree/version.rb
|
68
57
|
- object_tree.gemspec
|
69
|
-
has_rdoc: true
|
70
58
|
homepage: https://github.com/siman-man/object_tree
|
71
|
-
licenses:
|
59
|
+
licenses:
|
72
60
|
- MIT
|
61
|
+
metadata: {}
|
73
62
|
post_install_message:
|
74
63
|
rdoc_options: []
|
75
|
-
|
76
|
-
require_paths:
|
64
|
+
require_paths:
|
77
65
|
- lib
|
78
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
none: false
|
89
|
-
requirements:
|
90
|
-
- - ">="
|
91
|
-
- !ruby/object:Gem::Version
|
92
|
-
hash: 3
|
93
|
-
segments:
|
94
|
-
- 0
|
95
|
-
version: "0"
|
66
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - ! '>='
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '0'
|
71
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ! '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
96
76
|
requirements: []
|
97
|
-
|
98
77
|
rubyforge_project:
|
99
|
-
rubygems_version:
|
78
|
+
rubygems_version: 2.0.3
|
100
79
|
signing_key:
|
101
|
-
specification_version:
|
80
|
+
specification_version: 4
|
102
81
|
summary: tree command like show object hierarchy
|
103
82
|
test_files: []
|
104
|
-
|