Skip to content

Instantly share code, notes, and snippets.

@biske
Created December 19, 2013 21:21
Show Gist options
  • Save biske/8046459 to your computer and use it in GitHub Desktop.
Save biske/8046459 to your computer and use it in GitHub Desktop.
def open_user_file
print "File to open: "
filename = gets.chomp
fh = File.open filename
yield fh
fn.close
rescue
puts "Couldn't open your file!"
end
open_user_file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment