Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update readme to reference using rake tasks with rails 2

  • Loading branch information...
commit 0d85a193da9c82351a550f93a2f42a1eaa69ef43 1 parent eb72629
@brainopia brainopia authored
Showing with 9 additions and 3 deletions.
  1. +9 −3 README.md
View
12 README.md
@@ -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](https://github.com/Sutto/barista/blob/master/lib/generators/barista/install/templates/initializer.rb) 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 `config.ru` 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.setup_defaults
barista_config = root + '/barista_config.rb'
require barista_config if File.exist?(barista_config)
-
+
Hence, if you'e using, for example, [serve](https://github.com/jlong/serve) users should have a `config.ru` that looks similar to [this example](https://github.com/YouthTree/site-design/blob/master/config.ru).
### A Quick Note on the JSON Gem
Please sign in to comment.
Something went wrong with that request. Please try again.