# Half Pipe [![Stories in Ready](https://badge.waffle.io/d-i/half-pipe.png?label=ready)](http://waffle.io/d-i/half-pipe) Gem to replace the Rails asset pipeline with a Grunt.js-based workflow, providing dependencies via Bower. Half Pipe is a generator to get you up and running quickly with a Grunt setup for building client-side code in Rails apps. We believe that your asset workflow is yours and you should be able to configure it however you need to. ## 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. ## Looking for Contributors If you take a look at our [issue board on waffle.io](http://waffle.io/d-i/half-pipe) you'll see that we have some big plans for future releases of Half Pipe. If you are interested in working on a feature or fixing a bug, please feel free to move the issue to "In Progress" and send a PR when you're ready. If you have ideas or questions, please feel free to [open an issue](https://github.com/d-i/half-pipe/issues/new). ## 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 |