Skip to content

{ Category Archives } Ruby

Moving!

I’m tired of updating wordpress every 3 weeks for security failures, so I’m moving this blog over to posterous, so its their problem now. Please update your links and RSS feeds to http://blog.theamazingrando.com. I imported all the posts from here to a github repo, http://github.com/paul/blog.theamazingrando.com. I plan to write a blog post on how I [...]

Tagged

Writing DataMapper Adapters - A Tutorial

Introduction

The adapter API for DataMapper has been in a bit of flux recently. When I submitted my proposal for a talk at MountainWest, adapters were irritatingly complex to write. You just needed to know too much about DataMapper’s internals to be able to write one. A week before the conference began, I started a significant effort to re-write [...]

I spoke at Mountain West!

Confreaks posted my talk. Everyone go make fun of that huge nerd up there!

I pushed some of the changes I talked about to my github branch. This covers the Conditions objects.

Next on my personal roadmap for adapters one-point-oh edition are for Repository to handle turning the responses from adapters into Resource objects, if they aren’t [...]

DataMapper Echo Adapter

I just wrote a simple adapter that can be used to investigate the DM Adapter API, and debug your own adapter. Its really simple to use:

DataMapper.setup(:default, :adapter => :echo, [...]

A Response to “Database Versioning”

I was just going to post a comment in reply to Adam Wiggins’s Database Versioning post, but it ended up being pretty long, so I’ll post a response here instead.

I’m the original author and current maintainer of the migrations plugin for datamapper. I spent a lot of time thinking about AR migrations before I started [...]

Tagged ,

I’m speaking at Boulder Ruby Group in 2 weeks

I’m going to be giving a practice run of the talk I’ll be giving at MountainWest at the Boulder Ruby Group meeting next Wednesday (18th, 7pm). Come see it and tell me what I’m doing wrong give me some constructive criticism.

HOWTO - Get a list of a class’s subclasses

I recently came across a situation where I had an AbstractClass, an I wanted to know all of the classes that had inherited from it. There were lots of implementations on the web, but that weren’t exactly what I wanted, or they used ObjectSpace to get ALL the classes, and see if the interesting one [...]

I’m Speaking at MountainWest!

I’m going to be giving a talk at Mountain West Ruby Conf!

For those of you too lazy to scroll down and find the details of my talk, I’ll repeat them here:

Some might think of DataMapper as a better, faster, competitor to ActiveRecord. However, they would be missing on of its greatest strengths. At [...]

Ruby Dir.glob bug

To further elaborate on Yehuda’s twit:

[~/tmp][rando@apollo] % mkdir first first/second [~/tmp][rando@apollo] % touch first/second/test.txt [~/tmp][rando@apollo] % chmod -x first [~/tmp][rando@apollo] % ls first/second/*.txt ls: cannot access first/second/*.txt: Permission denied [~/tmp][rando@apollo] % irb irb(main):001:0> Dir.glob(’first/second/*.txt’) => []

If you try to glob some things in a directory that has some ancestor missing the eXecute permission, ruby doesn’t give any indication of an error.

This took [...]

Tagged

Wildfires in Boulder

Here’s the view out my kitchen window, most mornings:

Here’s what it looks like this fine evening:

From fire

Click the album link for more. From my porch, I can see parts of the mountainside flashing from the lights of the fire trucks. They’ve evacuated 11,000 homes, but the wind is blowing the fire the other direction. There [...]