Skip to content

Instantly share code, notes, and snippets.

@jimweirich
Created December 9, 2009 20:49
Show Gist options
  • Save jimweirich/252799 to your computer and use it in GitHub Desktop.
Save jimweirich/252799 to your computer and use it in GitHub Desktop.
def f(should_fail=false)
puts "BODY 1"
fail if should_fail
puts "BODY 2"
rescue StandardError => ex
puts "RESCUE"
else
puts "ELSE"
ensure
puts "ENSURE"
end
f(!ARGV.empty?)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment