# Half Pipe Gem to replace the Rails asset pipeline with a Grunt.js-based workflow, providing dependencies via Bower. ## Who is this For? This initial release assumes you have been using [Grunt.js](http://www.gruntjs.com) in non-Rails apps and would like to start using it in Rails as well. It uses [Bower](http://bower.io) for dependency management, [RequireJS](http://www.requirejs.org) for Javascript modules and Sass for CSS. If you use alternatives to these tools, we'd love to hear from you. ## Getting Started ### Directory Structure We believe that the directory structured imposed by the Rails asset pipeline was a step in the right direction, but did not go far enough in making client code a first-class part of your application. Given that, we have put assets at the same level as the rest of your Ruby code: - `app/scripts` - Javascript files (currently all RequireJS modules) - `app/styles` - Sass templates #### Rails Generator In a Rails app, use `rails g half_pipe:install` to get started. This will generate the directory structure and any files necessary for your Grunt workflow.
Generated | Purpose |
---|---|
Gruntfile.js | Main configuration for your Grunt tasks |
bower.json | 3rd-party asset dependencies (includes normalize-css, requirejs, and html5shiv by default) |
package.json | NPM dependencies (ie. Bower, Grunt, any Grunt tasks) |
.jshintrc | Linting configuration for Javascript |
app/scripts/application.js | Entry point for requirejs; includes requirejs configuration, main module require and bootstraps page |
app/scripts/main.js | Main module for your app; includes page initialization and requires any modules necessary for initialization |
config/initializers/sass.rb | Bootstraps Sass with bower importer |