Class: Xumlidot::DirectoryTree
- Inherits:
-
Object
- Object
- Xumlidot::DirectoryTree
- Defined in:
- lib/xumlidot/directory_tree.rb
Overview
Recurse down a directory tree
Instance Method Summary collapse
- #find_all_rb_files(&block) ⇒ Object
-
#initialize(directories, options) ⇒ DirectoryTree
constructor
A new instance of DirectoryTree.
Constructor Details
#initialize(directories, options) ⇒ DirectoryTree
Returns a new instance of DirectoryTree.
6 7 8 9 10 |
# File 'lib/xumlidot/directory_tree.rb', line 6 def initialize(directories, ) @directories = directories @options = @excluded = Regexp.new(@options.exclude) end |
Instance Method Details
#find_all_rb_files(&block) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/xumlidot/directory_tree.rb', line 12 def find_all_rb_files(&block) @directories.each do |directory| Find.find(directory) do |path| next if path =~ @exluded next unless path.end_with? '.rb' yield path if block_given? end end end |