Archive for the 'Ruby' Category

Sat
1
Apr '06
Errorhandling Ruby vs. Java
by Frank Spychalski filed under articles, Computer, Java, Rants, Ruby


At my daytime job I had to rewrite a class which sends a Message to a Queue. Sounds simple? With EJB3 it is reasonably simple and can be done in around 10 lines of code involving lots of lookups. But if you are looking for a reliable solution which works even when the application server reboots every once in a while your code gets messy. My current solution has 120 lines of code and there are still some things to add like buffering of unsent messages. Read the rest of this entry »


Sat
18
Mar '06
Ruby Hacking Guide
by Frank Spychalski filed under Ruby

Vincent Isambart started a project to translate the japanese ‘Ruby Hacking Guide’ into English. As I don’t speak Japanese (well, I learned it for 2 years in school, but that was a loooooooong time ago in a galaxy far, far away) and have little experience in C, I would be no help. But I think this is a worthwhile project and hope he will find enough people to help him finish it.


This tutorial shows how to use distributed ruby to connect a rails application with another ruby service not running inside Rails. Read the rest of this entry »


Thu
9
Mar '06
JEdit Ruby Editor Plugin
by Frank Spychalski filed under Ruby

I finally found an editor which supports code completion for Ruby called JEdit with the Ruby Editor Plugin. I don’t know how they do it, but it’s working pretty good…

The instructions forget to mention, that you need the ErrorList, ProjectViewer and SideKick plugins, but at least these plugins were easy to find and install with the built-in plugin manager.


Mon
6
Mar '06
Useful test for Rails functional tests
by Frank Spychalski filed under Rails, Ruby, Work

Evil folks and stupid users expose webapplications to requests no sane developer usually expects. To find methods that cannot cope with unexpected input I added a simple test to my current Ruby on Rails project. The test calls all public actions via all http actions and uses some dummy parameters. There are no assertions in this test, because I don’t know if an action should succeed or redirect. The only thing checked with this test is that the action does not fail.

[tags]ruby, rails, tests[/tags]


Thu
2
Mar '06
I guess I have to order some T-Shirts soon :-)
by Frank Spychalski filed under Fun, Ruby

Have a look at these nice Ruby T-Shirts: Read the rest of this entry »


Sun
26
Feb '06
Rails (or rake?) problem with appdoc target
by Frank Spychalski filed under Ruby

When I tried to build the documentation for my current RoR project, I got this (not very helpful) error message:

The same call had worked fine yesterday. Fortunately, I remembered having updated the gems because of another strange problem (which wasn’t solved by the update – but that’s not the point).

After I removed the newer rake (gem uninstall rake -v 0.7.0) my problem was gone. Could anybody explain me if this is a Rails (I’m running 1.0) or rake problem or is it just bad karma?

Update

Seems like it was a Rails problem. I found a fix for it.

[tags]ruby, rake, rails[/tags]


Sat
25
Feb '06
Ruby On Rails Annoyance
by Frank Spychalski filed under Ruby

Ruby on Rails has a pretty good template-system. You can use these templates for HTML output, XML output or if you want to send mails. But for reasons probably only known to David Heinemeier Hansson the method url_for cannot be used in ActionMailer templates.

[tags]ruby, rails[/tags]


Wed
4
Jan '06
Ruby on Rails cheatsheet
by Frank Spychalski filed under articles, Ruby

A growing list of things I don’t want to forget… Read the rest of this entry »