If you are using ruby-1.8.6, you may have noticed a bug where exit
always
returns 0 when called from within an at_exit block. You can test this
on your
machine with the following little snippet:
ruby -e ‘at_exit { exit(1) }’ ; echo $?
The result should be ‘1’, but ruby-1.8.6 will return ‘0’.
To workaround this when using commandline, you can change an application
that reads like:
require ‘rubygems’
require ‘commandline’
class App < CommandLine::Application
end
to
require ‘rubygems’
require ‘commandline’
class App < CommandLine::Application_wo_AutoRun
end
App.run
This will not use the at_exit technique of self launching the app and
give the correct
exit code.
If you are using ruby-1.8.6, you may have noticed a bug where exit always
returns 0 when called from within an at_exit block. You can test this on your
machine with the following little snippet:
ruby -e ‘at_exit { exit(1) }’ ; echo $?
The result should be ‘1’, but ruby-1.8.6 will return ‘0’.
wow. i rely on that combination in a few places, in particular i
dis-inherit
exit
handlers in child processes by doing this as the first line
It’s a bug. Already fixed in 1.9, but I haven’t heard anything about
applying the fix to 1.8 branch yet. Which is unfortunate, as it breaks
quite
a few things.
It’s a bug. Already fixed in 1.9, but I haven’t heard anything about
applying the fix to 1.8 branch yet. Which is unfortunate, as it breaks quite
a few things.
Is there any prospect of patch release soon? I just had to write
something
like: “Prerequisites: Ruby 1.8.4 or 1.8.5 (but there is a known bug in
1.8.6)”
in CruiseControl.rb 1.1 release documentation. This just doesn’t look
good…
At Sat, 31 Mar 2007 02:02:11 +0900,
Alexey V. wrote in [ruby-talk:246032]:
It’s a bug. Already fixed in 1.9, but I haven’t heard anything about
applying the fix to 1.8 branch yet. Which is unfortunate, as it breaks quite
a few things.
It was fixed in 1.8, and doesn’t exist in 1.9.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.