intercom/pulse — pull request #25 by eugeneius (2014-08-24 08:21:18+00:00)
Title: Move C3 library to vendor/assets/ and serve it separately

We were using the JavaScript from C3 v0.2.5 with the CSS from v0.1.29. Mixing and matching these was definitely going to lead to a bad time.

The `vendor/assets/` directory is a more appropriate place for these files:

http://guides.rubyonrails.org/asset_pipeline.html#asset-organization

> app/assets is for assets that are owned by the application, such as custom images, JavaScript files or stylesheets.

> vendor/assets is for assets that are owned by outside entities, such as code for JavaScript plugins and CSS frameworks.

Code Climate is currently analysing the C3 JavaScript as application code, and the results are dragging the project GPA down to a hilariously low 0.2:

https://codeclimate.com/github/intercom/pulse/app/assets/javascripts/c3.js

One consequence of moving the JavaScript file out of `app/assets/` is that it isn't automatically included in `application.js` any more. Adding it back in is as easy as `//= require d3`, but I think it's actually better to serve it separately, since then users won't have to download the same version of the C3 library every time the application's JavaScript changes.