Sha256: 306eec9e11282dfab7a9f10489f9d321032588700c00ddc6f7dbf540025f8e70

Contents?: true

Size: 1.89 KB

Versions: 2

Compression:

Stored size: 1.89 KB

Contents

# this code is to list the notes

def fillgutenbergnameh3(inffile)
  applet                = inffile
  @a_viewgutenberghtml  = applet
     tmpdirname = File.dirname(@a_viewgutenberghtml)
	      tmpext = File.extname(@a_viewgutenberghtml)
	      tmpfilename = File.basename(@a_viewgutenberghtml,"#{tmpext}")
	      newname = tmpfilename.to_s  + tmpext
	 @a_viewgutenberg  =  File.join(tmpdirname,newname)
  
end

 def findgutenbergfilesh(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 txt files
                  if x =~ /htm|html|pdf|pdb|gif|jpg|png|ps|chm|rwd|nam|sch|txt/
                  #  puts "#{x}"        #opens the file thats in fileName as read only
                   $saggutenbergarray  =  $saggutenbergarray  | ["#{x}"] 
                  end
               end
          end
  end
  
def listnotedirsgutenberg

if $temp_rwdgutenberg_directory.to_s.empty?
 startlangdir = $rwdgutenberg_directory
 else
 startlangdir = $temp_rwdgutenberg_directory
 end
 @rwdgutenberg_directory = startlangdir
 
 $saggutenbergarray = [""]
 
 #get a list of the files and subdirectories on the starting directory only
        anotearray = Array.new(Dir[startlangdir].entries.sort)
       
        #loop through the list, ignore the files and add all new directories found
        anotearray.each do |x|
                #if it is a file...
		
                if(!test(?d,x))
                        anotearray.delete(x)
                  else              #it is a directory...
                        findgutenbergfilesh(x + "/**")
                end
        end
      
         @gutenbergrecordsresulth = $saggutenbergarray.entries.sort.rwd_method("fillgutenbergnameh3")
      end  

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rwdgutenberg-0.12 code/superant.com.gutenberg/listnotedirshtml3.rb
rwdgutenberg-0.13 code/superant.com.gutenberg/listnotedirshtml3.rb