Permalink
Browse files

Update README.

  • Loading branch information...
1 parent 4d65aef commit dd3c1190d3e096e15e583a28b5b804e68f0fb953 @jcoglan committed Apr 7, 2012
Showing with 22 additions and 28 deletions.
  1. +22 −28 README.rdoc
View
@@ -1,27 +1,14 @@
= Jake
-* http://github.com/jcoglan/jake
+Jake is a command-line line tool for building JavaScript packages from source
+code. It's basically a thin wrapper around {Packr}[http://rubygems.org/gems/packr]
+that lets you easily configure builds for multiple packages with different
+compression settings, using a simple YAML config file.
-Jake is a command line tool for building JavaScript packages from source code.
-Using simple YAML config files, you can specify any number of build files to be
-generated by concatenating and minifying groups of source files. It allows ERB
-to be used inside source files to generate code, and provides event hooks into
-the build process so you can extend it for your own needs.
-
-
-== Features
-
-* Concatenate and minify groups of source files for distribution
-* Configured using simple YAML files
-* Easily generate multiple distros with different compression settings
-* Use ERB templating to generate source code
-* Extensible using Ruby/ERB and event hooks during the build process
-* Tested on Ruby 1.8.6, 1.8.7, 1.9.1
-
-
-== Installation
-
- sudo gem install jake
+It supports all the same compression settings as Packr, including generation of
+{source maps}[http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/]
+for your package files. You can also use ERB in your source files to generate
+code.
== Usage
@@ -40,7 +27,7 @@ like this:
builds:
src:
- packer: false
+ minify: false
min:
shrink_vars: true
private: true
@@ -74,19 +61,26 @@ You can have as many builds as you like and the names are up to you. I'm using
+src+ and +min+ as readily understood examples. Each build may specify some
combination of the following options:
-* <tt>packer: false</tt> - disables minification for this build. This precludes
+* <tt>minify: false</tt> -- Disables minification for this build. This precludes
use of further minification options.
-* <tt>shrink_vars: true</tt> - tells the minifier to compress local variable
+* <tt>shrink_vars: true</tt> -- Tells the minifier to compress local variable
names inside functions.
-* <tt>private: true</tt> - tells the minifier to obfuscate 'private' variables
+* <tt>private: true</tt> -- Tells the minifier to obfuscate 'private' variables
with numeric replacements. JavaScript convention is that any name beginning
with an underscore, e.g. <tt>_foo</tt> or <tt>obj._bar</tt> should be
considered private. They are replaced with <tt>_0</tt>, <tt>_1</tt>, etc.
-* <tt>base62: true</tt> - produces base-62 encoded minification.
-* <tt>suffix: false</tt> - files from this build should not have a suffix if
+* <tt>base62: true</tt> -- Produces base-62 encoded minification.
+* <tt>suffix: false</tt> -- Files from this build should not have a suffix if
using the +together+ layout, so you get <tt>build/foo.js</tt> rather than
<tt>build/foo-src.js</tt>, for example. Only one build may use this option,
otherwise file name clashes will occur.
+* <tt>source_map: $build_name</tt> -- Generates a source map for each file in
+ this build, relative to a corresponding file in <tt>$build_name</tt>. For
+ example, a <tt>min</tt> build with <tt>source_map: src</tt> will produce a
+ files <tt>foo-min.js</tt> and <tt>foo-min.js.map</tt> where the source map
+ refers to locations in <tt>foo-src</tt>. You can make the source map relative
+ to the original source code by setting <tt>:source</tt> as the value of
+ <tt>$build_name</tt>.
=== Package listing
@@ -141,7 +135,7 @@ The full list of package options is as follows:
* +header+ - a custom header file to use on this package. Overrides the root
+header+ option. May be omitted.
* +packer+ - lists minification settings that override settings being used for
- the current build. If a build listed above uses <tt>packer: false</tt>, this
+ the current build. If a build listed above uses <tt>minify: false</tt>, this
takes precedence over package-specific instructions. Typically used to
override options for the minified build.
* +meta+ - should be a YAML dictionary containing arbitrary data useful to

0 comments on commit dd3c119

Please sign in to comment.