moduledocumentation and examples moved to the wiki.
- See the Docco annotated source code located in the docs directory.
- Utilize the patterns and best practices docs in the TechRabbit Blog
Methods Exposed by Module and Their Corresponding Wiki Page
- delegate(role, method)
- construct([el][, data])
- base(methodName[, args...])
- set(key, value)
- setPath(path, value)
- addChild(child, name)
Modules Residing in 'Extras'
- template(string, data, scope)
specRunner.html file in
root runs each individual module's specs. Load it as a file in your browser of
choice or, if you have Node.js installed you can
npm install node-static then
node staticServer.js which will
serve the spec runner at
localhost:5678/specRunner.html. This is useful, for me at least, for x-platform
testing as I can just point virtual machines at the host. Note that individual spec files can be run from here as well, just
adjust the path accordingly. The
sudo.Base module for example could be run at
Also note that the
lib/jquery folder in no way indicates a dependency on that particular version of
is there simply so I can run tests offline (which I usually write while riding Caltrain [no wifi]).
A rather opinionated gem is available here. More than just making sudo builds (sudo and sudo-x) available for your rails apps it enforces a rather unique workflow. More info there...
A simplified version of
sudo.js is available for Node:
npm install sudoclass
sudo.js style inheritance, key-value coding (the
sudo.js Base Object), delegation, and data-mutation-observation via
Observable extension. The
sudo.js build tool is built with this.
The latest concatonated (but unminified) version of
sudo-x.js [sudo.js with added stuff]) is always
build/debug. If you are making changes, adding new modules, or creating a custom build and need the
files to be rebuilt
cd into the
build/lib directory and run:
node run.js [0.x.x] [sudo.html] [sudo-x.html] [foo.html] ...
Note that the
foo.html above would represent an HTML configuration file you created for a custom build of sudo.js.
You will need
Node.js installed as well as the
sudoclass module mentioned above. The arguments that follow the invocation of
run.js are a version number and the html files that the build tool uses to load the 'modules'. If you are adding new 'modules'
be sure to add them to sudo.html (and/or the sudo-x.html) config file or they will not be added to the concatonated
-x debug version,
build/debug/sudo-x.js, simply contains the 'modules' located in the
extras directory that have been
tested and documented. They do not belong in core but provide added functionality that some may find useful.