Since Timeout::Error is not a subclass of StandardError, you’ll need to do something like this to catch the exception:

  rescue StandardError, Timeout::Error => e

Not too much fun, but it certainly didn’t make me as angry as the guy I linked to above ;-)

Another Merb breakage after upgrading. Thanks to some Japanese guy I figured how to solve this one. You’ll need the addressable gem in version 1.0.4 and to add this to your dependecies.rb:

dependency "addressable", '1.0.4', :require_as => 'uri'

before the dm-core dependency.

See this pastie; I just ran into this issue. Good I knew about the problem already from worrying but interesting David Majda’s presentation.

I think one of the greatest contributions of the Merb guys is spreading the message that Ruby is not slow. Even Rails is faster than most mainstream PHP frameworks. Wow.

(I looked up the research they refer to to see if they don’t cheat by comparing Rails and Merb to CakePHP. They don’t, it is the fastest PHP framework from the sample group.

[UPDATE: Nope, was wrong; please read the comments.])

Not caring about warnings is bad. Broken windows do matter. Here’s how to avoid this one:

 warning: already initialized constant C

Simply define the constant only if not yet defined:

C = 'value' unless defined?(C)

Duck typing is like sharp knives: You do need protect yourself. If you don’t, you end up with this:

function propagate_artist(element) {
    element = $(element);

instead of this:

function propagate_artist(element_id) {
    element = $(element_id);

Too subtle for you? Can I please not work with you then?

You might have the same problem I had with using daemonize (might be with anything else, too): File.dirname(__FILE__) doesn’t work after right daemonizing.

Although I haven’t been able to catch the exception message or whatever info, I’m almost sure the problem is that daemonize does a Dir.chdir “/”. Try run this script from a file in any directory and it will always print “/”:

Dir.chdir "/"
puts File.expand_path(File.dirname(__FILE__))

Anyway, save the path to the directory before daemonizing and you’ll be fine.

Our PBX/IVR web-based generator Telfa has been moved from Asterisk to Freeswitch. Why?

Asterisk just seems to come from a different world than what I am used to. Inflexible and problematic. Very long configuration files with ancient syntax. Now I’m far from pretending I’ve used Asterisk enough to understand it pros and cons well, but I have a decent software development experience and I can tell when something “smells.” I didn’t want to build our system (that I want to be flexible and scale well) on some old technology that is only living from its past.

And (most importantly) there are many people experienced with both Asterisk and Freeswitch favoring the latter: Anders Brownworth, Jonathan Palley (creator of Telegraph, a Rails plugin that lets you talk to Freeswitch), or of course the creator of Freeswitch (and former Asterisk developer!) Anthony Minessale himself.

>> a = [1, 2, 3]
=> [1, 2, 3]
>> i = 'i will want to use this'
=> "i will want to use this"
>> a.each do |i|
?> puts i
>> end
1
2
3
=> [1, 2, 3]
>> i
=> 3

Should not be there in 1.9, the variable i should be local for the block.

The Sinatra framework is fun. For one page but dynamic site like the one I just built (Livispace company web site) it is ideal. Very simple; you don’t generate any files you won’t use, but still have the separation of views/controllers/models (called the MVC pattern by some;).

Now will need to figure out how to deamonize (and start/stop) cleanly. Seems like God might help.