This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

A little documentation

  • Loading branch information...
1 parent 47ab534 commit 4626c59c8a7dc60d7c4831b0ff8e32c4c1096fb7 Joe Ferris and Mike Burns committed with jferris Aug 3, 2012
Showing with 21 additions and 7 deletions.
  1. +20 −6 README.md
  2. +1 −1 turning.gemspec
View
@@ -1,6 +1,24 @@
# Turning
-TODO: Write a gem description
+A tiny framework to render views whenever data changes rather than re-rendering on every visit.
+
+## Usage
+
+Create a listener:
+
+ # app/listeners/products_listener.rb
+ class ProductsListener < Turning::Listener
+ def listen
+ Product.on(:save) do |product|
+ render 'show', product_path(product), product: product
+ end
+ end
+ end
+
+Whenever a `Product` is saved, it will render the
+`app/views/products/show.html.erb` view and save it in `public/static`. A Rack
+middleware is included and autoconfigured to serve static pages from that
+directory.
## Installation
@@ -16,14 +34,10 @@ Or install it yourself as:
$ gem install turning
-## Usage
-
-TODO: Write usage instructions here
-
## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
-5. Create new Pull Request
+5. Create new pull request
View
@@ -5,7 +5,7 @@ Gem::Specification.new do |gem|
gem.authors = ["Joe Ferris"]
gem.email = ["jferris@thoughtbot.com"]
gem.description = %q{The wheels in the sky keep on turning}
- gem.summary = %q{Wheels keep on spinning round, spinning round, spinning round}
+ gem.summary = %q{A tiny framework to render views whenever data changes rather than re-rendering on every visit.}
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
gem.files = `git ls-files`.split("\n")

0 comments on commit 4626c59

Please sign in to comment.