Find the source location of a method in your project

Ruby/Rails project sometimes make it hard to find the source location of a method. Sometimes, Duck typing, meta-programming and just plain bad design make it really hard to find where a method was defined and how. Luckily, there’s an easy way around this. So, here’s an example. A few moments ago, I came across this line: First thing I did (obviously) was going to the user class and searching for this method....

April 12, 2012 · 2 min · admin

Testing the Notifier class with Rspec

Today, I needed to spec the Notifier (mailer) class in a Rails project. I don’t mean to spec the view, I just needed to test if the Notifier class method was being called with some params. For example, I had this user story As a User When I am an owner of an issue And the issue status changes I want to get an email...

April 8, 2012 · 1 min · admin

Run your specs in logical groups

I stumbled upon this StackOverflow question: testing – Organizing rspec 2 tests into ‘unit’ and ‘integration’ categories in rails – Stack Overflow. Basically, the guy asks how he can run specs isolated into logical groups, running the unit without running the integration and so on. At Gogobot, we have exactly that, since we run our specs in the CI, we can decide which to run, and they run one after the other and dependent on each other, so if you fail UNIT, the build fails, no need to continue on....

April 5, 2012 · 1 min · admin

With GOV.UK, British government redefines the online government platform – O’Reilly Radar

Reading this article made me realize there’s hope in making government sites better. The state of the government sites in Israel for example is shameful, all written in .Net, no standards and no cross-platform consideration. It’s a very good read. Why create an open source stack? “Why not?” asked Bracken. “It’s a government platform, and as such it belongs to us all and we want people to contribute and share in its development....

March 30, 2012 · 1 min · admin

Submit any form with a keyboard shortcut

Say you have a simple form like “Add comment” similar to this imageAdd comment formNow, this is a text-area, so the ENTER key will break rows and will not automatically submit the form to the server. I want to create a flexible way to send the form to the server with a keyboard shortcut like CTRL+ENTER. Thanks to an awesome library by Thomas Fuchscalled KeyMasterit turned out to be quite simple....

March 27, 2012 · 1 min · admin

Yehuda Katz : Tradeoffs and Choices, Why Ruby isn’t Python | RuPy :: Strongly Dynamic Conference on Blip

This video is a bit on the longer side definitely, but if you are a Ruby developer (not a beginner), you will find this talk very interesting.

March 21, 2012 · 1 min · admin

Remote Pair Programming – Remote pair programming resources, articles, and thoughts.

I have been a remote programmer for a while now (over 3 years), working across time-zones (10 hours difference in many cases). I used this blog a lot as an inspiration and took many great tips. If you are into remote programming and you have remote workers, you should read the posts in this blog. Remote Pair Programming – Remote pair programming resources, articles, and thoughts..

March 16, 2012 · 1 min · admin

14 Ways to Contribute to Open Source without Being a Programming Genius or a Rock Star

Contribution to open source has a myth around it. People think that “contributing” means changing huge chunks of the code, and being a genius. It’s actually not the case, documentation for example is a huge contribution to open source, sometimes scratching your own itch with changing a single method is also contribution. Find something you like and work with every day, and when you encounter a bug, or a need for something, try and implement it....

March 14, 2012 · 1 min · admin

Pull Request #5340: Added wrapper tag for simple format, added test by KensoDev · rails/rails

Following my latest post about the simple_format, I think that it’s broken to assume only “p” tags are valid wrappers. So, I opened a pull request to Rails itself. Basically, it changes simple_format so you can pass in the wrapper tag you want, I found myself wanting a “div” or a “span” too many times. Pull Request #5340: Added wrapper tag for simple format, added test by KensoDev · rails/rails....

March 13, 2012 · 1 min · admin

Essential Sublime Text 2 Plugins and Extensions | Nettuts+

I switched from TextMate to Sublime Text 2. Been using it for months now and it keeps surprising me with how fast, smooth of an experience it is. If you are still using TextMate or something else, you need to look at this post. Essential Sublime Text 2 Plugins and Extensions | Nettuts+.

March 12, 2012 · 1 min · admin