SproutCore (Ember.js) Statechart
This is a port of the SproutCore Statechart library from the SproutCore 1.x framework for use in SproutCore 2.0 (Ember.js) applications. It was principally authored by Michael Cohen (aka. FrozenCanuck).
TODO: Add documentation to the README.
For the time being, there are plenty of examples in the source code, and example usage throughout the extensive unit tests.
Learning by Example
We are working hard to provide more documentation and examples for Ember.js and here specifically for the statechart framework. Until there is more, you can learn from this example:
You need ruby and some gems to build the source code and to run unit tests.
Install Ruby 1.9.2+. There are many resources on the web can help; one of the best is rvm.
gem install bundler
bundleinside the project root to install the gem dependencies.
raketo build sproutcore-statechart.js. Two builds will be placed in the
sproutcore-statechart.min.js- unminified and minified builds of sproutcore-statechart.js
minification. You can either install nodejs or
Running / Writing Unit Tests:
The repository has been refactored to use the same structure as the Ember.js project:
To start the development server, run
bundle exec rackup.
You can also pass
jquery=VERSION in the test URL to test different versions of jQuery. Default is 1.7.1.
Features / Problems:
stateObserves()helper does not properly work with global paths. These problems are captured in the unit tests
- There are a few fixes for bugs that are in the SproutCore 1.x version that have not been ported over as of yet.
- The Unit Tests for route triggered are failing at the moment, but it works -> needs to be fixed!
If you run into a problem, please file an issue on this repository.
In order to use the Statechart package, you'll need two libraries:
These dependencies are automatically installed if you're using BPM. If you want to download and use the JS file (and assuming you're already using SproutCore 2.0), don't forget to grab the built version of the Utils package.
You can also simply include a built version of Ember.js before ember-statechart.js
bpm add sproutcore-statechart
And this will handle adding all of its dependencies as well. You, of course, need to be using BPM for your application or package for this to work ;)