Ruby Weekly is a weekly newsletter covering the latest Ruby and Rails news.

Author Archives: Hendy Irawan

About Hendy Irawan

Ruby programmer from Indonesia.

By Hendy Irawan / May 24, 2007

Classifier is a Ruby gem developed by Lucas Carlson and David Fayram II to allow Bayesian and other types of classifications, including Latent Semantic Indexing.

Bayes classifier is a probabilistic algorithm which apply Bayes’ theorem in order to learn the underlying probability distribution of the data. One popular use for this is implemented in most spam filtering packages.

It can also be applied to many other cases of machine learning to make your Ruby application more intelligent (the complicated implementation is transparently handled for you, thankfully!) Ilya Grigorik recently posted an interesting tutorial on Bayes classification, with an easy-to-follow demonstration on how to use it for distinguishing between funny vs. Read More

By Hendy Irawan / May 22, 2007

Handshake, currently in version 0.3.0, is an informal design-by-contract system written by Brian Guthrie in pure Ruby. It’s intended to allow Ruby developers to apply simple, clear constraints to their methods and classes.

Handshake is definitely welcome alongside the ever-increasing number of test-driven and behavior-driven design/development based tools, such as RSpec and test/spec.

Some examples of Handshake contracts (from its documentation):

# An array that can never be empty.
class NonEmptyArray < Array
include Handshake invariant { not empty? }
end

# An array to which only strings may be added.
class NonEmptyStringArray < NonEmptyArray
contract :initialize, [[ String ]] => anything
contract :<<, String => self
contract :+, many?(String) => self
contract :each, Block(String => anything) => self
end

Visit Handshake project page and Rdoc documentation for more information. Read More

By Hendy Irawan / May 18, 2007

Twitter-1

You’ve heard of Twitter, an online service that allows you and your friends to communicate up-to-the-second by sending short messages. Twitter has built-in features to deliver the updates to your instant messaging account (such as Google Talk) or to your cell phone. Yesterday we covered real-time Flash visualization of RailsConf twitters.

Want to incorporate Twitter functionality into your own projects? Enter the Twitter gem by John Nunemaker. Observe:

# to post an update to twitter
$ twitter post “posting from the twitter gem”

# to see you and your friends timeline
$ twitter timeline

The command line interface is very simple, and configuring it is easy using a YAML file. Read More

By Hendy Irawan / May 17, 2007

Gibberish is a Rails plugin developed by Chris Wanstrath which provides a hassle-free text translation capability for your Rails applications. The first application to use it is the Beast forum system.

Most localization tools use either key-string or original-message based translation. Gibberish strikes the balance between these techniques. Consider:

<%= “See you!”[] %>

By default, the translation keys use lowercase and underscored version of the original message, but a key can be provided as a symbol within the [] construction. Translation files are made up of simple YAML. An example id.yml for the above message would be:

see_you: Sampai jumpa!

If you’re wondering about parameters in a message (e.g. Read More

By Hendy Irawan / May 10, 2007

ZK is a popular open source Ajax framework written in Java. It simplifies rich web applications by treating the browser as a simple display server, which reduces the need to have lots of application logic. It’s Java, so why it’s in RubyInside?

The interesting part here is that recent versions of ZK (version 2.3.1 as of this writing) support more languages for its ZUML markup, in addition to Java: JavaScript, Groovy, and Ruby. ZUML is an XML-based markup language to create user interfaces very similar to the desktop GUI component/event driven model.

Being Java, ZK’s Ruby engine is powered by JRuby, which is already quite mature. Read More

By Hendy Irawan / May 10, 2007

Joyent Slingshot LogoJoyent Slingshot allows developers to deploy Rails applications that work the same online and offline (with synchronization) and with drag into and out of the application just like a standard desktop application. Check its two-minutes tutorial to get a feel of how you can make it work.

Earlier this month, they finally released Slingshot to the public. They also celebrated it with a contest offering their $1250-worth Accelerator for the prize.

We’ve posted about Slingshot before it was officially released. In addition to stabilizing the overall framework, they also have made several enhancements, including the decision that they will open source the technology (planned for June). Read More