| CARVIEW |
mattly / rack-coffee
- Source
- Commits
- Network (2)
- Issues (0)
- Downloads (1)
- Wiki (1)
- Graphs
-
Branch:
master
click here to add a description
click here to add a homepage
-
Branches (1)
- master ✓
- Tags (1)
Pledgie Donations
Once activated, we'll place the following badge in your repository's detail box:
serve up coffeescript from rack middleware — Read more
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Thu Jan 28 23:17:32 -0800 2010 | 0.2 release [mattly] |
| |
Rakefile | Thu Jan 28 23:17:32 -0800 2010 | 0.2 release [mattly] |
| |
Readme.mkdn | Thu Jan 28 23:17:32 -0800 2010 | 0.2 release [mattly] |
| |
lib/ | Thu Jan 28 23:17:18 -0800 2010 | * Backwards Incompatible! Make :url parameter ... [mattly] |
| |
rack-coffee.gemspec | Thu Jan 28 23:17:32 -0800 2010 | 0.2 release [mattly] |
| |
test/ | Wed Jan 27 16:38:54 -0800 2010 | Make url arg act more like Rack::Static (aka. u... [binary42] |
rack-coffee
Simple rack middleware for serving up CoffeeScript files as compiled javascript.
Usage
The options behave similarly to Rack::Static:
require 'rack/coffee'
use Rack::Coffee, {
:root => '/path/to/directory/above/url', # defaults to Dir.pwd
:urls => '/javascipts' # defaults to '/javascripts'
}
By default, rack/coffee will use a Rack::File to serve any static assets found in this path; you may give :static => false to have misses pass through to your app.
For rails, presuming you've required 'rack/coffee' somehow, stick this in the Rails initializer config block:
config.middleware.use Rack::Coffee, :root => "#{RAILS_ROOT}/public"
Note however that by default this will not play nicely with javascript_include_tag's :cache option, you would need to compile your .coffee files before deploying. Alternately, check out the BistroCar rails plugin that plays nicely with rails asset handling.
Bugs?
- Let me know here: Issue Tracking
Requirements
- coffee-script
- rack
History
January 27, 2010: release 0.2 BACKWARDS INCOMPATIBLE
- replace :url parameter in favor of :urls, now it behaves similarly to Rack::Static (Brian Mitchell)
- add :static parameter, which when false will disable automatic asset serving of url misses via Rack::File, instead passing through to the app.
- improve documentation for Rails
- remove dependency on Pathname, oh if only it were stdlib instead of extlib
January 26, 2010: First public release 0.1.
Copyright
Copyright (C) 2010 Matthew Lyon matt@flowerpowered.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
