Created
October 25, 2016 14:56
-
-
Save skylerto/7e411abb78641757265b47af5e899dd0 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 | |
handle_error(ex) | |
end | |
def handle_error ex | |
p "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