Advertisement
Guest User

Untitled

a guest
Oct 25th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. module Util
  2. class << self
  3. def first_line file_name
  4. File.open(file_name, 'r') do |f|
  5. p f.gets
  6. end
  7. rescue Errno::ENOENT => ex
  8. "Do the file creation: #{ex.to_s}"
  9. end
  10. end
  11. end
  12.  
  13. Util.first_line 'version.txt'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement