VigetHub

April 4, 2008 – 11:16 am

I’m excited to say that Viget’s open source participation is being bumped up a notch; last night, I created a new GitHub account for the company, where we’ll be hosting all our open source projects.

The general strategy is to use the vigetlabs repositories as the “stable” version for each of our projects, while the primary developers for each project will own a forked “edge” version. This will allow people to follow whichever version they’re more comfortable with, and hopefully encourage more participation from interested developers in the community. As an example, sandstone’s stable repository is at http://github.com/vigetlabs/sandstone/tree/master, and the edge version is at http://github.com/bscofield/sandstone/tree/master.

We’re still in the process of getting things up, but we hope to be finished soon. Take a look! (And look for more information soon on Viget’s development blog.)


A little less lazy for me, a little more for you

March 29, 2008 – 11:20 am

What with the new baby and all, finding time for coding has been a little tricky. Nevertheless, I have eked out a few moments here and there to continue working on laziness (which Matz mentioned on his blog!). The first version of the plugin is cool, but the tests it generates are really the least specific ones possible. The update (that I just pushed to GitHub and SVN this morning) is a step in the direction of fixing that. With the new version, you can define custom tests to be generated for particular exceptions. For example, if ActionController::UnknownAction is thrown when someone hits http://yoursite/users/cool, laziness will now generate the following test:

def test_userscontroller_should_have_the_action_cool
assert UsersController.action_methods.include?('cool')
end

Right now, ActionController::UnknownAction is the only custom exception the plugin handles out of the box - all others get the same old general test. I’m excited by the success of my proof-of-concept here, though, so I’m going to work on adding more specific handlers over time. And as always, I welcome contributions - just fork the repo at GitHub and go to town! (And if you still don’t have a GitHub account, email scofield at this domain and I’ll do my best to hook you up - I still have a few invites left.)


Say hello to my little friend

March 24, 2008 – 9:12 am

Or, more precisely, my new daughter. After a rough labor and unplanned c-section, Morgan Dawn Scofield joined the world on Saturday, March 22nd at 2:59 PM. She came in at 6lbs 6oz and 19 3/4″ long, and both she and Lacie are doing great.

Blogging may be light over the next week or so as we all get used to the new order of things :)

Morgan at about a day old


And the greatest of these is laziness

March 19, 2008 – 9:54 am

The three virtues of excellent programmers are well-known - laziness, impatience, and hubris. Last night, I had an epiphany related to the first of these… and thus was born the laziness plugin.

You know how, when you find a bug in your app, you’re supposed to write a failing test before fixing it? Well, laziness makes this a bit easier by writing the test for you. If you’re running in development mode, laziness will add a test like the following to the bottom of your error page:

def test_get_sessions_new_should_not_raise_exception
assert_nothing_raised do
get :new, {}, {:return_to=>"/"}, {:notice=>"You cannot access that page"}, {}
end
end

The first step to fixing the bug, then, is to paste that into your functional test file and run it; if it passes, you’re most likely looking at a data issue (since the params, session, flash, and cookies are specified in the test). If it fails, you’ve got a starting point for debugging.

Laziness isn’t just helpful in development mode, though - it also comes into play in production. If you’ve installed the exception_notification plugin (and you really should have - if not, go ahead; I’ll wait), then laziness will add its generated test to the email you receive whenever your production app throws an unexpected exception.

If you can’t wait to be lazy, you can grab the plugin from Viget’s SVN repository (at http://svn.extendviget.com/lab/laziness/trunk) or GitHub. Patches are welcome through either mode (git slightly preferred).


Still no baby

March 17, 2008 – 1:38 pm

So our daughter’s due date was last Saturday, but she’s been somewhat reticent to join us in the outside world. We’re expecting her at any point in the next few days, though, so I may disappear from pretty much everything rather suddenly. Consider yourself duly warned.