Class: Dir

Inherits:
Object show all
Defined in:
ext/fipdf/test/suite.rb

Overview

TestSuite – fipdf – 19.02.2004 – [email protected]

Class Method Summary collapse

Class Method Details

.recursive(dirpath, parent = dirpath, &block) ⇒ Object



5
6
7
8
9
10
11
12
13
14
# File 'ext/fipdf/test/suite.rb', line 5

def Dir.recursive(dirpath, parent=dirpath, &block)
	foreach(dirpath) { |item|
		path = File.expand_path(item, parent)
		if(!/^\.{1,2}$/.match(item) && File.ftype(path) == 'directory')
			recursive(File.expand_path(item, dirpath), path, &block)
		else
			block.call(path)
		end
	}
end