Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class FilesReader
- def initialize(files)
- @files = files
- end
- def read
- contents = {}
- @files.each do |f|
- contents[f] = {content:File.open(f).read}
- rescue Errno::ENOENT
- puts "--- File #{f} not found, skipping."
- end
- contents
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement