bookmark_borderReporting the first full day Ruby Event in India: The Ruby FunDay

The First Ruby FunDay was held at Impetus Technologies, Noida on 22nd November 2008.

There was a lot of Ruby and a lot of fun.
It was an exciting event with a good number of developers in attendance.

People from various companies already working on Ruby formed the largest part of the attendees. Then there were a few Java programmers, who had come to checkout ruby or so it seemed to me. Also there was a group of students from PantNagar College of Technology. I really appreciate their coming all the way from PantNagar for the Ruby FunDay.

The event started off with Sur doing a presentation on Ruby, though he intended to cover metaprogramming, but a battery of questions from the audience didn’t allow him to go beyond the basics. Particularly developers from a java background were having a hard time embracing Ruby’s open classes and duck typing. Everybody enjoyed Sur’s session a lot as he let code answer audience questions.

Then we had a presentation from Aditya Babbar of Impetus Technologies. He talked about the problems faced in deploying and managing a Rails app. He didn’t speak about only the problem, but demoed a solution which Impetus has worked on to alleviate that pain.

Sid showed us how he used to make a Rails app multilingual using Gibberish before Rails added I18n support. Then he showed how life had become easier with Rails 2.2’s in-built internationalization support. His slides are online at slideshare.

After Sid’s session we were served a splendid lunch made at the Impetus Cafeteria.

Right after lunch, was the one of the most awaited sessions of the day. Gaurav built an AIR client for his fictitious app called Blabber! It is just a co-incidence that the application name sounds like Yammer. You can see the details of his presentation on his blog here.

Then Rishav gave a presentation on Sphinx, using Thinking_Sphinx plugin. He showed all the Full text search capabilities of Sphinx, and also proved why thinking_sphix is a better plugin than ultra_sphinx for beginners atleast. His presentation is online at slideshare

Akhil’s session was the last technical session of the day. He carried on Rishav’s introduction to Sphinx to show how Faceted browsing works with Sphinx. You can find his slides also on slideshare

And then we had the musical extravaganza. Sur and Hemant with help from everybody else present at the event, put up a great show with a guitar and their melodious voices.

A lot of presenters were presenting for the first time, but did a really great job. To say the least, we can expect the event to improve as we organize subsequent editions. It feels really great to be involved with starting Ruby FunDays in India.

To read a more detailed review, go to Ritu’s blog.

bookmark_borderGetting ActiveScaffold to work with Rails 2.2 edge

Due to the way template handling works in Rails 2.2, activeScaffold does not work on edge rails anymore.
Thanks to Dr.Gaffo there is fix for the problem in his fork of ActiveScaffold. Get the edge branch of his fork at http://github.com/gaffo/active_scaffold/tree/edge which is compatible with edge Rails.
Even after this you might face some problems like the path to Inflector. Just move the reference to ActiveSupport::Inflector and you should be good.

There is one issue that I noticed, date time field handling by ActiveScaffold is broken, thanks to refactoring in Rails core for handling these. I will post a fix for this as soon as possible and update this post too.

bookmark_borderRuby Fun Day: The first full day Ruby and Ruby on Rails event in India

Here’s announcing the first Ruby and Rails Full Day event in India. It has been in the making for months if not years, and now finally it is going to happen on 22nd of November 2008.
We invite all Rubyists and Rails Lovers in India to participate and give us the enthusiasm to organize Fun-Days regularly.

Call it the Ruby-barcamp if you may. Everybody is welcome to speak, but send us a summary of what you would speak about.
This will be an event for the Geeks by the geeks and so we want to ensure hardcore technical sessions.
The only criteria for this one is “more code, less talk”. And of course it has to be related to Ruby or Ruby on Rails.

For event details and participation confirmation: visit http://rubyonrails.in/events/3

Have a day full of Fun and Ruby.
Special Thanks to Impetus Technologies in Noida for providing the venue.

bookmark_borderRide the Rails: Still skeptical?

Ok, so we had been shouting ourselves hoarse, claiming that Rails is all about developer productivity and joy. So is that all about it?, huh!, was the normal reaction. But isn’t that a big enough reason. Not for many people though.

