README.md in classy_assets-0.0.1 vs README.md in classy_assets-0.0.2
- old
+ new
@@ -1,25 +1,69 @@
# ClassyAssets
-TODO: Write a gem description
+Classy Assets (powered by Sprockets) for Sinatra and Rack apps
## Installation
Add this line to your application's Gemfile:
- gem 'classy_assets'
+ gem 'classy_assets', require: 'false'
And then execute:
$ bundle
-Or install it yourself as:
+## Usage
- $ gem install classy_assets
+ClassyAssets is available as Rack Middleware or a Sintra Extension. The Sinatra Extension version integrates the [sprockets-helpers](https://github.com/petebrowne/sprockets-helpers) to provide helper methods for generating asset paths.
-## Usage
+Use the Rack Middleware directly:
-TODO: Write usage instructions here
+````ruby
+require 'rack/classy_assets'
+class ClassyApp < Sinatra::Base
+ use Rack::ClassyAssets, root: 'path/to/your/app/root/directory'
+end
+````
+
+Use the Sinatra Extension:
+
+````ruby
+require 'sinatra/classy_assets'
+class ClassyApp < Sinatra::Base
+ register Sinatra::ClassyAssets
+end
+````
+
+Both the middleware and extension assume your assets are stored in the `root` directory, in the following layout:
+
+ /assets
+ |_ images
+ |_ stylesheets
+ |_ javascripts
+
+Sass and CoffeeScript are fully supported.
+
+Available Options:
+
+Pass these in via the options hash if you're using the rack middleware.
+If you're using the sinatra extension, then configure your app's `settings` after the `register Sintra::ClassyAssets` statement to override the defaults
+
+````ruby
+ :root # => path to root of the application. set by default in Sinatra apps, but must be explictly passed to the rack middleware, if used directly
+ :public_folder # => path to public folder for the application. (default: File.join(root, 'public') )
+ :assets_prefix # => currently does nothing useful (default: 'assets')
+ :asset_host # => used by Sprockets::Helpers to return asset path prefixed by asset_host uri (default: nil)
+ :digest_assets # => enable digest version of assets? true or false (default: false)
+ :css_compressor # => instance of a sprokets compatible css compressor class (default: ::YUI::CssCompressor.new)
+ :js_compressor # => instance of a sprokets compatible js compressor class (default: ::Uglifier.new)
+ :sprockets # => instance of Sprockets::Environment. Should almost never need to be set manually. (default: Sprockets::Environment.new(root) )
+````
+## Project Status
+
+- Build: [](https://travis-ci.org/styleseek/classy_assets)
+- Code Quality: [](https://codeclimate.com/github/styleseek/classy_assets)
+- Dependencies: [](https://gemnasium.com/styleseek/classy_assets)
## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)