Andreacfm - andreacfm.com - Andrea Campolonghi

Latest News:

Fake xhr request from rspec 1 Mar 2013 | 05:36 am

I discovered today that I had no idea of how to fake an xhr request in an Rspec controller test. I need this cause some of my layout strategy behaves on the request.xhr? method. As expected Rspec sol...

ruby alias vs alias_method 29 Nov 2012 | 01:00 pm

While alias and alias_method looks very similar at first they hide a substantial different behaviour. Look at the following code. This is the the basic behaviour we could expect from the alias method...

Railo 4 beta released 3 Jul 2012 | 09:40 pm

Railo 4 beta has been released. See more info in Railo blog. Many improvements and new features: closures rest support loop and cfloop enhancements better Application.cfc management function cach...

Redis cache extension for Railo 18 May 2012 | 09:24 pm

I have recently had occasion to work with Redis and I got really impressed by how is fast and reliable. Redis is a nosql key/value store quite commonly used in the Ruby world where I am digging these ...

Rspec rails views tips 22 Apr 2012 | 12:00 pm

In the last days I faced some new challenge in testing rails views with rspec. Here is what I learned. I am useing the veru handy rails controller prepend_view_path helper to be able to choose dynami...

Ruby tip. Double association in a ternary operator 9 Feb 2012 | 01:00 pm

I found myself today in the opportunity to use a double association in a ternary operator. Basically I wanted to assign 2 variables based on a certain condition. Normal ruby double assignment works ea...

Rails migration redo 29 Jan 2012 | 01:00 pm

A very good practice, when writing a rails migration, is to be sure that the down methods works as expected. Once the migration is ready you should make it run and, if anything is fine, you should  ro...

Monitor resque workers via upstart 11 Jan 2012 | 01:00 pm

Resque is a Redis-backed Ruby library for creating background jobs, placing them on multiple queues, and processing them later. Resque works firing up a set number of workers than will coninuously loo...

Git rebase --onto to the rescue ( part 1 ) 3 Nov 2011 | 11:00 am

I am now using git since more than a year as my primary scm. I tend to use it also against svn repo,  I can so focusing on git  becoming always more comfortable using it. To be honest up to now my gi...

Make your ruby classes Comparable and Enumerable 27 Jul 2011 | 12:00 pm

Something very cool in ruby are mixins. As the word says mixin is a technique to mixed a module into a class using the statement “include”. While including a module is a very large topic I focused on ...

Recently parsed news:

Recent searches: