RubyEnRails 2007

on June 12, 2007

Last Thursday was the second RubyOnRails conference in the Netherlands. Conveniently, it was four minutes walking from my apartment in Amsterdam. RubyEnRails was organized and sponsored by recruitment companies that have RubyOnRails fever. The main sponsor was Adnexus the company by Brett Dawkins, a very active Dutch RoR scener.

Conference day

The conference was opened by Dr Nic Williams who gave two nice lectures that day. I knew Dr Nic because he has a nice blog and made nice comments about my Shuriken script. It appears Dr Nic is very fond of extending the syntax of Ruby by using 'magic' tricks like methodmissing or constmissing.

There were about 200 people at the conference. There was a mixed audience of PHP developers, Java developers and Sysop gothics. Also there was a fair percentage of recruiters, some of them with no clue. What really surprised me was the low amount of people that had actual production experience with rails. I suspect there weren't more than 20. During the lunch break, Dr Nic even admitted that he codes Java for a living.

Interesting cases

There were two interesting real-life cases nonetheless:

  • Wakoopa.com, a 'what software do you use' social networking site by Robert Gaal (blueace.nl)
  • Nedap's MovesOnRails, a health-care planning application by the Dutch Devices Factory Corp (Nederlandse Apparatenfabriek).

Also, I had a fruitful conversation with the director of Nedforce, someone who really does have a clue.

Noted techniques

These are some things that I heard and are more or less new to me:

  • BackgrounDRB a distrubuted ruby job scheduler for rails
  • Asset Packager a rails plugin that compresses your CSS/JavaScript
  • multi-page (MovesOnRails) They invented this thing that allows you to navigate your layouts like a book. Still waiting for some code though.

Noted tools

  • monit server monitoring tool
  • munin server monitoring tool
  • pingdom.com server monitoring tool 2.0, with SMS notification which is nice for in Europe
  • mailroom a webapp that facilitates mail interaction with team and customers (not quite sure what it is yet, but people like it)

Nintendo Wiiii bakatachiiiiiii :-)

This article is located here, at my joint entrepreneurial blog.

First some notes about IDE’s.

The Knight versus the Ninja

kletch…. kletch…. a loud noise of kletching metal combined with slight floor vibrations left the hall. It was The Knight. His scarred and angry face showed that he was a well experienced warrior, ready for another day of combat for the greater collective cause.

shhh…. shhhh…. what was that? It was probably just the wind. The next day we found the victim dead, with a shuriken-metal-star in his head. The Ninja has made another kill, fighting for the feudal ruler.

If you are the Knight, click here. If you are the agile Ninja, read on.

Using IRB and the Rails Console

A little while ago I read this great article about the Secrets of the Rails Console Ninja’s

My current Rails job in Tokyo required me to use the RadRails IDE on Windows to work on a legacy part the first weeks. The constant switch between script/console, RadRails and my browser inspired me to merge the first two. (Also, sometimes I got rails errors because of :wq symbols in wrong places ;)

I’ve named it Shuriken (the ninja death star) the tool for Rails Console Ninja’s.

You can download it as a .irbrc file which you can just place in your homedir.

download .irbrc

Shuriken

Downloading shuriken, place .irbrc in your homedir.

dodo@membrane$ wget http://www.darkwired.org/~dodo/.irbrc
Create a project or use an existing one and startup the console.
dodo@membrane$ rails webapp > /dev/null; cd webapp
dodo@membrane$ ./script/console
Loading development environment.
Loading IRB shuriken technique
rails development>>
Creating a controller from IRB, after creation we can use it right away.
rails development>> script/generate controller skinny info
      exists  app/controllers/
      exists  app/helpers/
      create  app/views/skinny
      create  test/functional/
      create  app/controllers/skinny_controller.rb
      create  test/functional/skinny_controller_test.rb
      create  app/helpers/skinny_helper.rb
      create  app/views/skinny/info.rhtml
# => true
rails development>> SkinnyController.instance_methods.index("info")
# => 175
Display an overview of controllers:
rails development>> map controllers
  SkinnyController
# => "app/controllers" 
rails development>> map c
  SkinnyController
# => "app/controllers" 
Use vim – the editor from heaven – to open the controller
rails development>> vim skinny_controller
# => "app/controllers/skinny_controller.rb" 
Displaying views (models is also possible)
rails development>> map views # or 'map v'
  Layouts
  Skinny/Info
# => "app/views" 
Using subversion ‘svn ste’ is an alias for: “svn status | grep -v ’?
rails development>> svn ste '" 
A      .
A      README
M      app/controllers/skinny_controller.rb
# => "app/views" 
Executing commands.
rails development>> !uname
Linux
# => true
Unit testing (or selenium testing).
rails development>> map tests # or 'map t'
  Functional/SkinnyControllerTest
# => "test" 
rails development>> rake test
...
Running in production mode:
dodo@membrane$ ./script/console production
Loading production environment.
Loading IRB shuriken technique
rails production>>

TODO

  • get feedback from users
  • add these commands to IRB auto-completer (readline)
  • add more useful stuff, then cleanup code

My English vocabulary is relatively small since it’s not my native language. Often I read materials on the Internet and sometimes I have to lookup some terms. If I wouldn’t lookup these new words, I will never learn them.

Secondly, it often happens that I know the meaning of some concepts, but I would like to know more about them. Lookup everything takes a while, which will disturb your mental model while reading.

This is why I started working on a little project to embed the knowledge of the Web in the reading process. I’m developing this thing in a pragmatic way using RubyOnRails. The main objectives are: I’ve just finished these objectives, which required writing a little HTML parser and an interface to use the Python NLP toolkit (which is far more superior then Ruby’s).

  • Providing the content with a simple piece of code that can make any piece of HTML smarter.
  • Using Natural Language Parsing (NLP) to pick out the important words.
  • Using Princeton’s WordNet to explain basic concepts.
NLP screenshot Wordnet screenshot

At the moment I’m refactoring the code so it can be distributed as a RubyOnRails plugin. For the near future the following features are on my TODO list:

  • Interfacing with the Wikipedia encyclopaedia.
  • Detecting concepts like ‘Software Engineer’ rather then detecting ‘Software’ and ‘Engineer’.
  • Looking for alternatives forms of user/reading interaction.

Current code: laboratoire_nuage-101206.tar.gz (or browse)

Requires: Python-NLTK, Ruby-Linguistics, Ruby-WordNet and RubyOnRails