I'm trying to get the return value of a ruby script in cmd.exe. The ruby script will return -1 if exception is caught and 0 if success.
rescue Exception => ex
puts ex.message
returnvalue = -1
else
returnvalue = 0
ensure
puts returnvalue
in the cmd batch, calling the script using ruby.exe
ruby tt.rb 1 %1
But I'm not able to retreive the returnvalue in the cmd batch file (e.g. using %errorlevel%). Is there any way to do this?
thanks!