Advertisement
Guest User

Untitled

a guest
Apr 21st, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. class FilesReader
  2. def initialize(files)
  3. @files = files
  4. end
  5.  
  6. def read
  7. contents = {}
  8. @files.each do |f|
  9. contents[f] = {content:File.open(f).read}
  10. rescue Errno::ENOENT
  11. puts "--- File #{f} not found, skipping."
  12. end
  13. contents
  14. end
  15. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement