A command line build tool
Imagine you’re building the new twitter interface, capt is designed to build something like that.
Capt has been under development since November ‘10, but it’s still very alpha, expect things to be missing / broken.
Installation requires npm, then:
npm install capt
Some code generation
Try this out to get an idea of what you can do.
sudo npm install capt capt new project cd project capt generate model post capt generate controller posts capt server open http://localhost:3000/spec/ open http://localhost:3000/
You should get 7 passing tests and some stubs to work with.
Ignoring .js and .css directories
.css/ to your
.git/info/exclude file. This will ignore all the hidden .js and .css files that are generated by capt.
Create app structure
capt new project to create a project directory. Capt will creates the necessary files to get you up and running and will download the latest jQuery / backbone.
Compiles .jst templates
You specify what your static html is going to look like as a
.jst file, and capt will compile your index.html. You can include the following lines:
<%= project.stylesheetIncludes() %> <%= project.scriptIncludes() %>
Serves your app
You can start an node-powered webserver on port 3000 using:
Serves your jamine specs
By default your app will have a
/spec/ directory that includes jasmine and an index.jst. When you generate new models, capt will generate a stub spec in
/spec/models/. Run the specs by browsing to
Manages dependency order and autoloads
Specify files in
config.yml. The default config.yml looks like this:
Add files to each section to specify build order. Files will only be included once. For example: