Dir.glob('*') { |file| puts file }


Dir.glob( File.join('/foo/bar', '*') ) { |file| puts file }


def file_match(pattern=/\.txt/, path='.')
  Dir[File.join(path,'*')].each do |file|
    puts file if file =~ pattern
  end
end