Archive for the ‘Tutorials’ Category
If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!
Aquarium is a framework that implements Aspect-Oriented Programming (AOP) for Ruby. The premise of AOP is that some concerns in an application will cut across the natural object boundaries of the problem domain. Rather than scatter duplicated code in each object to handle the cross-cutting concern, AOP modularizes the specification of which execution points are affected (called join points) and the actions that should be invoked at those points.
New in V0.4.0: Preliminary support for advising Java classes in JRuby! See the discussion here.
Author: ceefour | Filed under: JRuby, Reviews, Ruby, Tutorials
Tags: Aquarium, java, JRuby, Programming, Ruby

Upgrading to the latest RubyGems in Ubuntu Gutsy is a bit non-straightforward. I’d like to share a quick fix this time. It’s trivial when you know it, but if not, a friend of mine has almost hosed his system just because of this annoying “bug”.
Installing Ruby in Ubuntu is pretty simple:
sudo aptitude install ruby ri irb rdoc rubygems libruby-extras libmysql-ruby ruby1.8-dev
(add other packages as you see fit)
The problem occurs right after you upgrade RubyGems to the latest version:
sudo gem update --system
Then you get something like this:
Author: ceefour | Filed under: Beginner, Complaints, Ruby, Tips, Tools, Tutorials
Tags: error, fix, gem, gems, gutsy, installation, rubygems.ruby, troubleshooting, tutorial, ubuntu, update, upgrade
Recently I got a task which involves moving, or let’s say copying, an entire Subversion repository with history to another server. Problem is, I didn’t have access to the server itself, which means I couldn’t do a regular “svnadmin dump”.
SVK comes to the rescue!

To make it work, first of all you need to install SVK. In Ubuntu it goes like this:
sudo aptitude install svk
When you first run svk it’ll ask you to create a local depot, you can simply agree to its suggestion.
Author: ceefour | Filed under: Cool, Opinions, Tips, Tools, Tutorials
Tags: dump, export, import, load, migrate, migration, repository, subversion, svk
A common stumbling block for beginner Rails developers is learning the basics required to write plugins. This is made more complicated by the fact that Ruby is inherently dynamic and offers many techniques for code reuse.
Luckily, if you can write Rails applications you can write plugins by simply drawing on a handful of basic patterns.
Why write plugins?
Writing a plugin will:
- Help make sharing code more efficient, whether it’s between projects or within the same project
- Allow you to publish generic code to the community
- Save time and increase your confidence by testing once and reusing many times
Author: ceefour | Filed under: Beginner, Plugins, Rails, Tips, Tools, Tutorials
Tags: 294, 296, 344
The goal of Portable Ruby is to reduce those updates to a single place, your USB drive. About.com describes how to make this possible:
Installing Ruby
The easiest way to setup a Portable Ruby application is to start with an existing Ruby installation. I recommend the One-Click Installer. If you haven’t done so already, go ahead and install it.
The entire Ruby distribution is created in a single “ruby” directory structure. Additional changes include the creation of shortcuts for the start menu, which we will simulate in the PortableApp menu. The One-Click Installer also updates the Windows PATH environment variable to include the ruby\bin directory.
Author: ceefour | Filed under: Cool, Reviews, Ruby, Tips, Tools, Tutorials
Tags: 299, 300, 320, 323, 338, 345, 346
We’ve been doing a lot of scraping and mashups lately. So we’d love to share on how to do this. Fortunately Schadenfreude has written a good tutorial about using Mechanize and Hpricot to scrape Gmail.
The tutorial uses mechanize and hpricot to login to gmail and return a list of Unread emails.
Installation of required tools
gem install mechanize --include-dependencies
This will install both mechanize and hpricot.
Usage
Author: ceefour | Filed under: Beginner, Cool, HTML, Plugins, Praises, Rails, Ruby, Tips, Tools, Tutorials, Web 2.0
Tags: 302, 326, 329, 336, 337, 354, 364

Sinatra is a new cool open-source DSL-driven web application framework!
This super-sexy DSL runs at lighting speed. It sits on top of Mongrel and was written to be thread-safe, sleek and tiny. And an entire web-application can be written and contained in one file (or a small collection of files)!
It’s super easy to use! Let’s create an app from scratch to demonstrate!
Install!
gem install sinatra -y
Use!
Author: ceefour | Filed under: Books, Cool, HTML, Rails, Ruby, Tools, Tutorials, Web 2.0

microformats has been only two years old, yet it has brought significant changes in a relatively short time.
What is it, actually? According to microformats.org, “[microformats is] designed for humans first and machines second, [they] are a set of simple, open data formats built upon existing and widely adopted standards.”
Enough with the fluff, let’s see how it actually works, microformats in action:

Flickr picture source
The above picture is me browsing to the LinkedIn profile of one of Indonesia’s renowned Ruby on Rails experts, Arie Kusuma Atmaja. The overlay window that contains these semantic information is not a LinkedIn feature. Rather, it is the easily usable, cross-browser Microformats Bookmarklet by LeftLogic. Go on… try it if you haven’t!
Author: ceefour | Filed under: Ajax, Beginner, Books, Cool, Friends, HTML, News, Opinions, Plugins, Praises, Rails, Reviews, Ruby, Tips, Tools, Tutorials, Web 2.0
Just out from a pack of several of the world’s greatest Ruby and/on Rails programmers: Professional Ruby Collection: Mongrel, Rails Plugins, Rails Routing, Refactoring to REST, and Rubyisms.
GET STRAIGHT TO THE LEADING EDGE WITH RUBY AND RAILS
Information that’s so hot, new, and valuable, you can’t wait for a book. This package brings together 8 breakthrough primers on today’s most valuable Ruby and Rails technologies — including five new digital Short Cuts worth $69.95! From RailsSpace to ActiveRecord to Mongrel, here’s new content, techniques, and code from the Ruby community’s top innovators: insider’s information that’s never been available before in one place.
Author: ceefour | Filed under: Ajax, Books, Cool, E-commerce, Enterprise, News, Praises, Rails, Reviews, Ruby, Tips, Tools, Tutorials, Web 2.0
Some people asked me about SVK so here it is. Quickly written because I am a bit lazy and sleepy right now.
SVK is a distributed version control system. In other words, it allows you to mirror a Subversion repository, have local commits, pull changes from upstream, and synchronize/merge it back to the remote Subversion server if you want.
English version
UPDATE: This is an outdated version. The most up-to-date version with newer tips and tricks is in wiki Ruby Indonesia: SVK, which unfortunately is only available in Indonesian.
Method 1: Use Subversion repository, but SVK working copy