Riding Rails in South America

One of the objectives of the RailsBridge Open Workshops is diversity, so I asked Carmen Díaz Echauri to write in Spanish about her experience leading a small workshop when she traveled back to her hometown. Read the original blog in Spanish, or for non-Spanish speakers, read an English translation of Carmen’s post below.

In October 2010, I attended three different software conferences in South America. One of them, CLEI (Conferencia Latinoamericana de Informática), which was held in my home town, Asunción.

Because I was going to spend two weeks in Paraguay, it seemed like a great opportunity to hold a mini-workshop and share my Ruby on Rails experience. So, a few days before my trip, I sent an email to the dean of the Universidad Católica de Asunción, where I had graduated, and suggested we hold a workshop at the university.

The University offered me the use of a computer lab and the technical staff set up their computers, which were running Ubuntu, with Ruby 1.8.7 and Rails 3.0.0, so I didn’t have to worry about installation.

First year engineering students, some professors and assistant professors attended the workshop. Because I had relatively little time to teach, I couldn’t use the complete RailsBridge workshop curriculum, so I had to adapt the curriculum that I had previously translated, which basically consisted of giving an explanation of the Rails framework, talking a bit about the “test first” culture and best practices in test-driven development.

This was what I covered in about 2 hours:

Basics
* What is the Ruby language? a bit of history
* What is Ruby on Rails and why is it called a framework?
* The structure of the framework
* Model View Controller in action

Exploration of the development process consisting of writing failing tests first and then making them pass with correct code. The explanation basically consisted of:
* TDD (test-driven development)
* BDD (behavior-driven development)

At the end of the presentation, we built a demo application in 6 basic steps. I called it “Riding Rails in 6 steps”

1) $ rails new jugando
2) $ vim Gemfile
source ‘http://rubygems.org’
gem ‘rails’, ‘3.0.0’
gem ‘sqlite3-ruby’, ‘1.2.5’, :require => ‘sqlite3’

At this point, I took some valuable time to explain the Gemfile manifest and emphasize all of the different libraries defined within it.

3) $ bundle install
Here, I explained how dependent libraries are managed.

4) $ rails generate scaffold juego titulo:string descripcion:text url:string
Here, I explained what “Scaffold” does.

5) $ rake db:create # If the db is not sqlite.
$ rake db:migrate

At this point, I briefly explained “Rake”.

6) $ rails server

As we were concluding the workshop and building the application, I also took some time to answer questions from the students. It was a challenging, yet enriching experience, since their questions about bundle, scaffold and Gemfile were difficult to answer in Spanish because we don’t have a frame of reference for these concepts. At the end of the tutorial, we added 4 more steps to create a controller and model with corresponding tests in RSpec.

I want to thank the University for this wonderful honor and even though I was leading the workshop, I feel as if I am the one who learned the most from these talented students and faculty.

Riding Rails in South America

Marchando sobre Rieles

by Carmen Diaz Echauri

(english translation)

Uno de los objetivos del RailsBridge Open Workshop es la diversidad, asi que basado en eso, Sarah Allen me pidió que comparta mi experiencia en espanõl sobre un pequenõ tutorial que dicté en mi ciudad natal. A continuación una pequeña versión de mi post original en mi blog.

En octubre 2010 asistí a tres diferentes Conferencias en Informáticas en América del Sur. Una de ellas, CLEI (Conferencia Latinoamericana de Informática), fue realizada en mi ciudad natal, Asunción.

Como iba a estar 2 semanas en Paraguay, me pareció una excelente oportunidad para realizar un mini-workshop y compartir mi experiencia sobre RoR, asi que unos días antes de mi viaje me comuniqué via email con el Decano de la Universidad Católica de Asunción. en la cual me gradué, y le sugerí hacer un taller en la Universidad.

La Universidad gentilmente me proporcionó uno de los laboratorios (salas de computadoras), y el staff técnico de la Universidad preparó las computadoras con ruby 1.8.7 y rails 3.0.0, las cuales utilizan Ubuntu como sistema operativo así que no tuve que preocuparme de la instalación en general.

Asistieron estudiantes del primer año de Ingeniería , ayudantes de cátedras, algunos profesores y público en general. Como el tiempo fue relativamente corto no pude utilizar el currículo completo propuesto por workshops RailBridge, asi que tuve que adaptar un poco el currículo que había traducido anteriormente, la cual básicamente consistió en dar una explicación del framework Rails, hablar un poco de la cultura “Pruebas Primero” y cual es la tendencia actualmente en cuanto a las pruebas de código.

Esta fue la agenda que expuse en un marco de 2 horas:

Nociones básicas
– En que consiste el Lenguaje Ruby. Un poco de historia
– En que consiste Ruby on Rails y porqué es llamado framework.
– Estructura y esquelo del framework
– Model View Controller en acción.

Exploración del proceso de desarrollo consistente en escribir pruebas fallidas primero y luego hacerlas pasar con el código correcto. Basicamente explique en que consiste:
– TDD (Desarrollo basado en Pruebas)
– BDD (Desarrollo basado en comportamientos)

Al finalizar la presentación realizamos un aplicación demo. Lo llamé Marchando sobre Rieles en 6 Pasos

1) $ rails new jugando
2) $ vim Gemfile
source ‘http://rubygems.org’
gem ‘rails’, ‘3.0.0’
gem ‘sqlite3-ruby’, ‘1.2.5’, :require => ‘sqlite3’

En este punto, me tome tiempo para explicar el manifiesto Gemfile en Rails y hacer hincapié en todas las librerias definidas en el archivo.

3) $ bundle install
Aquí expliqué el que concepto de manejador de librerias.

4) $ rails generate scaffold juego titulo:string descripcion:text url:string
Aquí expliqué en que consiste “scaffold

5) $ rake db:create # si la BD no es sqlite
$ rake db:migrate
En este punto explique brevemente en que consiste el programa rake.

6) $ rails server

A medida que íbamos finalizando el taller y construyendo la aplicación los alumnos realizaban preguntas. Fue una experiencia muy enriquecedora y desafiante, ya que preguntas acerca del bundle, scaffold y Gemfile fueron bastantes interesantes en contestar en Español ya que no tenemos un marco de referencia sobre estos conceptos. Finalizamos el tutorial creando un controlador y un modelo, con su correspondientes pruebas en Rspec, el cual agregó 4 pasos más al esquema inicial utilizado.

Quisiera agradecer a la Universidad por esta enriquecedora oportunidad. Definitivamente, aunque haya realizado el taller, fui yo la que más aprendí de esta experiencia.

Marchando sobre Rieles