Jun 13 Refactoring vs Pragmatism

tags: refactoring pragmatism | comments

To refactor or not to refactor? that’s the question. We all love refactoring, we’d like that old code to run faster, we’d like to make it extendable, and lastly we’d like it not so ugly. Those are the typical reasons to refactor, but as good as they are you can end up being ‘unpragmatic’. I’d like to expose some thoughts on when I think refactoring is a bad decision and which criteria are to be taken into account to decide to go for a refactoring or not.

read more »

May 16 rails Comfortable Mexican Sofa runs on PostgreSQL

tags: comfortable-mexican-sofa postgresql | comments

In the last 2 weeks I’ve being setting up a CMS for some new sites we’re building in Rails. We’ve decided to give ComfortableMexicanSofa a try, a great work by Oleg Khabarov and The Working Group. Since we’ve chosen to use PostgreSQL as our DBMS I decided to run the cms test suite of the CMS using PostgreSQL and not sqlite as it comes in GitHub in order to know whether we are not wasting our time here. The good news is: the ComfortableMexicanSofa runs smoothly on Postgresql read more »

Oct 07 Debugging liquid

tags: liquid | comments

If you have worked with liquid you surely have bumped with the difficulty to debug it. I solve it by just vendoring it to vendor/plugins and voila! now I can use debugger on every tag and drop defined in the app.

read more »

Sep 23 para.pent.es a web site for flying nuts

tags: gmaps-api geokit insoshi rails web-app-theme ym4r | comments

para.pent.es dates back to 2006, when calas, mrdias and I met. We wanted to do something with Rails, a promising web framework at that time, and we were (are) nuts about paragliding and flying.

read more »

May 28 Scanty sinatra blog: least significant bit is back

tags: sinatra sequel | comments

Least Significant Bit is back after almost a year of being playing Queen’s Don’t stop me now in our domain parking. Since it’s reborn I decided to talk about the motor behind it, a scanty, a mix of sinatra and sequel.

read more »

Jul 07 Rake task using methods in modules

tags: rake modules | comments

I normally don’t feel too confortable with the looks and manners of Rake tasks. The code looks a bit anti-DSL, and normally is not clear where to put helper methods, and also how to make them available or not to given tasks. So take a look at what I tried the other day: including modules in tasks and make them dependencies of other tasks:

read more »

Jun 22 stubbing captchas in cucumber

tags: captcha stub cucumber | comments

You use some captcha solution to avoid bots in your site, and you are a good kid and like everything well test-covered. Well, don’t sweat too much with weird solutions to validate your captcha, it’s an external thing you know, it’s pretty ok to stub it.

read more »

Jun 08 have_regexp custom matcher to check page content

tags: rspec matcher | comments

When writing expectations on pages I like to keep them loose so they break less. I normally use the have_text matcher and I can even get looser using regexps matching but even that can break due to line breaks introduced by rendering. This is what it should be in a perfect world:

read more »

May 12 Ruby Nation: Lots of RSpec syntax

tags: rspec syntax ruby nation | comments

For a week or two I was happily pleased with Jon Lark Larkowski RSpec presentation at Ruby Nation on RSpec syntax, and was eager to use that and other recommendations to improve my specs. Well it was time to test a helper in one of my Rails apps. Check it out, it is sweet.

read more »

Apr 29 hunting bugs with git bisect and submodules

tags: git bisect submodules | comments

You love git bisect to traverse your history running scripts and find where your code got broken, right? But then you find bisect is not aware of submodules don’t sweat it’s git in the end, you have the power.

read more »