For me, this was very interesting, as it mirrors a lot of the work we've done at Constrex with our first product Tender.ly - currently being sold as downloadable software, but one which started life as a SaaS offering, changed from that, and will be returning to that as well in the near future.
However, we explicitly do not keep separate branches for the SaaS and downloadable versions of Tender.ly, as the last thing we want is divergent code branches. This is a bit different of a situation to GitHub, which has separate products, but makes our development a bit easier at the expense of a bit more up-front thought when doing the coding - which probably isn't a bad thing.
We ended up coming up with the same solution as GitHub - coalescing all the divergent code into sets of modules, which are then included based on the rails environment loaded at start-up. As we don't want purchasers of the software establishing themselves as competitors (despite the license conditions), all the SaaS code is simply deleted by the build scripts we use to release.
As an aside, JRuby + Glassfish + Rails is a very nice stack for selling downloadable web software - the same code runs on Windows and Linux with minimal changes, and some simple scripts to do the database setup. I really should write a blog post about it at some stage. Perhaps when the day is extended to 25 or 26 hours.
That's actually pretty similar to how we do it, too: we precompile models, controllers, and most other relevant private libraries, then we deliver it on a JRuby stack.
It's actually quite slick and works pretty well, unless you have a ton of non-Java compiled gems to deal with. We've been able to get through that pretty well or find alternatives, although it looks like JRuby's looking to support those libraries in the near future, too, which is great. Makes JRuby quite an attractive platform for this type of stuff.
However, we explicitly do not keep separate branches for the SaaS and downloadable versions of Tender.ly, as the last thing we want is divergent code branches. This is a bit different of a situation to GitHub, which has separate products, but makes our development a bit easier at the expense of a bit more up-front thought when doing the coding - which probably isn't a bad thing.
We ended up coming up with the same solution as GitHub - coalescing all the divergent code into sets of modules, which are then included based on the rails environment loaded at start-up. As we don't want purchasers of the software establishing themselves as competitors (despite the license conditions), all the SaaS code is simply deleted by the build scripts we use to release.
As an aside, JRuby + Glassfish + Rails is a very nice stack for selling downloadable web software - the same code runs on Windows and Linux with minimal changes, and some simple scripts to do the database setup. I really should write a blog post about it at some stage. Perhaps when the day is extended to 25 or 26 hours.
edit: Apparently I can't conjugate English verbs.