8000 GitHub - ncr/rack-cat: Rack middleware to concatenate yor assets (static, dynamic and remote) Use it to serve your javascripts and stylesheets faster!
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
/ rack-cat Public

Rack middleware to concatenate yor assets (static, dynamic and remote) Use it to serve your javascripts and stylesheets faster!

Notifications You must be signed in to change notification settings

ncr/rack-cat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rack::Cat
=========

A Rack middleware to concatenate your assets (static, dynamic and remote) and serve javascripts and stylesheets faster.

Currently it supports concatenating static files (read from disk) and dynamic pages (read from the app itself). 
Remote file support will become reality when I find someone who needs it ;)


Usage 
=====

Use like any other Rack middleware. Rack::Cat constructor takes an options hash as a second argument:

{
  :bundles => {
    "/all.css" => [ "/stylesheets/layout.css", "/stylesheets/widgets.css"],
    "/all.js" => [ "/javascripts/jquery.js", "/javascripts/application.js"]
  },
  :sources => ["tmp/public", "public"], # directiories to search for files (that tmp/public comes handy if you use heroku)
  :destination => "public",             # directory to write files to ("tmp/public" on heroku) 
  :debug => Rails.env.development?      # regenerate files on each request (for use in development mode)
}

So in Rails you would type in config/environment.rb:

config.middleware.use Rack::Cat, { options hash like the above one here }


Contribute
==========

Fork. Commit. Send pull requests.


Author
======

Jacek Becela http://github.com/ncr


License
=======

MIT

About

Rack middleware to concatenate yor assets (static, dynamic and remote) Use it to serve your javascripts and stylesheets faster!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0