slagyr / statemachine

Ruby Library for statemachines
http://slagyr.github.com/statemachine
Other
41 stars 9 forks source link

One minor enhancement and some rdoc fixes #5

Closed chuckremes closed 13 years ago

chuckremes commented 13 years ago

I added the ability to name a statemachine. This is useful when a program has multiple machines running simultaneously and tracing is turned on for all of them. If any machines have the same or similar events, it gets quite hard to determine which machine printed which details.

Also, I clarified some rdoc. The docs for Statebuilder#event did not specify that the 3rd arg (the action) actually runs under the original state and not the new state that the event is transitioning into.

slagyr commented 13 years ago

Hey Chuck,

Thanks for the patch! Named statemachines is a great addition. There were no tests for you change (nor the tracing feature) so I added a couple tests. But you code has been merged and version 1.2.0 released.

Micah

On Jun 15, 2011, at 6:08 PM, chuckremes wrote:

I added the ability to name a statemachine. This is useful when a program has multiple machines running simultaneously and tracing is turned on for all of them. If any machines have the same or similar events, it gets quite hard to determine which machine printed which details.

Also, I clarified some rdoc. The docs for Statebuilder#event did not specify that the 3rd arg (the action) actually runs under the original state and not the new state that the event is transitioning into.

Reply to this email directly or view it on GitHub: https://github.com/slagyr/statemachine/pull/5

chuckremes commented 13 years ago

Ah, yes, I did forget tests now didn't I?

Future pull requests will include specs.