WebAppers

/ best free open source web resources /

Shopify

Javascript Dependency Management for Ruby on Rails

Posted · Category: Code, MIT License

Sprockets is a Ruby library that preprocesses and concatenates JavaScript source files. It takes any number of source files and preprocesses them line-by-line in order to build a single concatenation.

Specially formatted lines act as directives to the Sprockets preprocessor, telling it to require the contents of another file or library first or to provide a set of asset files (such as images or stylesheets) to the document root. Sprockets attempts to fulfill required dependencies by searching a set of directories called the load path.

If you use and contribute to open-source JavaScript frameworks and libraries that use Sprockets, like Prototype and script.aculo.us, the build processes for those scripts can be integrated directly into your application. That makes it possible to track the latest development versions of your framework and library dependencies by adding their repositories to your Sprockets load path.

Sprockets

Requirements: Ruby on Rails Framework
Demo: http://getsprockets.org/
License: MIT Licenses

2 Comments
  • http://irongaze.com Rob Morris

    That’s a really interesting idea. I’ll definitely be checking this out, as my own efforts in this direction have lead to a lot of load-order dependencies that are not explicit. Thanks for the pointer!

  • Gustavs

    Wouldn’t many javascripts load faster rather then a big one?

Supported By

Deals

Web Browsers Icon Set
Food Icon Set
Flat Icon Set

Flat Icon Set

100 icons