iBurn

Life in code

Making Minitest Work With Rails 3.x

| Comments

I have been helping with moving a fairly big legacy Rails code base from 2.3.x to 3.x, and one of the issues I had was to use minitest with rails controller specs. Initially to make this work with 2.3.x we were doing something like this in spec_helper.rb:

1
2
3
4
5
6
7
8
ENV["RAILS_ENV"] = "test"
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
require 'test_help'
require 'minitest/autorun'

class MiniTest::Spec
  include ActionController::TestProcess
end

However, ActionController::TestProcess has been removed in Rails 3.x, and it’s no longer so simple to get all the needed spec methods. After quite a bit of digging around, found the correct way to do this:

1
2
3
4
5
6
7
8
9
ENV["RAILS_ENV"] = "test"
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
require 'minitest/autorun'

class MiniTest::Unit::TestCase
  include ActiveSupport::Testing::SetupAndTeardown
  include ActionController::TestCase::Behavior
end

Hopefully this saves others a bit of time. One caveat though, I have tested this only on Rails 3.0.x, so no idea if this works with Rails 3.1.x. If it doesn’t, you could also look at minitest-rails.

2011: A Retrospective

| Comments

As I scramble to get some supplies for a small party I’m throwing at my new home in Bangalore, I thought it would be a good time to write about a small post commemorating the year past. Though I have to admit I’ve been thinking for a while about a possible move to this city from my beloved Chennai, at the beginning of the year at least, I had no idea. I was buzzing from the excitement of participating in TFN 2010, and I was also too busy getting into the groove of a new project, and that’s pretty much all I cared about. As year progressed though, it became apparent that I’m up for some pain on this front.

There are good clients, and there are bad clients. And I take a lot of care to choose what kind I work with, and I for me it’s very important that a client’s temparament matches mine. I didn’t know that I should pay as much attention to their experience too, and maybe my earlier awesome clients kinda made me sloppy about checking credentials. After all, I’ve been lucky enough to work with some exceptionally good ones before.

I guess lessons learnt, and I would come away with enough pain out of the project to become a major lesson in client relationship management. I learned that it’s very important that the other party understands the software development process also a little bit, not just his or her domain. Perhaps I too failed in managing expectations properly. Either way, it was a heart-rending experience, but I’m still proud of the work I’ve done for this client. I guess nothing pains you more than the fact that your work is going into a project that would probably never see the light of the day. That always stinks.

But I guess I had to learn this lesson either way, and I did with as much humility I can muster. It was easy to get angry and frustrated, but I always knew doing your own thing was not going to be easy. But as it happens, the tail end of the year took a surprisingly good turn, rather unexpectedly. I landed a good project in Bangalore, and the opportunity presented itself for me to finally make the move. I took the plunge, and here I am. So far, it seems like a good move, and I’m happy with the work I’m doing, and most importantly, I’m now working with the NGO sector, which is an entirely new experience to me. While startups introduce you to ambitious people who obsess about money and making it big, the NGO sectory is almost the exact opposite - idealist, easygoing people who want to spend their life in service of others. I’m sure there are exceptions, but I have grown to respect how much some people sacrifice for making others’ lives a bit more easier. Makes you hopeful about the future of humanity, I suppose.

I’m learning a lot on that front, and I continue to work with my favorite toolset, which I’m also thankful for, because I realize a lot of people don’t have that freedom to choose. I’m also making a new set of acquaintances, friends and colleagues. The new city has been kind to me so far. What more can I ask? And yes, I’m finally back to my cycling routine. Can’t help but feel grateful for the opportunities I had, lessons learned and friends made. Here’s to a new one, and hopefully I will learn as much as I did in the past year - hopefully with less pain, but I guess you never get to choose that part :). Wishing you all a happy and prosperous new year, and may all the dreams that you really care about come true!

The Problem With Joe Hewitt

| Comments

Don’t get me wrong, I have tremendous respect for Joe and his abilities. His work on Firebug is amazing and use it everyday as a web developer. Though I did not get to use his other popular work, the Facebook client for iOS, I think I did indirectly use it as the Facebook Android app seems to have been a direct port of it.

But recently, he wrote a missive about how the web needs a benevolent dictator so the technologies can be herded into something more coherent and has more vision. Admirable sentiment, but the way he goes about justifying his position is a little grating, as he accuses of people who support open web and its’ democratic ways of technology concensus-building are ‘arrogant’. I was like “what? he cannot be serious”. But he did write something very similar a year ago, I suppose.

So apparently, an year or so of working on iOS, which I think where his inspiration for a benevolent dictator comes from (so we could all craft perfect snow-flake like web apps) he’s back to hacking on the web. I can understand his frustration when it comes to slow place of development on the web, but that’s how concensus-building works. You can deride Android all you want for its’ fragmentation, but if you want an open source mobile platform that takes everybody’s aspirations into consideration, you have to live with some constraints.

Not to get all political about it, but this argument sounds exactly like people who prefer dictators to a democracy because things get done faster that way, and because consensus-building is maddeningly slow. But what if some laymen have better ideas than dictators? How does that get factored in? If you see his argument that open web advocates are “arrogant”, this is almost funny. You’re asking for a dictator over a bunch of technologies that affect billions of people and you’re accusing the others of arrogance? Whoa. That’s some mind-bending stuff right there, bro.

I won’t even go into his way of consensus-building. Accusing people with differing view points of being “arrogant” or “complacent” because he had had experience in building for closed platforms and how much better the experience is. Sure it is, and this problem is not even new. Have you heard of trade-offs? But accusing the same people you need to win over of being complacent and arrogant is not the way for concensus building. Unless you’re just whining about it.

But if Joe has some constructive suggestions as to how to improve specific parts of the web from sucking hard (and they do) instead of over-arching arguments like everything will be so much better under a benevolent dictator, I’m sure we are all ears to listen. Heck, I can’t wait to see what he works on next. I can only hope it will be for the betterment of the open web.

The Move

| Comments

In a significant personal decision, I have decided to move to Bangalore. It’s been more than seven long years in Chennai, and it has been a city that I have grown immensely fond of, and it has seen my ups and downs personally and professionally.

Of course no regrets on either counts, I have always taken decisions with the full awareness that I will pay for my mistakes if those decisions go wrong, and I have learned from both kinds :). I have made lots of friends, gained and lost loves, and it has seen me through some immensely challenging and uplifting times. I will never forget this city, just like I won’t forget my time in Hyderabad. As it happens, I have stayed in both cities 7 years each. We shall see how long in Bangalore :)

On the professional front nothing much changes except Viamentis will change its address to a new city, and I will be working with a non-profit for the very first time, managing/improving their Rails site as a contractor. I will be posting more about the new client and other details on The Viamentis Blog soon. Though the new project does not require me to be in Bangalore per se, I have been thinking about this change for a while, and this assignment provided the perfect opportunity to do so.

I’m grateful for all the amazing people I met in Chennai, and I would very much hope to keep in touch no matter where I live in the future. My stay here wouldn’t be anywhere as exciting as it has been without the fantastic people I met here. Some of them changed my life, and I will forever cherish their friendship, love and acceptance. Thank you Chennai, it’s been a blast.

The Lytro Camera

| Comments

The Lytro Camera is pretty awesome, no doubt about that. But as far as I can see, the single important USP that they point to is being able to focus individual parts of a picture. This is great, but I don’t see the point of bringing out a camera which does mostly this.

The modern camera market as far as I can see is broadly segmented into the ones on smart phones, which cater to most of the needs of a consumer market. The next set is DSLR cameras that start with enthusiasts and go professional based on features and price.

So I’m wondering why a consumer would buy a separate camera just for this feature. Ideally, this should be an iPhone app. They’ll sell millions. But this needs specialized hardware, so I’m guessing that’s out of the question for now. I think the other play is licensing the technology to the biggest - Nikon, Canon, Olympus etc - and let them figure out where to use it. Or, Lytro can get into enthusiast/professional space itself.

I think that’s how they’re going to have to play it. The consumers already have a camera, and that is their smartphone. It will be really hard to convince them to carry another brick in their pocket. So Lytro has to become a competitor to the biggies in the DSLR world. It’s not going to be easy to snatch customers from them, given how much investment semi-pro and pro grade photography equipment is. It will be interesting to see how this will play out.

Deactivated My Facebook Account

| Comments

Finally deactivated my Facebook account. I think I still need sometime to completely shut it down, as I’m still in two minds about Facebook as customer outreach platform (for products) and events platform.

But I’ve also noticed that it is killing my desire to write, instead posting something very short in the form of tweets, or at best comments. There’s only so much you can express yourself in 140 chars. I need more :)

Looks like I’m writing only every 6 months or so now, which needs to be improved on. Since I don’t have the easy way out like I did with Fb earlier, I think I’ll be a bit less lazier and post more often here. I will continue to post the more simpler stuff on Twitter, though. That is one communications platform that I haven’t gotten tired of :)

Repentance

| Comments

“The Muslim boy Kaleem pierced my conscience. I understood that love between two human beings is more powerful than the hatred between two communities” - Swami Asimananda

Who would have thought a Hindutva hardliner would come to repent his sins, even going to the extent of writing to the presidents of two countries, seeking penance and offering to help reform the Muslim hardliners in Pakistan. I don’t think RSS would have seen this coming in a million years, but it still a great opportunity for all parties involved to take a good hard look at the futility and pointlessness of using hatred and violence for achieving their goals. You should read this touching story by Tehelka.

Fair Game

| Comments

Watched this movie today. It deserves every bit of it’s 7.0 rating, probably more. I read some fairly ho-hum reviews about this movie, so wasn’t expecting a lot, but what a powerhouse movie. Admittedly, part of the reason I went to the movie because Naomi Watts is in the movie (I totally loved her in 21 Grams) and she didn’t disappoint this time either. She carries the movie with grace, and Sean Penn does a great job too. Whatever I expected from this movie, I didn’t expect to have a lump in my throat a couple of times. Yes, that good. And yes, you should watch this movie. Over n out.

New Beginnings

| Comments

I’ve been neglecting writing for way too long. Though hardly anybody reads this (lately I’ve seen a jump in subscribers, but I’m guessing that is purely curiosity rather than anything else). I’m not the one to complain though. I believe we write blogs for ourselves more than anyone else. But if you like it, that’s great :)

I am fully to blame for this blog becoming just a way to share the zillions of cool stuff I find on the ‘net - but I guess there are other ways of sharing it - http://clips.vamsee.in should still work, so that would be a good place to check out if you’re interested in funky videos and other interesting things that catch my attention. I might mention them here occasionally anyway :).

So I’ll try to keep this blog writing-only (mostly). I’m not sure how long this stint will last, but I feel the pull these days. Throw in a comment or two occasionally if you like :)