Browse files

Update readme to reference using rake tasks with rails 2

  • Loading branch information...
brainopia committed Jun 9, 2011
1 parent eb72629 commit 0d85a193da9c82351a550f93a2f42a1eaa69ef43
Showing with 9 additions and 3 deletions.
  1. +9 −3
@@ -36,11 +36,17 @@ Much like on Rails 3, Barista supports deep integration into Rails 2. The only t
gem "json" # Only needed if on Ruby 1.8 / a platform that ships without JSON
gem "barista"
To your `Gemfile`. If you're not using bundler, doing `gem install json barista` and requiring barista both in your application should be enough to get you started.
If you wish to change the barista configuration, take a look at the [Rails 3 initializer]( and modify it to suite your application as needed.
+If you wish to use barista tasks with rails 2 project, add
+ require "barista/tasks"
+To your `Rakefile`.
### Sinatra
Adding Barista to a Sinatra application is a relatively straight forward affair. Like in Rails 2 and Rails 3, you first need to add and require the barista gem and (optionally, the json gem). Unlike Rails 2 and 3 (which set it up automatically), you must also register the extension in your application. So, in the scope of your app (either the top level scope or the `Sinatra::Application` subclass you're using), you then need to simple add:
@@ -62,7 +68,7 @@ For example, your `` may look like:
use Barista::Filter if Barista.add_filter?
use Barista::Server::Proxy
run MyRackApplication
Next, you need to configure barista anywhere before your the above code is run. e.g by adding the following immediatly preceeding it:
# Barista (for CoffeeScript Support)
@@ -71,7 +77,7 @@ Next, you need to configure barista anywhere before your the above code is run.
barista_config = root + '/barista_config.rb'
require barista_config if File.exist?(barista_config)
Hence, if you'e using, for example, [serve]( users should have a `` that looks similar to [this example](
### A Quick Note on the JSON Gem

0 comments on commit 0d85a19

Please sign in to comment.