Archive for the ‘Ruby on Rails and Software Development’ Category
Posted by Rahoul Baruah on December 21st, 2009 under General, Ruby on Rails and Software Development Tags: activerecord, adaptive server anywhere, ruby, sybase, windows •
Comments Off
Just don’t ask why I know this. Please. It’s making me cry.
Install Ruby using the One Click Installer.
Install the ODBC module (by copying the SO files into the c:\Ruby\1.8\i386-mingw32 folder).
Install the ActiveRecord ODBC adapter (gem install activerecord-odbc-adapter).
Edit C:\Ruby\lib\ruby\gems\1.8\gems\activerecord-odbc-adapter-2.0\ lib\active_record\connection_adapters\odbc_adapter.rb – look for line 1588.
Change the line from elsif dbmsName =~ /SQLAnywhere/i [...]
Posted by Rahoul Baruah on November 24th, 2009 under Ruby on Rails and Software Development Tags: Amazon S3, attachment_fu, filesystems •
Comments Off
attachment_fu may not be the in-thing any more but there are still a lot of sites out there using it. And every now and then you realise, far too late, that you should have used S3 instead of the local filesystem.
Switching is easy – just change the :storage parameter to :s3. [...]
Posted by Rahoul Baruah on November 12th, 2009 under Beautiful Code, General, Ruby on Rails and Software Development Tags: bigwig, brightbox, caius durling, david smalley, delphi, object factory •
Comments Off
I think Bigwig has become my favourite bit of code that I’ve ever worked on.
Before Bigwig, it was Object Factory, before that it was a Delphi class that I used to create tree-structured data (imaginatively called TNode).
Bigwig’s doesn’t have a test suite and it’s not even my code – it was [...]
Posted by Rahoul Baruah on October 6th, 2009 under General, Ruby on Rails and Software Development •
3 Comments
Github aren’t building new gems at the moment as they finalise their move to Rackspace. So what do you do if you’ve got a gem that you would like to make available?
Gemcutter’s the new kid on the block – it works as a set of plugins to the gem command that mean [...]
Posted by Rahoul Baruah on October 5th, 2009 under Ruby on Rails and Software Development, Writing Reliable, Bug-Free Code Tags: Bug-Free Code, bugs, cucumber, logging, rails, ruby, Writing Reliable •
Comments Off
We just had some customers report a bug. Not good. We didn’t get an exception email. All the tests passed. We couldn’t see anything untoward in the log files. But it was there. We could reproduce it, both in staging and in production. Not good at all.
But the weirdest thing was we couldn’t [...]
Posted by Rahoul Baruah on June 3rd, 2009 under General, Ruby on Rails and Software Development Tags: constructors, language, ruby •
3 Comments
Today, Caius made a discovery that shocked me.
He had a class, descending from ActiveRecord::Base, with a custom constructor (initialize method). To debug it, he had the constructor raise an exception. In the console, Thingy.new(params) raised the exception as expected. But wotsit.thingies.find_by_field(value) did not. Even though it was instantiating an [...]
Posted by Rahoul Baruah on June 2nd, 2009 under General, Managing Successful Projects, Ruby on Rails and Software Development Tags: branches, commits, git, source control •
3 Comments
I always forget how to do this so I’m writing it down (especially as it’s really easy and git, as usual, makes me feel stupid as Linus is so much smarter than me).
Suppose you’ve been working in branch X and you’re about to merge those changes into branch Y …
work in branch X [...]
Posted by Rahoul Baruah on June 1st, 2009 under General, Ruby on Rails and Software Development Tags: clusters, deployment, logger, rails •
Comments Off
A project I’ve been working on was recently moved up to Rails 2.2 (Rails 2.3 migration coming soon, but we wanted to take things one step at a time).
All the tests passed. Poking it on the staging server worked well. On to production and all was good.
Time passed. [...]
Posted by Rahoul Baruah on May 15th, 2009 under Designing Great Software, Managing Successful Projects, Ruby on Rails and Software Development, Writing Reliable, Bug-Free Code Tags: cucumber, design, estimates, project planning, requirements gathering •
Comments Off
Writing estimates up-front is a really tricky part of client work.
From the customer’s point of view it’s pretty essential. You need to know how much you are spending before the work begins so you don’t get stung.
From the developer’s point of view it’s pretty difficult to do because [...]
Posted by Rahoul Baruah on May 8th, 2009 under Ruby on Rails and Software Development, Writing Reliable, Bug-Free Code Tags: Bug-Free Code, database, rspec, transactions, Writing Reliable •
Comments Off
I have just written a load of test code that needed to verify that a particular set of classes behaved correctly when a transaction was rolled back.
However, the rest of my suite relied on transactional fixtures (which is Rails’ badly named way of saying that a transaction is started before each test and [...]