jeff
December 13, 2005, 4:57am
1
I’m learning to write ruby code, and I’m using 1.8.2 on Windows XP.
What is the best way to exit from my .rb script?
I’m using Process.exit but the documentation implies that it will throw
an exception. So I’m guessing there’s a “cleaner” way to exit?
For example:
test.rb
if ARGV.length == 0
puts “Please specify a filename”
Process.exit
end
script continues here…
Thanks!
Jeff
jeff
December 13, 2005, 6:54am
2
Jeff C. wrote:
I’m learning to write ruby code, and I’m using 1.8.2 on Windows XP.
What is the best way to exit from my .rb script?
I’m using Process.exit but the documentation implies that it will throw
an exception. So I’m guessing there’s a “cleaner” way to exit?
just to save you 3.5 seconds of searching, it’s Kernel.exit and exit!
we’re talking about in the docs.
jeff
December 13, 2005, 6:30pm
3
Gene T. wrote:
just to save you 3.5 seconds of searching, it’s Kernel.exit and exit!
we’re talking about in the docs.
Will this actually work if a Thread (unjoined) does it?
Should experiment before asking, but I am in the middle of something
else
Cheers,
V.-
–
http://www.braveworld.net/riva