kangax/fabric.js — pull request #232 by davidjrice (2012-08-13 18:04:05+00:00)
Title: Add seamless Rubygem integration that exposes fabric-rails gem

Hey, so I had a bit of a much around and came up with this. Am not sure if you want this functionality in the main repo, just an idea. Haven't released it as a rubygem yet till we figure out if this we'd want to do! So we could;

* try releasing fabric.js this (perhaps, experimental way)
* do something like jquery-rails and have a separate repo https://github.com/rails/jquery-rails

I guess the benefit would be:

* Can maintain released npm/downloadable/gem version all at once, from the same repo
* Being able to install the same code from npm or rubygems would be a big plus

So far, looks like everything works. I've a small rails test app and to get fabric installed it was just a matter of adding

gem 'fabric-rails', :git => 'git://github.com/davidjrice/fabric.js', :branch => "rubygem"

to my `Gemfile` and

//= require fabric

to my `application.js`

The only downside to this approach would be that;

* we're including some rubygems specific stuff in the repo
* installing as a rails dependency (from git at least) requires download of the entire fabric.js repo, which is quite lot (though from rubygems should be fairly fast as I've only included what the gem needs in the file list, which should restrict what gets published to rubygems)

Anyway, let me know what you think. I'll happily rework this and maintain a separate fabric-rails Gem if you don't want to :)