def glob_contents(pattern) contents = {} Dir.glob(pattern).each { |name| contents[name] = File.read(name) } contents end