i found a bug in version 0.2.2: if you call #siblings without a block, you get
an error:
/usr/local/lib/ruby/gems/1.8/gems/rubytree-0.2.2/lib/tree.rb:223:in
`siblings': undefined method `children' for nil:NilClass (NoMethodError)
it's because you call #parent, which isn't defined. i fixed the bug for me by
putting
return [self] if isRoot?
in line 221 in #siblings
i guess there's a more clever way to fix it. what about you? ;-) |