J
Jim Freeze
Hello
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.
Jim
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.
Jim