Mega Code Archive

 
Categories / Ruby / File Directory
 

Dir with patterns

Dir['*.data']       # Files with the "data" extension Dir['ruby.*']       # Any filename beginning with "ruby." Dir['?']            # Any single-character filename Dir['*.[ch]']       # Any file that ends with .c or .h Dir['*.{java,rb}']  # Any file that ends with .java or .rb Dir['*/*.rb']       # Any Ruby program in any direct sub-directory Dir['**/*.rb']      # Any Ruby program in any descendant directory