object_tree 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3a345eb6ffefb173785e698e9817f4122355b6ff
4
+ data.tar.gz: b1b08b464c98c07b24d8c3aab395188a919deb67
5
+ SHA512:
6
+ metadata.gz: 23710b6dd871bac1779204a9c8ed264e81bca81d7261aa11da3da7e2fce698d675feacf4aa8dabedda091574e58048ef6ef6be7ba0eb1513de9b3b708db80a15
7
+ data.tar.gz: d6c943fe00ded2d27fb7bfce59e8d41482864bdebdf1bc4a04591912cf307ab9b48211807214c0c7c351b07c13be901f9f80f8d66144d47532244e07a4947ec4
data/example/sample.rb CHANGED
@@ -17,5 +17,11 @@ class C < A
17
17
  include E
18
18
  end
19
19
 
20
+ tree = ObjectTree::Tree.create(A)
21
+ tree.draw
22
+
23
+ puts
24
+
25
+ # include module
20
26
  tree = ObjectTree::Tree.create(A, true)
21
27
  tree.draw
@@ -1,3 +1,3 @@
1
1
  module ObjectTree
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
data/lib/object_tree.rb CHANGED
@@ -22,7 +22,7 @@ module ObjectTree
22
22
  @mflag = mflag
23
23
  @root_class = klass
24
24
 
25
- if klass == BasicObject
25
+ if RUBY_VERSION >= "1.9" && klass == OasicObject
26
26
  klass = Object
27
27
  @tree[BasicObject] << Object
28
28
  end
@@ -107,7 +107,7 @@ module ObjectTree
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)
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: object_tree
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
5
- prerelease:
4
+ version: 0.0.7
6
5
  platform: ruby
7
6
  authors:
8
7
  - siman-man
@@ -14,7 +13,6 @@ dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: bundler
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
@@ -30,17 +27,15 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rake
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - '>='
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - '>='
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  description: this is ruby object tree show like tree commnad!
@@ -56,33 +51,32 @@ files:
56
51
  - README.md
57
52
  - Rakefile
58
53
  - example/sample.rb
59
- - example/test.rb
60
54
  - lib/object_tree.rb
61
55
  - lib/object_tree/version.rb
62
56
  - object_tree.gemspec
63
57
  homepage: https://github.com/siman-man/object_tree
64
58
  licenses:
65
59
  - MIT
60
+ metadata: {}
66
61
  post_install_message:
67
62
  rdoc_options: []
68
63
  require_paths:
69
64
  - lib
70
65
  required_ruby_version: !ruby/object:Gem::Requirement
71
- none: false
72
66
  requirements:
73
- - - ! '>='
67
+ - - '>='
74
68
  - !ruby/object:Gem::Version
75
69
  version: '0'
76
70
  required_rubygems_version: !ruby/object:Gem::Requirement
77
- none: false
78
71
  requirements:
79
- - - ! '>='
72
+ - - '>='
80
73
  - !ruby/object:Gem::Version
81
74
  version: '0'
82
75
  requirements: []
83
76
  rubyforge_project:
84
- rubygems_version: 1.8.23
77
+ rubygems_version: 2.0.3
85
78
  signing_key:
86
- specification_version: 3
79
+ specification_version: 4
87
80
  summary: tree command like show object hierarchy
88
81
  test_files: []
82
+ has_rdoc:
data/example/test.rb DELETED
@@ -1,5 +0,0 @@
1
- a = ObjectSpace.each_object(Class).to_a
2
- require 'rails'
3
- b = ObjectSpace.each_object(Class).to_a
4
-
5
- puts (b - a)