Category Archives: Ruby

Feature added to RubyCocoa Regular Expression Checker

Get the new app in the Box widget (to your right). This version lets you see the string(or substring) that was matched. I have not tested this extensively. The usual disclaimers apply.

Enabling folding in Vim, especially for Ruby

I was originally going to release my .vimrc on the blog, but I’m in the process of repairing it up right now–so it might just confuse people. I will release it at a later time when it is stable(I cleaned it up to get rid of a problem I was having after creaing the ShowMeDo videos, in which i inadvertently destroyed the folding setup). Meanwhile, most of my file is derived from Amir Salihafendic’s vimrc file, available here.

A couple of things I changed from his suggestions:

  1. (Mac OS X only) I put the helper directory contents directly in the package contents
  2. (possibly Mac OS X only)I turned off lazy redraw

Meanwhile, I was able to recover most of my folding stuff with the following commands. here is how folding should work(put this in your .vimrc–without the numbers of course):

  1. set foldenable
  2. set foldmethod=indent
  3. set foldlevel=1

That last line depends on your shiftwidth, which you can set by set shiftwidth=2, for example. For a shiftwidth of 2, set foldlevel=1 seems to work fine. Also, for some reason, even though I enabled folding with the first command above, I still have to type in zC in command mode to see the folding.

Hope this helps.

Major RubyCocoa update

Very nice update and a new wiki based site for RubyCocoa. Check out the new version. The documentation seems to be better, etc. I’ll be updating my little Regular Expression utility so that potential users don’t have to download RubyCocoa to actually run it. I’ll keep you posted.

It looks like other RubyCocoa programmers can register and contribute to the community through the Wiki on the website.

In other news, BridgeSupport offers a framework for helping create new bridges between language “X” and Cocoa. A nod from Apple to the bridge developers.

(news from Daring Fireball and MacResearch)

Learning Ruby using Unit Tests

John Gruber at Daring Fireball points to Mike Clark’s blog post regarding Mike’s idea that writing unit tests is a good way to learn a language. My Ruby Screencast #6 at ShowMeDo talks about this as well, and provides some sample code, in case anyone is interested.

Ruby Tutorial II

Ruby tutorial II has been posted here. You can download the tutorial and the source code from the Box widget on the right or left(called tutorialarchive.tar.gz–drop a comment if you can’t find the Box widget for some reason). Please let me know if you find the tutorials useful.

Ruby on a Page

I found this very nice handy reference for Ruby here(works best on Firefox, it seems):

You just put the mouse focus on the page and start typing to search for what you are looking for.

Ruby Tutorial I

I wrote an Introduction to Ruby tutorial. You can find it at my webpage here or at MacResearch here.