Selenium Takes Rails Testing to Another Level June 27th, 2007

Rails has already make testing web easier. Rails project directory has specific test directory, named surprisingly ‘test’. You want to make unit testing for model? You write it in test/unit directory. Testing for controller? test/functional directory. It has fixtures support. It means you have specific database purpose for testing purpose. Your development and production database will not be touched. It has mocks support to simulate external resources. What could you expect? Testing Rails project is a nice experience.

But Selenium takes Rails testing experience to another level. With Selenium you have user testing beside model testing, controller testing. It means you have dummy user for your Rails testing purpose. What I mean with dummy user is you have user to test your Rails web project just like you test Rails web project with browser your self. This testing type is called black box testing (external view of testing). You input data to your application and see the output. Does the output is as you expected?

Read the rest of this entry

Porting C Code to Ruby June 22nd, 2007

I try to port fsplib C library to pure ruby library. What is FSP anyway? Quoting from the official site: “FSP stands for File Service Protocol. It is a very lightweight UDP based protocol for transferring files. FSP has many benefits over FTP, mainly for running anonymous archives. FSP protocol is valuable in all kinds of environments because it is one of the only TCP/IP protocols that is not aggressive about bandwidth, while still being sufficiently fault tolerant.” It is not popular option for file transferring protocol.

So why do you want to port it anyway? Because it is a good exercise for my ruby skill. I could use it as portfolio too. Another reason is I can use this as opportunity to contribute to opensource.

I decided to port it as pure ruby library rather than binding to C api because this library does need the performance but need more portability. This is second day porting the library. Here’s what I have learned so far.

Read the rest of this entry

Haml Beautify Rails Code June 21st, 2007

Try Haml today if you use Rails. At first time, I feel reluctant. Isn’t rhtml is enough? But trying something with a little time is not a bad thing. So I jump to the boat. Here’s what I feel. It feels good.

Haml is alternative for rhtml. It is shorter. But what makes me using haml is it beatify Rails view. Usually using rhtml makes my html code (result of Rails view) cluttered.

Read the rest of this entry

Cakephp as PHP Framework June 15th, 2007

A year ago, I had a job to create company profile website for PT. Usaha Saudara Mandiri. At that time, I was Rails fans. So why not create the website with Ruby on Rails? Because the hosting does not support Ruby on Rails. So bye-bye, Rails. It means I need to use PHP. The version of supported PHP at that time was 4. I already knew that it is more convenient if you use framework than not. So I searched PHP4 framework which was similar with Ruby on Rails. I found it. Cakephp

The documentation is good but not so polished. It is similar with Ruby on Rails. So I don’t have any difficulties jumping to the Cakephp world. What annoying me is Cakephp supports MySQL only. I failed to use sqlite. What make more fun with Cakephp is they do not use any other library as dependencies. So installing and deployment Cakephp is easy.

So if you likes MySQL and Ruby on Rails but forced to use PHP (especially PHP4), CakePHP would be a good choice. The website which developed by me with CakePHP is here. Mirror is here.

Wallpapoz 0.4 is released June 12th, 2007

Actually this post is late 2 weeks. Wallpapoz 0.4 is released at 30th May. But every developer write a new post when he/she releases new version of software. So I think I need to write a post about new release of Wallpapoz. I just feel good for this release. This release represents my passion, my patience & my hard works. I started work on this release since July 2006. That is a long time. Off course, many things caused this happens. I had to finish my thesis and there were many things interrupt my schedule.

What amazed me that there are many people contributed for this release. There are five translations (Swedish, Japanese, Indonesian, French, and Spanish). One of the translator offer hosting for Wallpapoz website but there was an issue that I can not resolve. Wallpapoz has been packaged for Fedora 7. Wallpapoz has gone international!!

So will there be a new version of Wallpapoz (Wallpapoz 0.5)? I said most likely. I have couples of features needed to be implemented. Dual monitor support is the most important feature. But I need to have dual monitor before I can implement this feature. Panel applet, interface to load daemon of Wallpapoz in Gnome start up session are features that I think necessary to make Wallpapoz more superb.

What features do you think need to be implemented in future release of Wallpapoz? Write a new comment or email me.

Ruby On Vim June 6th, 2007

Vim is my religion. Vim is true programmers editor. It can be extended. It has many features. Using vim make you looks like a true hacker. If vim is a weapon, it could be used for short distance fighting (like knife or sword). But you can use it to shoot somebody (as pistol). Don’t underestimate it. Snipper can use it to shoot the president of a country in distance of 400m. You can destroy the buildings full of enemy soldiers with vim (think bazooka). With hard works of a reasonable amount of specific people, you can use vim to destroy a planet (okay, I am drunk now). But you get the idea. You can find many scripts to extend vim. But someday you need to extend vim your self.

Ruby is my favorite programming language. Ruby is fun. Ruby makes programmers happy. So why not combine them? Extend vim with ruby. I will guide you to write simple vim plugin using ruby. But you need to be familiar with vim and ruby (just be familiar is enough, no need to be a ninja).

You need vim compiled with ruby support. If you get vim from default place (from Linux distro maybe), most likely you have ruby support in vim. But I think you need to install vim-ruby package or something like that to enable ruby support for default vim. If you want to compile vim from source, make sure you have ruby development header. Don’t forget to use —enable-rubyinterp option in configure step. You can check if your vim has ruby support or not with this vim command.

:echo has("ruby")
If you get 1, you are all set. If you get 0, you have to set up ruby support first for your vim. Read the rest of this entry

Happy Birthday To Me June 1st, 2007

Two hours more (local time) then I will be 23 years old. Happy birthday to me. I got beautiful presents. First, I have released a new version of Wallpapoz (0.4) after more than a year since the last release (0.3). I am very happy with this release. This release seems make a lot of people happy. Many people send me emails telling Wallpapoz is a nice program. The numbers in Wallpapoz page in GnomeFiles.org tell it’s true.

The second present is I finally got web hosting which support rails. Today I installed Mephisto (Rails blog software). Previously I used Wordpress. But I want to hack Rails project. Mephisto is a very ideal candidate. You use software that you hack your self. Wow, that’s cool!

This morning I celebrated Vesak day. It was a nice occasion. Chanting, meditating, listening to the speech, and the most importantly for me, gathering with people who share the celebration. After that there was balloons releasing ceremony. Each balloon carried wishing (for peace, I thought) written in small card tied bellow the balloon it self. What made Vesak so special today is it could be the last Vesak I celebrated in Jakarta because I plan to move to Denpasar this year. Why would you want to celebrate Vesak if you don’t live in Jakarta anyway? This is the third present.

Before my birthday, I already got three presents. Do you want to add presents for me?

Happy birthday, Akbar. I love you so much.