Skip to content

Instantly share code, notes, and snippets.

@bricker
Created February 21, 2015 00:49
Show Gist options
  • Save bricker/c8640d7d86dc1c9a530d to your computer and use it in GitHub Desktop.
Save bricker/c8640d7d86dc1c9a530d to your computer and use it in GitHub Desktop.
(1..5).each do |i|
f = File.open("somefile#{i}.txt")
begin
do_stuff_with(f)
rescue
next
ensure
f.close
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment