Resourceful Plugins

This is a woefully tardy followup to my last post on Clinton Nixon’s raleigh.rb presentation. Clinton discussed some pretty cool stuff about building Rails apps around customizable plugins. His team at Viget Labs has produced two of these Resourceful Plugins: Bloget, a cleverly named blog engine, and a CMS called Sandstone. What follows are my bullet-list notes from the talk.

  • Deployed and working but there are still some pain points and edge cases.
  • Decided separate apps wouldn’t work, but plugins would.
  • More flexibility with plugins as opposed to full Rails apps.
  • Boss: don’t make a Rails Engine.
  • Polymorphism as inspiration.
  • In bloget, Poster must have a name.
  • Modules not classes.
  • Generators are key to the entire concept. Use them to copy over any files that are going to be customized: controllers, views, tests (as they add customizations). Views are completely copied over.
  • Running tests inside plugins is painful, especially when testing how a plugin integrates within an app.
  • Testing plugins is a sisyphean task.
  • Many customizations get unwieldy.
  • Using other plugins. The code for integrating with other plugins gets ugly. Plugins they are integrating with: acts_as_authenticated, acts_as_taggable_on_steroids, will_paginate
  • You end up with a lot of files copied over. The original goal of the project was not to do this, but it’s sort of necessary with Rails plugins now.
  • Upgrades also a consideration.

Leave a Comment