Bug #3585

Updated by jeremyevans0 (Jeremy Evans) 6 months ago


When I run this code:

t = { sleep 3 } { sleep 2; t.kill; p 'hi!' }

I would expect `"hi!"` to be printed once. But, when I put the code in a file and run it with `ruby somefile.rb`, `"hi!"` gets printed twice. This does not happen if I just type `ruby` and paste the code in and press Control-D. I posted a question on StackOverflow about it ( ). The person who commented said that they got it too. My `ruby -v` is `ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-darwin10]`, and the other person who experienced it said that they have `ruby 1.9.3dev (2010-07-19 trunk 28679) [x86_64-darwin10.4.0]`.