Yes, we accept that there are some pain points, like hosting Rails applications at shared hosts. No we don’t need those in production, but don’t you wish it was easier to deploy a rails app for a quick review with a client (a client who can’t run it on his own machine). Yes php scores there, just throw the code on the server and you are done. Why do I still run this blog on wordpress and not typo or mephisto? The big reason is that it’s easy to let just apache handle everything.

But things might change soon with the launch of passenger aka modrails.

And the other classic allegation against Rails has been performance. Remember the discussion between JDD and DHH about CPU cycles vs. developer cycles. We are definitely headed in the direction of lesser CPU cycles for our Rails app. Rails2 made some advances towards that and with Ruby1.9 and YARV and Rubinium, we have high expectations. Also you have heard about Ruby Enterprise Edition , haven’t you?

So things might change, when people try to figure out the fastest web language or framwework , the next time around.

I and those around me here, are generally biased towards rails. Ruby makes us happy. For us the pleasure points in Rails were always far more than the pain points. The basic Rails principles of DRY and Convention Over Configuration clicked with us. Ruby’s and Rail’s simplicity and beauty clicked with us. We did not need hosting on shared hosts. We could work with Rails caching to improve performance. No wonder we were one of the early adopters of Rails in India. But today, I would like to thank the critics whose untiring rants have moved Rails in the direction of being much more than what is was a couple of years ago.

Some of those changes have been in rails, but more have been around it. If you would have noticed, most of these development are not in rails as such, but in the ruby ecosystem.

Rails provides developer productivity and joy; ease of deployment; and ever-improving performance. And no, now you don’t need to go back to Java. We knew it, I am just repeating it for you.

Extrapolate this one year old graph for yourself.

So what is your reason for not having rail-ed yet?

Update: Charles Nutter has a post on upcoming Ruby implementations here

bookmark_borderMultiple Rails apps with Quicksilver

The ~/works directory holds all the rails applications on my mac book. Some of these are VinSol projects, current and old. Some are my personal projects and some are open source apps like beast and radiant. There is a contribute app also as per HasManyThrough Josh’s recommendation.


[13:29:11 mjuneja works]$ ls -l | wc -l
 37

There are 37 rails applications right now. This is purely co-incidental and has nothing to do with 37signals. 😉

If I run all these apps on the default 3000 port, I cannot run more than one app at a time. If I run the apps at random ports, my browser history will not be app-sensitive. I am heavily dependent on my browser’s location bar’s autocomplete feature, so choosing random ports for my apps is not an option.

I want to be able to run apps on different but fixed ports. I need to be able to make use of my browser history. Also I need to spend minimum time configuring any new app.

This is what I did

I created a YAML file called rappaport.yml. The name rappaport is a short form for “rails application ports”, the fact that my wife runs a diamond jewelery business is purely co-incidental 😉

The yaml file consists of application names and they port assigned to them, as show in this sample below

lovetastic:
port: 3000
tperks:
port: 3001
mmbx:
port: 3002

Next, I have a ruby script ss (short for start server) in the ~/works directory.
All the rails projects have a softlink to ss from their RAILS_ROOT. To start the web server for a project, I just need to execute ss from the app’s RAILS_ROOT.

The script assumes that the application name in the yaml file is the same as the directory name under which the rails code for the app lives ( convention over configuration! )

#! /usr/local/bin/ruby

require 'yaml'

apps = YAML.load_file('/Users/mjuneja/works/rappaport.yml')
current_app = Dir.pwd.split("/").last
port = apps[current_app]["port"]
`script/server -p "#{port}"`

Everytime I create a new project, I append the app name and port to rappaport.yml. Also I create a softlink to ss from the RAILS_ROOT.

So I have a fixed port and a standard command to start the server for all my apps.

The next part is training the browser to access the application, on the same port each time, with minimum intervention from me.

Here, I make use of another ruby script called browser.rb.

#! /usr/local/bin/ruby

require 'yaml'

