It is just a directory structure, a simple rake script, and several adjustable settings melted together for the sake of your convenience.
In this project you can use coffeescript, sass, erb, or any other tools supported by the Tilt gem. The Sprockets directives in your css and js files enable you to decompose your scripts into separate files, which will be concatenated and minified into one file during the build process.
If you add
alias server='python -m SimpleHTTPServer'
to your bash alieses you can run a server in the project's root directory using the
command in your terminal. This enables you to work on your ajaxified project without using any other, heavier web servers during the development process.
You can set your own directory paths, and filenames in the Rakefile, and then run
on the command-line. This command will create the BUILD_DIR directory, and copy/compile the files from your SOURCE_DIR, if any.
BUNDLES = %w( app.css app.js )
The bundles are your output files. You can invoke them inside the main html page. Every other css/js files will be concatenated to them, and then the generated output will be minified, too.
BUILD_DIR = ROOT.join("public")
The directory in which the built files resides.
SOURCE_DIR = ROOT.join("src")
The directory contains your source files, you will work in this.
STATIC_DIRS = %w( images )
All directories within the source dir that you want to copy only to the build dir without compiling.
TEMPLATES = SOURCE_DIR.join("templates")
All the html and js template files. They will be compiled and copied to the build dir. The process preserves the directory structure.
Every other files within the root of the source directory will be copied w/o compiling to the build dir. The compilation is the function of the file extensions. If the file ends in one or more extension processable by Tilt then it will be compiled, otherwise just copied, to the build dir.
env.css_compressor = YUI::CssCompressor.new(line_break: 0) env.js_compressor = Uglifier.new(mangle: true, max_line_length: 80, copyright: false)
# TODO: write about the templating
The build process is very simple. You just issue the command:
and (hopefully) everything works as a charm. :)
This command removes everything from your build directory, and then copy/compile the files from the SOURCE_DIR.
command will build your project and run the tests lives in the "test" folder.
# TODO: write about the deployment process
# TODO: write about the deployment settings
None. Fork it, and do what you want. Good luck!