Latest News >> 2008-07-20 2008-06-25

I’ve been completely fed up with news/feed/rss/atom readers these days. I use Linux as my primary operating system, and I only have a few feeds that I want to rip through quick so I can get to reading the content. Yet, trying to find a reader that doesn’t suck donkey balls has been a chore.

2008-06-21

Wanna know what all the Ruby vulnerabilities are? Or at least have a fun look at how to search through code for clues? It’s a blast.

2008-06-13

I’m dropping a large blog post on everyone to just say that I haven’t died, I’ve just been busy working on my book for A/W about Mongrel. I had contracted with them to do a book about deploying Mongrel, but then decided it wouldn’t be a very good book since we’d already done one about that topic and there wasn’t too much more to say.

Writing FastCST Plugins

The Only Scriptable Version Control Tool

Unless I’m sadly mistaken, I believe FastCST is the only version control tool that lets you easily write your own commands and triggers. CVS and other systems will let you run shell scripts and stuff, but FastCST plugins are actually loaded the same as any other command, have access to the same APIs, and are easy to write. Additionally, you get to use Ruby so your automation possibilities are endless.

Feel free to correct me if I’m wrong about being the only game in town when it comes to automation. I really hope the other systems adopt the same approach since I think extension is a mandatory requirement for any development tool.

Commands and Triggers

Plugins come in two flavors: Commands and Triggers. A Command is a something that works like all the other FastCST commands. They take arguments and use the base APIs to do stuff. A Trigger is a little object that “wraps” a command so that you can do work before/after a command is run.

Writing both Commands and Triggers is really easy. The gist of the process is:

  • Create a .rb Ruby file named after the command. This applies to Triggers as well, so if you write a command and trigger, put them both in the same file.
  • Commands inherit from the Command class and must end in Command. BackupCommand, DestroyCommand, etc.
  • Triggers inherit from the Trigger class and must end in Trigger. ApplyTrigger, UndoTrigger, BackupTrigger.
  • Implement the class and then put the .rb file in your .fastcst/plugins directory.
  • After that you should be able to run the command and any triggers will get picked up automatically.

There are some details to implementing the Command and Trigger classes. But as an example, take a look in the tools/plugins and tools/triggers directories for some examples.

More To Come

I’ll be expanding this document in later releases once the API stabilizes more.