Pelargir

Musings on software and life from Matthew Bass.

November 12th, 2007

The Bible on my Mac

I attended the 2007 National Conference on Christian Apologetics in Charlotte, North Carolina this past weekend. One thing (among many) that I realized while participating was that I needed a copy of the Bible on my MacBook. I brought my MB for note taking since my handwriting is woefully slow, but it would have been great if I could have looked up scripture references without leaving the keyboard.

I don’t just want a PDF. I want a nice OS X-style application with a built-in concordance and whatnot. Googling around this evening has revealed two possibilities: MacSword (free) and Logos (commercial). Logos isn’t due to be released for the Mac for some time yet, so I’ll be trying out MacSword for now. Anyone have suggestions on other apps that I might have missed? Or maybe there is a generic eBook reader for the Mac out there that I haven’t stumbled across yet?

November 3rd, 2007

Introducing the vizres (response_visualizer) plugin for Rails

Being at RubyConf this weekend has provided the necessary motivation for me to finally release a new Rails plugin I’ve been building. It’s an extraction from a project I’ve been working on for Relevance (who is hiring, by the way).

I’m a regular user of assert_select in my functional tests. I find myself frequently doing something like this when the assertion is failing and I can’t figure out why:

def test_something
  post :something
  raise @response.body.inspect
  assert_select "div[id=header]"
end

Inspecting the response body usually leads me to a solution, but it’s tedious parsing through the huge amount of HTML that gets returned, often in a semi-unreadable format. Enter the response_visualizer plugin (which has since been renamed vizres):

git clone http://github.com/pelargir/vizres/ vendor/plugins/vizres

Or if you’re on edge Rails:

script/plugin install http://github.com/pelargir/vizres/

The plugin provides a vr method to your functional tests. When this method is called, the response body is automatically opened in the default browser allowing for easy visual inspection of the page’s content:

post :new
vr
...

If you’d prefer to jump straight to the source code, passing the :html symbol will open the formatted HTML in the default text editor:

post :new
vr(:html)
...

This has saved me a lot of time in figuring out why a specific assertion is failing. Instead of parsing through the HTML, I can view the entire page and immediately tell if something is missing or out of place. I find myself calling vr even before I write my assertions now.

After installing, check out the README file for additional documentation. There is also a GitHub project if you’d like to contribute a patch or fork the code. Enjoy!

November 2nd, 2007

RubyConf begins

I haven’t gotten up at 5 AM in a long time, but today I did and, after a 2.5 hour drive from Raleigh to Charlotte, am now at RubyConf. Here are some pics from the opening session:

071102_091619.jpg 071102_091636.jpg