ruby

irb and rails console tab completion

By chance, irb and ruby-console tab completion discovery. Made my day!irbirb(main)> t = Time.new => … irb(main)> t.m #[tab] t.mday t.method t.methods t.min t.mon t.month Rails Console>> Feed.fi #[tab] Feed.find Feed.find_all Feed.find_all_with_deprecation Feed.find_all_without_deprecation … Win XP, ruby 1.8.5 and rails 1.2.2. Google away if not on your machine. irb is incredibly underappreciated, it has a bunch of nice things...

Pyramids, Application. An Analogy

Working on maintaining and modifying a five year-old Java application, I came to realize there’s a strong relation between legacy and pyramids. Here’s an analogy: | Pyramids are HUGE monuments, built for the sole purpose of being a tomb to one person. Although the project tree is HUGE (14000+ files), the purpose of the application is amazingly modest (CRUD...

:finder_sql – single vs double quotes

This is the trickiest part of Rails I came across so far:In my has_many association I have a finder_sql that should reference the instance object id rather than the class object id. has_many :breedtypes, :finder_sql => ‘SELECT Breedtype.* FROM … WHERE (cai = #{id})’ Now, who’d ever have thought that replacing the “double” quotes I had wrapping the “Select”...

Multiple-Application Login

I’m trying to handle an integration between a humongous code-base Java application (doing basic stuff) with a new Rails application (talking about injecting Rails transparently). Handling login (multi-application logins) was my first obstacle, and after talking with Steven and Brenton, I came up with the following implementation: 123456789101112131415161718192021require ‘rubygems’require ‘hpricot’require ‘mechanize’class WelcomeController < ApplicationController… def login agent = WWW::Mechanize.new...

Rails after Ruby

Rails 1.2.3 has been released. According to Riding Rails: “This release irons out the few wrinkles there was between Ruby 1.8.6 and Rails 1.2.2. So now you can enjoy the latest Ruby with the latest Rails.” Considering that Ruby 1.8.6 has been out for only one day – Rails team seem to be dead serious about what they do...

CruiseControl.rb – Continuous Integration, the Ruby way

Once again, Ruby is revealing itself as a delivery tool. This time in the form of CruiseControl.rb – ruby continuous integration tool/application. CruiseControl.rb was the topic for this month’s Calgary Ruby Users Group (CRUSERS) meeting. Accorindg to core-contributor Alexey Verkhovsky, from Thoughworks (Calgary), it’s an ‘incarnation’ [A carefully chosen word, over ‘port’] of Cruise Control (the famous continuous integration...

Ruby on Rails – Lunch and Learn

Last Friday was my Ruby on Rails presentation at Commerx Corporation (in Lunch and Learn series). It wasn’t as good as I wanted, but, wasn’t too bad either. Some keys on the laptop were in the on-again-off-again mode, so, I had to rely on an external keyboard and use the touchpad at the same time (not a very recommended...

DHH talking

Yes! too late for most. But I’ve just came across it (remember, I was in the washing machine for a while). DHH is a definite talker [InfoQ Interview], you can’t help but to listen to every word and … enjoy it. The same as with working with Rails.

Starter Toolkit for DB2 on Rails

Finally, a progress in the DB2 – Rails front. the Starter Toolkit for DB2 on Rails has just been released. Although, we’re on a DB2 iSeries, the work required for a DB2/400 – Rails combination is doable and there’s a good chance I can sell Rails to the people here.