Looking for the best way to exit a loaded script in Ruby on Rails's IRB. Kernel.exit & Kernel.abort will pop you out of the IRB session altogether. Ideally, this would happen on some conditional criteria.
My script/my_script.rb:
puts "My Script is running!"
# if some criteria, stop execution of this script without stoping IRB
puts "This will never happen"
Ideal results:
$ rails console
irb(main):001:0> load 'script/my_script.rb'
My Script is running!
irb(main):002:0>