Sha256: c63f15247a104bef2ed5e6922712005a9dba0cc8d96493c1c34fab5c71cb93b9
Contents?: true
Size: 562 Bytes
Versions: 1
Compression:
Stored size: 562 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 root_dir = '..' puts '*** print all files excluding "*.git" and "*.ini"' dtw = DirTreeWalker.new( :ignore => %w(.git .ini) ) dtw.run root_dir do on_leaf do |pathname| puts "- #{pathname}" end end puts '*** print files with extension *.sh" and "*.js"' dtw = DirTreeWalker.new( :match => /.sh/ ) dtw.run root_dir do on_leaf do |pathname| puts "- #{pathname}" end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
tree.rb-0.3.13 | examples/ruby_examples/print_files.rb |