# part of rwdtinker smalllinux@gmail.com # copyleft gpl 2008 Steven Gibson require 'lib/rwdtinker/rwdtinkertools' tmpmodload = ' def RwdtinkerTools.findfilesp(d) a = Array.new(Dir[d].entries.sort) #loop through and get the files names a.each do |x| #adjust the filters to the files you want to see... if(!test(?d,x)) # only rwd files if x =~ /rb|rwd|txt/ fileA=File.open("#{x}","r") #opens the file thats in fileName as read only @@tempdoc+=fileA.read #reads the file into the doc string fileA.close end end end end def RwdtinkerTools.findprogramfiles(codedir, specificdir = "") @@tempdoc = "" #get a list of the files and subdirectories on the starting directory only a = Array.new(Dir[codedir].entries.sort) #loop through the list, ignore the files and add all new directories found a.each do |x| #if a directory... if(test(?d,x)) # add to the original list of directories @@root = x + "/**" #adds the new ones to the array b = Dir[@@root].entries.sort b.each do |x| if(test(?d,x)) a.push(x) #appends to the end of the array... end end end end a.each do |x| #if it is a file... if(!test(?d,x)) a.delete(x) else #it is a directory... findfilesp(x + "/**") end end return @@tempdoc end ' RwdtinkerTools.module_eval(tmpmodload)