Ruby Gems State Machine MicroMachine by Michel Martens This gem source code is 57-line small, yet powerful and capable.