Stackalicious(2007-10-27)
So, at the risk of making entirely too many posts about Leopard today, I’m going to toss another out.
Uses for Stacks:
- Clean up messes: Within a week I can turn a nice, clean desktop into a morass of inane downloads, screenshots, and documents. A Stack of ~/Downloads makes things a lot cleaner. If I can only figure out how to get screenshots to go into a separate Stack…
- Little discrete groupings: I usually have a logical grouping of files on the desktop that I want quick access to, ie TextMake Project files. Having a single Stack might be a good approach for this.
Some Leopard + Ruby Notes(2007-10-27)
Ruby developers may want to keep the following bits of information in mind when they install Leopard.
- If you replaced Tiger’s horribly broken /usr/bin/ruby with your own custom build (most of you did), be aware Leopard will overwrite it (now it points to the 1.8.6 Ruby.framework in /System that comes bundled). The same issue exists for the gem and rails executable. Not a big deal; re-overwrite as you see fit (or use the framework version and reinstall some gems and libraries).
- You’ll probably need to reinstall Xcode, as well (at least if you want a compiler!). Throw your Leopard disk back in, go to Optional Installs -> Xcode Tools and install XcodeTools.mpkg. Same process as with Tiger.
- I needed to reinstall MacPorts as well.
As you might expect, YMMV. More as I run across it.
Leopard, Off the Cuff(2007-10-26)
So, today was Leopard release day. Showing up at work this morning and seeing a shrink-wrapped copy on my desk was a nice surprise.
Some initial reactions:- It’s snappier. I’m sure cleaning out my 10.4 cruft helped, but it sure is faster than I expected.
- Spaces is a big deal. Multiple desktops are something I really missed from my days as a Linux junkie (Virtue Desktops didn’t perform well enough for my tastes)
- Cleaner UI. Very happy to get rid of the clunkier brushed-metal look. The window shadowing is definitely better in this release as well.
- Web Clips are sweet. I do wonder, however, how this will affect ad-driven sites who rely on people coming to view changing content (which now can be docked ad-free on Dashboard).
- Cover Flow in Finder is neat, at least for some types of media (especially with video Quick Look); it’s useless with text, of course. The default blue folder image is disappointingly drab.
- Lots of small features to find (tabbed windows and better Google Talk support in iChats, an improved Spotlight, etc); some of these might reduce my [currently fanatical] need for applications like Quicksilver and Chax.
I think the thing that most excites me about Leopard is the fact new applications are sure to come out that will leverage technologies like Core Animation (and various nifty XCode improvements). The next version of TextMate, which will be Leopard-only, for instance, is something I can’t wait to get my hands on.
All in all, very happy with this release so far.
KeywordSearch 1.3.1(2007-10-09)
KeywordSearch is a small library I wrote earlier this year to add support for GMail-style keyword/value searches via a DSL. It’s a parser pet project that I tweak from time-to-time.
Here’s an example, albeit a little hackish:
<notextile> # Some variables to build up clauses = [] arguments = [] # Search a string, defining the supported keywords and building up # the variables in the associated closures KeywordSearch.search('account has:attachment since:2006-12-03') do |with| with.default_keyword :title # values without keywords get assigned to this with.keyword :title do |values| # keyword blocks are yielded an array of values clauses << "title like ?" arguments << "%#{values.join(' ')}%" end with.keyword :has do |values| clauses << 'has_attachment = true' if values.include?('attachment') end with.keyword :since do |values| date = Date.parse(values.first) # only support one clauses << 'created_on >= ?' arguments << date.to_s end end # Do our search with <tt>clauses</tt> and <tt>arguments</tt> conditions = [clauses.map{|c| "(#{c})"}.join(' AND ')), *arguments] # simplistic example results = Message.find(:all, :conditions => conditions) </notextile>
KeywordSearch is available from RubyForge and can be installed via:
sudo gem install keyword_search
Comments, as always, are welcome.
Changes in this release:
- Conversion to a Ragel parser as a performance tweak (not to mention less code). (I still love Dhaka, though).
- More advanced parsing with better character set support
- Test suite now uses “test/spec”: and has been added to significantly
- Keywords/values are now case sensitive; downcase the input manually if you want the old behavior.
Campfire does Continuous Integration too(2007-10-03)
I love Campfire for software development. It’s a simple, powerful way to collaborate, especially when you take into account the search capabilities and inline images. But it’s even cooler when you start to integrate various tools you use on the side, chronologically folding outside activity into the conversation you’re having with fellow developers; inlining subversion commit notices and providing diff links being the most prominent examples.
One tool I’m really liking these days in CruiseControl.rb from the good folks at ThoughtWorks; it’s a nice, easy-to-configure continuous integration application that plays nicely with the way I think software should be developed (quickly, creatively, and with a barrage of testing). It turns out some thought has been put into extending CruiseControl.rb with builder plugins… and I love building plugins. Seriously.
Did I mention I love Campfire? Bet you can figure out where I’m going with this…
Enter my campfire_notifier plugin, which you can grab here (you can read about the installation process in the CruiseControl.rb docs). It’s probably a bit raw, but it seems to do the job, allowing you to hook any build event you like. Here’s a sample project configuration:
<notextile> Project.configure do |project| ... project.campfire_notifier.configure do |campfire| # ... (account & room configuration is done here) ... campfire.say_on :build_fixed do |build, previous_build| "[CruiseControl] #{build.project.name} FIXED (Build #{build.label}: #{build.url})" end campfire.say_on :build_broken do |build, previous_build| "[CruiseControl] #{build.project.name} BROKEN (Build #{build.label}: #{build.url})" end end ... end </notextile>
I’ve submitted the plugin to ThoughtWorks (with the outside hope it gets bundled), but you got it here first :-)
- Note that I’m aware there are a couple campfire_notifiers floating out there (and all have their merits). I wrote mine specifically to address the need for custom messages and to support the full range of CruiseControl.rb events—which I didn’t find elsewhere.
Rewrite Woes (Take Two)(2007-09-24)
There seems to be quite a furor over Derek Siver’s recent post on CDBaby’s failed rewrite to Rails.
Of course, this is fodder for the Rails anti-hype engine; which isn’t a bad thing, at least when it comes down to having logical, well-reasoned, and realistic discussion about when Rails is and isn’t the right platform choice. I tend to think that, for the most part, Derek’s points center around his own personal tastes vs strong technical reasons—which is not to say they’re less important; just less portable.
On top of the platform choice… to those who are jumping on this and screaming “Thinking about a rewrite to Rails? Think again!” I say “Thinking about a rewrite? Think again!” Chad covered those issues back in December (read bottom-up), earned after we spilled our own blood and tears on a failed PHP -> Rails rewrite.
Not to say that a rewrite never makes sense; just that you’d better be ready to tackle it.
Lone Star Ruby Conference Starting(2007-09-05)
So, the Lone Star Ruby Conference starts here in a couple days, with the Charity Workshop getting the ball rolling tomorrow afternoon. I’ll be doing one of the 30-minute talks (talking about my old stand in, tips and tricks Rails views - or at least what I can fit into half an hour), and then it’s two days of near-relaxation listening to other people speak - and looking for local developers to hire.
A lot of great people are coming into town, so I’m really looking forward to the next few days. Hope to see you there (well, here)!
Some of us are getting together to see Wayne’s World at the Alamo Drafthouse (Lake Creek) for the special midnight showing on Friday. If you’re interested (Austin has a lot to do), look here for more info. What’s the Alamo Drafthouse? Why, the best movie theater there is, of course!
Off Topic: FiveRuns is Hiring(2007-08-29)
Live near Austin, TX? Want to work at a small, Rails-focused company? Not completely put off by the idea of having to work with me on a day-to-day basis? Really, think about that last one…
We’re gearing up to hire several Rails developers [with varying levels of experience] from the local area. If you’re sincerely passionate about Rails, Ruby, the community that’s grown up around it, and fit the bill, drop me a line (bruce at fiveruns).
Paginator 1.1.0(2007-08-12)
I just released an update of the paginator gem the full range of Enumerable methods are now available on Paginator and Page instances. This was a long overdue feature—like many releases, this one was for largely selfish reasons … not having inject available was really getting on my nerves.
Paginator is a simple library that can be used to add pagination to any Ruby [not just Rails] application. The original release notice is here.
Forward and Delegate, A Simple Pattern(2007-08-11)
- Forward all missing method invocations on to some @object
- Dynamically add delegation of that method to that object for future invocations
<notextile> def method_missing(meth, *args, &block) #:nodoc: returning @object.__send__(meth, *args, &block) do self.class.class_eval %{delegate :#{meth}, :to => :@object} end end </notextile>
- returning to avoid explicitly setting a temporary variable for the return value (stylistic choice of mine)
- delegate to generate the delegation code (because it’s dull to do it yourself)
Enjoy!


