Sha256: 6f60056569db510b6d55f897429ed3ce446c809d0bbaf6f80b7b5b0f73c0ca2d
Contents?: true
Size: 1.92 KB
Versions: 6
Compression:
Stored size: 1.92 KB
Contents
# this code is to list the links def fillhypergutenbergname(inffile) @a_newfilegutenberg = inffile end def findgutenbergfiles(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 lnk files if x =~ /rb|txt|lst/ puts "#{x}" #opens the file thats in fileName as read only $gutenbergarray = $gutenbergarray | ["#{x}"] end end end end def rwdgutenbergfiles $gutenbergarray = [""] startlangdir = @a_searchdirectorygutenberg puts startlangdir #get a list of the files and subdirectories on the starting directory only agutenbergarray = Array.new(Dir[startlangdir].entries.sort) p agutenbergarray #loop through the list, ignore the files and add all new directories found agutenbergarray.each do |x| #if a directory... if(test(?d,x)) # add to the original list of directories @@tmproot = x + "/**" puts @@tmproot #adds the new ones to the array bgutenbergarray = Dir[@@tmproot].entries.sort p bgutenbergarray bgutenbergarray.each do |x| p x if(test(?d,x)) agutenbergarray.push(x) #appends to the end of the array... p agutenbergarray end end end end agutenbergarray.each do |x| #if it is a file... if(!test(?d,x)) agutenbergarray.delete(x) else #it is a directory... findgutenbergfiles(x + "/**") end end @textsfilesrecordsresult = $gutenbergarray.rwd_method("fillhypergutenbergname") end
Version data entries
6 entries across 6 versions & 2 rubygems