Autotest Revisited
June 22nd, 2009
I'm currently in the process of setting up a Rails 2.3 stack from scratch, and a few things have changed since the last couple of projects I worked on were tooled up.
One thing which has certainly changed for better is binding rspec, ZenTest and Growl together, previously I posted on some work-arounds for missing messages, adding images, and various other bits ad-hoc. This functionality is now all produced by installing the autotest-growl gem which may also be found on github. Take a look at the readme.rdoc
Of interest to me in particular were changes to ~/.autotest
Mine was quite something previously,
#!/usr/bin/env ruby
# Symlink this to ~/.autotest
require 'autotest/redgreen'
require 'autotest/fsevent'
AUTOTEST_IMAGE_PATH = File.dirname(File.symlink?(__FILE__) ? File.readlink(__FILE__) : File.expand_path(__FILE__))
module Autotest::Growl
def self.growl title, msg, img, pri=0, stick=""
system "growlnotify -n autotest --image #{img.inspect} -p #{pri} -m #{msg.inspect} #{title.inspect} #{stick}"
end
Autotest.add_hook :ran_command do |autotest|
filtered = autotest.results.grep(/\d+\s.*examples?/)
output = filtered.empty? ? "" : filtered.last.slice(/(\d+)\s.*examples?,\s(\d+)\s.*failures?(?:,\s(\d+)\s.*pending)?/)
if output =~ /[1-9]\sfailures?/
growl "Test Results", "#{output}", "#{AUTOTEST_IMAGE_PATH}/fail.jpg"
elsif output =~ /pending/
growl "Test Results", "#{output}", "#{AUTOTEST_IMAGE_PATH}/pending.jpg"
else
growl "Test Results", "#{output}", "#{AUTOTEST_IMAGE_PATH}/ok.jpg"
end
end
end
Autotest.add_hook :initialize do |autotest|
%w{.git .svn .hg .DS_Store ._* vendor}.each {|exception| autotest.add_exception(exception) }
false
now replaced with
require 'autotest/growl'
require 'autotest/fsevent' #osx specific file changed event notification
Autotest::Growl::show_modified_files = true #which changes prompted the autospec run
Autotest::Growl::remote_notification = true #networked growl, to work-around disappearing notifications
Autotest.add_hook :initialize do |at|
%w{.git .svn .hg .DS_Store ._* log}.each {|exception|at.add_exception(exception)}
end
The FSEvent gem is well worth a look if you develop on OSX 10.5 (Leopard), it switches autotest from polling your hard drive (i.e. thrashing) to working with the OS's event notification system. Design patterns strike again!
With these updates I gave an old project a spin to see what would happen, and voila, the specs ran as they should, coloured and all.
A particular error I was receiving before doing this update was
script/autospec
(Not running features. To run features in autotest, set AUTOFEATURE=true.)
(Not running features. To run features in autotest, set AUTOFEATURE=true.)
loading autotest/rails_rspec
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- autotest/redgreen (MissingSourceFile)
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
…
from /usr/bin/autotest:19:in `load'
from /usr/bin/autotest:19
Unable to find autotest. Please install ZenTest or fix your PATH
The culprit being redgreen, which can be uninstalled when using the new ZenTest.
Separated at Birth: Respect!
June 16th, 2009
Well, I may like to dabble in the occasional Separated at Birth series, but Totally Looks Like has some particularly incredible juxtapositions:
Totally Looks Like nails the uncanny resemblance between Quentin Tarantino & Squiggy from Laverne & Shirley
Alas, poor Quentin. It’s been hard to take him seriously for a long time now, but this may be the final nail in the coffin.
Includes Reinventing the Wheel, Too (Probably)
June 12th, 2009
Could humans at any point in history, given the right information, construct an electronic communication network? To test this hypothesis, Substitute Materials will attempt to build a functional electric battery and telegraph switch from materials found in the wilderness, using no modern tools except information from the internet. The telegraph will be a first step towards an ahistorical internet.
What the author doesn’t say is that he’s doing this in the wilderness while wearing a business suit.
And that he couldn’t find any flint to make a good ax—he had to order it from the Internet.
I foresee much time spent reading this site.
Two New Posters
June 12th, 2009
We’ve recently completed (and had printed) a couple of new A4-sized posters for the University of Sheffield, one advertising a series of lectures by the renowned philosopher Stephen Stich & the other promoting an MPhil degree in Political Theory.
Before we continue, you may wonder: why A4? Isn’t that small for a poster? It is, but not in the context of a university department bulletin board with lots of competing notices. If your poster is too large, it may not even be placed on the board; and even if it is, a larger poster will soon be covered up by other notices. So an A4-sized poster is about as large as you can safely make it.
Judging from this use-case, you might also conclude that creating a striking effect for your poster would be crucial: one that makes your notice stand out from the dozens of other notices. And you’d be right.
Stich Lecture Series
This was a rush job: I had 24 hours to go through the process of commission, design approval & printing. What’s worse, I was suffering through the worst flu I’ve ever experienced. What’s worst is that I was handed a huge wodge of text & only two source images. Luckily one image was large enough that it was feasible to expand it further to print quality.
With such a timeframe & under those conditions, you are subject to severe constraints. Constraints are sometimes wonderful & this was one of those times: it helps guide you quickly down the path towards a decent design.
Some of the constraints were posed by the photo. It was black & white and couldn’t be expanded further without risking pixellation. Also, the picture wasn’t fully optimal because a critical element—the top of Steve’s head— was cut off. So immediately we know that the poster should be black & white (to match the picture), it shouldn’t rely too much upon the picture to give it visual interest (because it was small) & that we were going to have to distract the eye from the missing top of Steve’s head.
When you’ve got a lot of text and your photo is small & suboptimal and you’re limited to black & white, then you’ve got to rely upon typography & stark contrast to attract the viewer’s attention. Black text on white is too common: reversing this will catch the eye. Using chunky typography, I covered the top of Steve’s head with his surname & used the look on his face to draw the viewer’s eye towards the explanation for lecture series.
The result is pretty good, I think, and certainly eye-catching, but it’s a little conventional. Had I more time, I would have made that chunky typography a lot chunkier: it would have taken up about half of the poster. But time was a real constraint here.
MPhil Poster
The second poster here is for the promotion of a degree offered jointly by the departments of philosophy & politics. We were to employ a really striking image that’s somehow relevant to the subject. My initial to represent the result of a broken political process: images ranging from protests, revolution, police in riot gear, bombed-out cities, etc. I also immediately thought of Orwell’s memorable line from 1984: “If you want a picture of the future, imagine a boot stamping on a human face—for ever”.
Any of these images would certainly contribute to a striking poster, but the approach was ultimately rejected as inherently faulty. I might have put out an unintentionally negative message: “Join us & together we’ll destroy the world”. So a re-think was definitely in order!
I came across an intriguing image of anti-Communist graffito on iStockphoto, one that still cleaved to my original idea of portraying a broken political process, but the action portrayed here was more positive. Here, the notion is of casting aside what didn’t work as the initial part of the transition to something that did. And of course, what do you need to make that transition successful? Why, lots of people with MPhils in political theory, obviously!
To keep to the conceit that the poster was itself political graffito, I opted to place the title in a hand-drawn stencil typeface. And finally, the actual content of the poster was placed on a semi-transparent bed.
By the way, if you’re a graphic designer in the Sheffield area & need digital printing done quickly, consider ASAP Digital, who printed both posters. Their quality is excellent & their turnaround time is fantastic.
When the Cliche is All You Have
June 12th, 2009
There are moments when I’m really happy not to live in the US any longer. This is one of them, because I simply know that if I lived & worked there, I’d have to make an eagle-based logo for a consulting company. Because, as I’m sure you’ve twigged, they’re keen-eyed consultants who know what’s what.
And not because they’re nearly extinct.