To catch it and execute code we use:
Kernel.trap('INT') { code }
Remember to call Kernel.exit if you want to terminate the execution of your ruby script. Kernel.trap can also catch other signals. For more information visit: Kernel.trap
Please don't interrupt. Just sit back and listen.
Kernel.trap('INT') { code }
No comments:
Post a Comment