Created
October 25, 2016 14:57
-
-
Save skylerto/72b14cb011d2c48ee770da58d1996a24 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Util | |
class << self | |
def first_line file_name | |
File.open(file_name, 'r') do |f| | |
p f.gets | |
end | |
rescue Errno::ENOENT => ex | |
"Do the file creation: #{ex.to_s}" | |
end | |
end | |
end | |
Util.first_line 'version.txt' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment