如何告诉 Ruby 程序自行关闭
How to tell a Ruby program to close itself
是否有 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
有没有办法做到这一点,如果有,是什么?
是否有 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
有没有办法做到这一点,如果有,是什么?