state_machine
https://github.com/pluginaweek/state_machine
Ruby
Adds support for creating state machines for attributes on any Ruby class
StateMachine::Transition#pausable
Runs a block that may get paused. If the block doesn't pause, then execution will continue as normal. If the block gets paused, then it will take care of switching the execution context when it's resumed. This will return true if the given block halts for a reason other than getting paused.
Edit
git clone [email protected]:pluginaweek/state_machine.git
cd state_machine
open lib/state_machine/transition.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-StateMachine--Transition-pausable-for-pr
# Commit to gitgit add lib/state_machine/transition.rbgit commit -m "better docs for StateMachine::Transition#pausable"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-StateMachine--Transition-pausable-for-pr
hub pull-request
# Celebrate!