如何告诉Ruby程序关闭自己

时间:2015-05-19 23:42:55

标签: ruby console-application exit

是否有ruby命令告诉ruby脚本自行关闭?我想要做的是:说我正在运行ruby.rb

print "What would you like to do next?"
next=gets.chomp   
next.downcase!
if next=="close"
    #this is where i want to be able to tell the program to close itself.
end

有没有办法做到这一点,如果有,那是什么?

1 个答案:

答案 0 :(得分:4)