DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

What Is Stronger ? Kill Or Rescue ?

04.21.2005
| 1334 views |
  • submit to reddit
        

begin
   Thread.current.kill
   exit(1)
   #`kill -9 #{$$}` # this will successfully kill you
   puts "after kill"
ensure
   puts "HA HA!"
end


always interesting to play with this kind of code.
and discover how much ensure means ENSURE !!!!

Ruby: Great Language.