gf-treevisitor 0.0.15 → 0.0.16

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.15
1
+ 0.0.16
data/lib/treevisitor.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class TreeVisitor
2
- VERSION = '0.0.15'
2
+ VERSION = '0.0.16'
3
3
  end
@@ -50,7 +50,8 @@ class AbsNode
50
50
  def invalidate
51
51
  @path = nil
52
52
  @path_with_prefix = nil
53
- @depth = nil
53
+ @depth = nil
54
+ @root = nil
54
55
  end
55
56
 
56
57
  def prefix_path
@@ -71,11 +72,8 @@ class AbsNode
71
72
  end
72
73
 
73
74
  def root
74
- if root?
75
- self
76
- else
77
- parent.root
78
- end
75
+ return @root if @root
76
+ @root = parent.nil? ? self : parent.root
79
77
  end
80
78
 
81
79
  def path
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gf-treevisitor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.15
4
+ version: 0.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - gf
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-06-09 00:00:00 -07:00
12
+ date: 2009-06-14 00:00:00 -07:00
13
13
  default_executable: tree.rb
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency