Sunday, January 27, 2008

Making sure extra tasks get run when installing plugins with Piston

When I graduated college, I was a EE major that could code. However, in hindsight, I don't think I was as good because I had no idea how to put together moderate sized systems or above. One of the things that I like about Rails is that they have a system for plugins. I was too uncouth to consider it before. Once you extract a plugin out, you essentially have to treat it as a separate library or package. This forces you to encapsulate, because it's a bit of a pain changing plugins. I know you can extract code out to DLLs or Gems, but I never did it because it seemed like I didn't need it--plus it was extra steps.

I eventually would want a programming language that lets me extract out libraries inside the language, and make its public interface RESTful, and auto-extern its path in SVN and whatever the equivalent is in distributed version control like git/darcs.

Recently, I've started using Piston. It's a ruby plugin manager that's essentially a wrapper around svn:externals. It's been pretty easy to use. In addition, my plugins won't get stale. However, when you install a plugin with piston, you only import the files. It doesn't actually execute the install.rb file, like /script/plugin install would. I'll try to see if I can submit a patch to piston later, but for now, simply run "install.rb" in the root of the plugin, and it should do the install for you. small tip!


  1. Hello Wilhelm!

    No, Piston will never run install.rb. Piston is a general tool, and as such, it cannot know if you're importing a Rails plugin or a PHP library into your project. How would Piston know to run a specific file in an opaque library ?

    And I would like to correct your assumption: Piston isn't a wrapper for svn:externals. It's a replacement.

    Thanks for using Piston and mentioning it on your blog.

  2. I was under the impression that it was for rails plugin management, so that's where my assumptions came from.

    I suppose piston can look at the dir and file structure to tell whether it's a plugin or other standardized code. But it would have the added overhead of doing the comparisons.

    Well, other than that, it's been a cinch to use. So if you had a hand in it, thanks.