my recent reads..

Paranoid Yak Shaving

So a few weeks ago I found myself wanting "soft-delete" in a Rails app. Ruby Toolbox is a little long in the tooth on the subject, but after a little more research I discovered xpond's paranoid project that was just what I wanted:

  • packaged as a gem, not a plugin

  • built for Rails 3 (arel-aware in particular)

  • can be selectively applied to your models

All was cool, except at about the same time we updated to Rails 3.0.3 and it broke (as it turned out, due to changes in AREL 2.0.6 internals).

One of the beautiful things about github and the way it's been adopted by the ruby/rails community in particular is that it makes it so damn easy to just dive in and help update code originally contributed by other people. So paranoid needs updating for Rails 3.0.3? No problem - fork it, diagnose the issue and push your fixes back up to github.

But that's also a great recipe for yak shaving ;-)

The fixes are yet to make it into the released gem, but if you desparately need 3.0.3 support you can install from my repo. i.e. in your Gemfile:

gem 'paranoid', '~> 0.0.10', :require => 'paranoid', :git => 'git://'

Blogarhythm: Paranoid (of course - but this is the bluegrass version!)
read more and comment..

CruiseControlling Ruby 1.9.2 and Rails 3.0.2

CruiseControl for Ruby from ThoughWorks has long been one of the easiest ways to your rails project under continuous integration.

But there's still an issue that it can't run under Ruby 1.9.x. That's not very good if you are targeting 1.9.2 for your project.

Here's a quick recipe for how you can build a 1.9.2 project with CC, using the wonders of rvm..

# download and unpack CC to /usr/local/cruisecontrol-1.4.0 (or where you like)
# for convenience, add .rvmrc in /usr/local/cruisecontrol-1.4.0 to have it run 1.8.7
echo "rvm 1.8.7-p302" > /usr/local/cruisecontrol-1.4.0/.rvmrc
# configure CC:
cd /usr/local/cruisecontrol-1.4.0
./cruise add my_project_name --source-control git --repository
# ^^ This will initialize the ~/.cruise/projects/my_project_name folder for a git-based project

# if you have an .rvmrc file in your git repo, pre-emptively trust it to avoid clogging CC:
mkdir ~/.cruise/projects/my_project_name
rvm rvmrc trust ~/.cruise/projects/my_project_name

In ~/.cruise/projects/my_project_name, edit cruise_config.rb to run a shell script instead of the standard build task (I'm calling it and it will be in the root of my git repo):
Project.configure do |project|
# [.. other stuff ..]
project.build_command = './'
# [.. other stuff ..]

Add to your repository (don't forget to chmod u+x it). It needs to ensure rvm script is loaded and activate the correct ruby & gemset.

The script initialization is necessary because it seems the way CC spawns the shell script it doesn't pick up the rvm initialization you might already have in .bash_profile. Without rvm script initialization, "rvm" will invoke the binary which can't make the direct environment mods it needs to do.

Here's what I have in

if [ "$(type rvm | head -1)" != "rvm is a function" ]
source ~/.rvm/scripts/rvm || exit 1

if [ "$(type rvm | head -1)" != "rvm is a function" ]
echo "rvm not properly installed and available"
exit 1

rvm use 1.9.2-p0@mygemsetname --create
bundle check || bundle install || exit 1
rake # setup to run all required tests by default

Once that's checked in and pushed to the repo, you can kick-off CC:

cd /usr/local/cruisecontrol-1.4.0
./cruise start

Now my ccmenu is green, and CruiseControl is running my project under 1.9.2 and rails 3.0.2;-)

Blogarhythm: Waiting for the light ART-SCHOOL
read more and comment..

Rock till you

Bombshell announcement on 29-Oct: have .. struck a deal with Facebook.

What this means is that Facebook has bought most of’s technology and assets, and Sam Lessin is moving to Facebook. was widely acclaimed as the simple file sharing mechanisms we all needed. It resolutely solved the problem that everyone with a computer and a network connection has known at one time or another: how to share files too cumbersome for email, without resorting to techno-geekery like ftp and such. And it worked. Beautifully.

But it doesn't work anymore.

Goodbye! You were an amazing service. One of the best and brightest of the Class of Web 2.0. You made things simple. You solved a real, pressing problem.

Unfortunately, that's not what I'll remember you for now.

Instead, it will be for brewing a thunderstorm of concern over the very dependability of cloud services, as John C. Dvorak went to town on in his column.

And for teaching us that it's true - startup founders really don't give a toss for their customers if they can get a sweet deal and a plum job with one of the heavyweights instead.

And for once again propelling Facebook into the privacy-conspiracy-theory limelight. Sure, "no data will be transferred to Facebook", but they put you out of business and bought "most of [your] technology and assets", right? So will we be surprised when Facebook takes aim to lure it's unsuspecting users into sharing pretty much anything and everything - private, commercially confidential, and otherwise - using Facebook?

Well, I guess does really deserve our thanks for that last point, if anyone cares to notice.

The very best news—for anyone who can't imagine life without—is that there is another exceptional product out there called Dropbox that can handle most team sharing needs in addition to looking after your personal documents.

That's not a paid advertisement or anything. I simply use Dropbox everyday and just love it. I wouldn't be exaggerating to say it's probably improved the way I work more than anything even the folks in Redmond or Cupertino have shipped in recent memory.

Blogarhythm: Rock Rock (till you drop) .. Def Leppard
read more and comment..

The Ultimate Steampunk Project needs $10

I heard John Graham-Cumming on TWiT #269 talk about the project he has started to build - 173 years later - a full scale realization of Charles Babbage's Analytical Engine. Amazingly, it's never been done (only partial models exist).

Now, we are talking about a truck-sized, steam-powered machine that is Turing-complete and features (without silicon or electricity) "modern" ideas like instruction pipelining. The ultimate steampunk project. It also has a serious educational and academic aspect (including to digitize all of Babbage's plans and notes).

Due to significant private support coming forth, the pledge target has apparently been reduced from 50,000 to just 10,000 signatories. At the time of writing, John only needed another 6358 pledges of $10/£10/€10 each to get the project moving.

Now I don't often get behind fundraisers and campaigns, but this strikes me as one of those once-in-a-lifetime follies you cannot help but support. And all for about the price of the cheapest bottle of wine in the shop around the corner.

Sign my pledge at PledgeBank

Blogarhythm: L.O.V.E. Machine WASP
read more and comment..