apps = YAML.load_file('/Users/mjuneja/works/rappaport.yml')
File.open("dev_bookmarks.html", "w+") do |f|
apps.each_pair { |k,v| f.print "<a href="http://localhost:#{v&#91;" port"&#93;}"=""> #{k}_dev </a> n" }
end

This script takes rappaport.yml as the input and creates a list of links in a file called dev_bookmarks.html as the output.
I need to execute this script everytime I add a new project to rappaport.yml.

This is what dev_bookmarks.html looks like

<a href="http://localhost:3000"> lovetastic_dev </a>
<a href="http://localhost:3001"> tperks_dev </a>
<a href="http://localhost:3002"> mmbx_dev </a>

Now I just need to add the contents of this file to Quicksilver’s index.
I go to Quicksilver’s Preferences and click on Catalog and drop the file dev_bookmarks.html from finder onto Quicksilver and Click “Rescan source”

In the information panel, I select “omit source items” and “Include content: HTML Links” and Rescan source.

I can see that the content panel contains all the links.

Quicksilver Content Pane

I can see the project links in the content meaning that quicksilver has correctly parsed the content. On the attributes panel, I select “Include in Global Catalog”.

To point my browser to a rails application running on localhost, I invoke the quicksilver hotkey and start entering the project name, and quicksilver prompts me the project name, and it already knows the port number too.

Quicksilver launching the app

bookmark_borderget started on Ruby on Rails in hours

build you own ruby on rails application

Build you own Ruby on Rails web application is a book specially written for people wanting to start exploring rails. It is being pitched as the “ultimate beginners guide to Rails” by sitepoint.
So if you have been appreciating Rails from outside, get hold of this book and jump right it. Start experiencing the joy of Ruby on Rails programming in hours, if not minutes.

This book is also an exteremely useful resource for companies who want to train developers on Rails.

Thanks Jamis, for the review which made me look at this book. Now that a new rails book is coming out almost every fortnight, it’s getting difficuilt to keep track.
Also there is this gem hidden in Jamis’ review : never use a plugin you would not be able to write yourself. We have learnt it the hard way and I am sure so have many other Rails developers.

bookmark_borderRuby on Rails in India: It’s getting hotter

Believe me! The scene is much hotter than what I had anticipated a few months back.

Good to see so many companies and developers jumping ( or wanting to jump) onto Rails/Ruby from other frameworks and languages.
This means increased competition for us. But it could also be consolidation time for the small agile Rails teams in this area to join hands to increase their offering.

Talking about demand; yesterday, I received a job offer from a “Big Indian Outsourcing company”.
The lady who called me read this blog, but probably didn’t read “technopreneur” written on the top.
So when I told her that I was running a company myself, there was dead silence for a couple of seconds.
Then she asked me, if I could give references of any Rails programmers.

I told her that If I came across good people, I’ll hire them and I’ll pass on the others to her.
Fair enough. Right!

bookmark_borderRails training in Colombo, Sri Lanka

Rails Training at Providence Network, Colombo

I travelled to Colombo last week to train a team of web programmers on Ruby on Rails.

God! I had never imagined, I would be training people on rails in Colombo.

The web programming team at Providence Networks and Solutions was great. They were very good at php and Java, and it seemed like they enjoyed the Rails training a lot.
Thanks to Ajay at ITVidya for connecting me and Providence.

A couple of observations about Colombo, unrelated to the training
1. Inspite of the communal/political probem, Sri Lanka is doing well. The airport is the first impression of any city, Colombo airport was sparkling clean and the immigration staff was very friendly too. The duty free shops were much better than ours, carried much more stock than our new “flamingos” and the staff was friendlier too.
2. The streets were neat and there were no animals or Rickshaws. I thought I would find them in all developing countries. Or do we have too much of them in Indian cities.
3. They have a well implemented parking policy in Colombo. It is not like the haphazard way of sadi-dilli. It’s probably a good suggestion to ask our politicians to stop visiting London, Singapore and Tokyo and rather look around nearby to learn how to implement urban policies.

And for the business minded, there are a good number of developers available at much lesser cost there, and they all speak English too. So you know you have an option available for your next offshore team.

It was a good trip and I look forward to visiting Colombo again. 🙂