This is actually my first technical blog that is written in my own name. I’ve been avoiding that for a while, starting by attempting to create a company blog for a company that never quite materialized, then going and writing for O’Reilly Ruby as one of the contributors to a group blog. I also keep up a personal blog that occasionally mixed in technical content, but usually hid it under strange politics and poetry.
For the most part, I have enjoyed the sort of relative obscurity this approach has afforded me. I’ve been able to convince enough people I’m a decent Ruby hacker through my projects, but I’ve avoided the drama that comes along with becoming ‘internet famous’, the stuff that some of the big names tend to be much more tolerant of.
I think there is a place in the world for Rockstar Coders, but I’ve never personally identified with the idea and have been just as happy to participate on collaborative blogs, or do my writing contributions through answering lots of mailing list posts over the years.
Unfortunately, these things do very little for helping forge an online identity. More often than not, posts I write for O’Reilly are quoted as being from O’Reilly, not from me. Mailing lists are a terrible place for people to stumble across your contributions, because they tend to be scattered all over the place with varying degrees of quality.
So what the hell, I might as well throw together a real place for sharing my technical thoughts. For a long while I sort of rose to a level where I was coding at an semi-expert level, influencing the circles I was involved with, but not really getting the challenges I wanted. I want to change that by putting my ideas out there and looking dumb from time to time if I have to, but learning a hell of a lot along the way. Gaining the insight of smart people who are willing to take a look at and challenge my ideas is how I’ve gained any of my skills so far, and I want to push that farther.
This blog will be my way of sharing whatever I’m diving into, in the hopes that it’ll be useful to anyone who reads it. It won’t necessarily be 100% Ruby stuff, because I’m starting to feel like I’m getting boxed in by the “Rubyist” label. However, because I’m still mainly doing my coding in Ruby and plan to for some time, you’ll hopefully find some cool stuff here if you’re into that sort of thing.
Now that I’ve gotten through long back story no one really cares about, here’s the details of the blog you’re looking at, feature wise:
rake build will rebuild the blog and sync the site via scpThese basic features form exactly what I need and nothing more. I hope that the simple design isn’t too tough on the eyes, and allows you to focus on the writing rather than the visual appeal of my site. Though this approach may be a bit old school, it makes me feel all warm and gooey inside.
You can take a look at the whole source of the blog, but I’ll do a quick set of highlights. I have to admit the whole thing is a hack, I spent just a couple hours throwing it together, and I doubt it’ll be usable by anyone else, but hey, we can look at the shiny parts and ignore the rest, right?
Let’s start with the code I didn’t write, since it’s the prettiest
After looking at FeedTools and RubyRSS I didn’t quite find what I needed, so I did what I usually do when I’m not sure where to go next, ask James Gray.
His blog uses simple title + short description formatted RSS feeds, and he said that he did in 20-something lines of plain old builder code. I was sold, as this sort of simplicity is exactly what I wanted for Blaag. His original code was for Rails, but I was able to adapt it with very little changes.
I love how Builder looks and feels like normal Ruby. If you go and take a look at the RSS Spec, I’m sort of embarrassed I didn’t think of this approach in the the first place. No sense in learning an RSS library when this does everything I want up front.
I am very much a fan of plaintext. When I absolutely must code some HTML, I like to use a little textile here and there, and my entries were made to support that. Here is a sample of what an entry for this blog looks like, including how to set the title and description:
This is pretty sweet, if you ask me. I don’t really need to follow any special conventions to get my titles to work right, and the descriptions are mandatory forcing me to think of a nice synopsis which will be used in the RSS files. Parsing this stuff out and loading the files is trivial. I just needed to hack together a little YAML registry to keep track of entry creation dates to preserve chronological order, and that pretty much covered file loading:
I needed this YAML hack because it appears as if you can’t reliably find the file creation date in *nix, which is a shame. I thought File#ctime was what I was looking for, but lots of things change this and it ends up being very similar to File#mtime which is not what I wanted. Oh well…
The rest of the code isn’t that interesting. Just mainly a bunch of hacking around with writing out files and indices, which in turn call some templates and stuff like this. Though I’ve left out the supporting functions, you can see this ugly and pedestrian stuff here. I know it can be cleaner, but hey, no one else needs to use Blaag. ;)
So, Blaag is hardly worth writing home about, but I’m already enjoying using it over the other blogging software I’ve used in the past. I think it’s mainly because I’ve spent most of the time working on this post actually writing the post and not messing around trying to reverse the bad decisions Blogger made about how my text should be formatted.
It was a refreshing experience building this, mainly because I’ve been so wrapped up in mainstream open source hacking and contracting work over the last year or so that I haven’t really spent any time sitting down and scratching my own itch. This sort of reminds me of the spirit of what hacking is all about, and that alone was worth the couple hours I poured into it.
The adventurous can pull down the source and try to get it working if they want. All the code is under License of Ruby, so go nuts with it. I didn’t ship it with its required directory structure because this isn’t exactly a release. I figure anyone crazy enough to use this thing will figure that out in a jiffy, but if not, email me.
Anyway, that’s probably long enough for a first post. Hope to have some more content up soon.
Written by Gregory Brown on 2008.08.05 at 17:18 | Responses