(Little) Console Task Manager
My first ruby application. Simple console task manager with persistency. Nothing special dont be too harsh on my bad coding skills please 😛
This version has one bug, the application is fully functional but has a small bug ill get around to fixing
Code can be found here
Kill Messages on Ruby applications
Trying to get into ruby and i ran in to a somewhat important requirement. I need to know when my app is closing, wether it was me that shut it down or the OS just simply sent it a kill message. So i did some digging, made a fool of my self by posting to comp.lang.ruby and later on found the solution. Directly from the ruby documentation:
Converts block to a Proc object (and therefore binds it at the point of call) and registers it for execution when the program exits. If multiple handlers are registered, they are executed in reverse order of registration.
def do_at_exit(str1) at_exit { print str1 } end at_exit { puts "cruel world" } do_at_exit("goodbye ") exitproduces:
goodbye cruel world
For more info visit here