README.md in barista-0.5.1 vs README.md in barista-0.6.0

- old
+ new

@@ -1,7 +1,11 @@ # Barista # +Barista is a rails plugin that transparently compiles CoffeeScript to JavaScript. When a `.coffee` file is changed and the page is refreshed, it delays sending the `.js` file until it's been regenerated from the newly modified CoffeeScript. This way, you can refresh immediately after saving the `.coffee` file, and not worry about an old `.js` file being sent to the browser (as often happens when using `coffee --watch`). + +Barista supports using `therubyracer` when installed or, by default, the node.js version of CoffeeScript via the `coffee` executable. + Barista is very, very similar to [bistro\_car](http://github.com/jnicklas/bistro_car) (infact, credit where credit is due - it shares similar code / is almost a fork). The main difference being, it lets you use coffee as you would javascript. Simply put, Write coffee and place it in `app/coffeescripts` and Barista will automatically serve it as if it was placed in `public/javascripts` @@ -25,13 +29,13 @@ Barista require rails 3+ (but patches for Rails 2 will be accepted.) ## Frameworks ## -One of the other main features Barista adds (over bistro\_car) is frameworks similar -to Compass. The idea being, you add coffeescripts at runtime from gems etc. To do this, -in your gem just have a coffeescript directory and then in you gem add the following code: +One of the other main features Barista adds (over other tools) is frameworks similar +to Compass. The idea being, you add coffee scripts at runtime from gems etc. To do this, +in your gem just have a `coffeescript` directory and then in you gem add the following code: Barista::Framework.register 'name', 'full-path-to-directory' if defined?(Barista::Framework) For an example of this in practice, check out [bhm-google-maps](http://github.com/YouthTree/bhm-google-maps) or, the currently-in-development, [shuriken](http://github.com/Sutto/shuriken). The biggest advantage of this @@ -81,27 +85,49 @@ ## Configuration ## Please note that barista lets you configure several options. To do this, it's as simple as setting up an initializer with: - rails generate barista_install + rails generate barista:install Then editing `config/initializers/barista_config.rb`. Currently available options are: -* root - the folder path to read coffeescripts from, defaults to app/coffeescripts -* output\_root - the folder to write them into, defautls to public/javascripts. -* no\_wrap - stop coffee from automatically wrapping JS in a closure. -* change\_output\_prefix! - method to change the output prefix for a framework. +* `root` - the folder path to read coffeescripts from, defaults to app/coffeescripts +* `output_root` - the folder to write them into, defaults to public/javascripts. +* `no_wrap` and `bare` - stop coffee from automatically wrapping JS in a closure. +* `change_output_prefix!` - method to change the output prefix for a framework. +* All of the hooks mentioned above. +* `verbose` - whether or not barista will add a preamble to files. +* `compiler` - One of `:native` or `:node`, to force the compiler version. +* `compiler_klass` - A custom compiler class. +* `js_path` - Path to the pure-javascript compiler +# Contributors / Credits + +The following people have all contributed to Barista: + +* [Xavier Shay](https://github.com/xaviershay) - Added preamble text to generated text in verbose mode. +* [einarmagnus](https://github.com/einarmagnus) - Fixed jruby support. +* [Matt Dean](https://github.com/trabian) - Added `before_full_compilation` and `on_compilation_complete` hooks. +* [Trevor Burnham](https://github.com/TrevorBurnham) - Misc. documentation tweaks and hooks idea. +* [Sean McCullough](https://github.com/mcculloughsean) - Initial switch to support bare (vs. no\_wrap) +* [Ben Atkin](https://github.com/benatkin) - Docs work. + +Barista was originally heavily inspired by [Bistro Car](https://github.com/jnicklas/bistro_car), but taking a fundamentally +different approach in a few areas. + +The Native JavaScript compiler was heavily inspired by and based on [Sam Stephenson's](https://github.com/sstephenson) fork of +the ruby-coffee-script gem. All credit for the idea goes to him and the code is based on his simple approach. + ## Note on Patches/Pull Requests ## 1. Fork the project. 2. Make your feature addition or bug fix. 3. Add tests for it. This is important so I don't break it in a future version unintentionally. 4. Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull) 5. Send me a pull request. Bonus points for topic branches. ## Copyright ## -Copyright (c) 2010 Darcy Laycock. See LICENSE for details. \ No newline at end of file +Copyright (c) 2010 Darcy Laycock. See LICENSE for details.