Sha256: c9c3119ba89318ff905ce6532ac76720478a39155ecc204fbea46ac9965043be

Contents?: true

Size: 435 Bytes

Versions: 3

Compression:

Stored size: 435 Bytes

Contents

# -*- coding: utf-8 -*-
cwd = File.expand_path( File.join( File.dirname(__FILE__), '..', '..', 'lib') )
$:.unshift(cwd) unless $:.include?(cwd)
require 'tree_rb'
include TreeRb

class MyVisitor < BasicTreeNodeVisitor
  def visit_leaf( pathname )
    puts "found: #{pathname}"
  end
end

dtw = DirTreeWalker.new( File.join(File.dirname(__FILE__), '..', '..') )
dtw.match 'leaf_node.rb'
dtw.match 'abs_node.rb'
dtw.run( MyVisitor.new )

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
tree.rb-0.3.13 examples/ruby_examples/find_files.rb
tree.rb-0.3.12 examples/ruby_examples/find_files.rb
tree.rb-0.3.11 examples/ruby_examples/find_files.rb