Close and Go BackBack to Viget

Rails Edge Conference - Highlights

Patrick Reagan
Patrick Reagan, Development Director, January 30, 2007 0

We just returned from our first Rails-related conference with a lot of useful information and tips on Rails testing, development, and deployment.  Not only was it great to get some new ideas, but it was heartening to see that many of the practices we employ here at Viget are on track with what the Rails experts are preaching.

The conference packed in a lot of heavy topics in a short amount of time, but left plenty of time for both discussion and networking.  There were a lot of great talks that spanned the entire 3 days – here’s what stood out for me:

  • Metaprogramming in Ruby - Dave set the tone for the conference with his excellent talk on how Metaprogramming with Ruby can help to make us better Rails developers.  I had a bit of an epiphany about halfway into his presentation as I started to “get” objects in Ruby.
  • Ruby Idioms for Rails Programmers - Stuart treated us to a live refactoring of some Java controller code into a single line of Ruby by relying on the implicit design of the Rails framework stack.
  • Sharing RJS - Marcel showed off some great conventions for refactoring RJS code into helpers that also had the side benefit of making them available in your views (via a link_to_function call).
  • Creating Rails Plugins - Chad and Bruce gave a great demo on creating an ‘acts_as_rateable’ plugin from start to finish, complete with a bit of live coding.
  • The Deployment Golden Path - James covered one of the thorny issues of Rails development – deployment.  After showing some setup with Capistrano, Mongrel Cluster, and Apache, we were able to see a real deployment from a Subversion repository to a server within Amazon’s EC2.
  • Red, Green, Refactor - It was great to see Jim’s live test-driven development excercise as he created and refactored a small piece of code.  The real treat was the introduction that he gave to flexmock and flexstub – something that I had heard of before, but never knew how powerful it was when writing unit tests. His live demo of flexstub showed how you could reach into a Ruby class and manipulate its behavior from 2 degrees of separation.

A nice addition to the event that helped foster the informal, collaborative tone that Bruce describes on his blog was ...

...Open VGA & Lightning Talks

This was a chance for the attendees to give quick talks about any topics that they were passionate about and show off applications that they had been working on. 

  • The Revolution Health team was on hand to show off their recently-launched application and introduce their process for managing shared code assets – Plugems.
  • Jared gave us a quick demo of the Cha-Cha search engine and gave some tips on how the company got this Rails application to scale.  The most interesting part was when he mentioned that Cha-Cha uses only custom SQL queries based on information gleaned from ActiveRecord log data.
  • Ryan at ELC Technologies showed off their AWS Console application by instantiating some virtual servers within Amazon’s EC2 cluster.
  • Local Rails developer Bala Paranj gave a quick demo on how ZenTest picks up file changes and automatically runs all necessary regression tests.
  • FiveRuns (an event sponsor) showed off their Web 2.0 systems management application.  The interface looked promising, but I’m not certain how it hooks into the services that it’s monitoring.  I plan on signing up for their 30-day demo in the near future – this could be a simple alternative to going the Nagios route.

In all, it was a great conference.  Thanks to Mike and Nicole Clark at The Pragmatic Studio for organizing the event.

Rails Training with Chad Fowler

Patrick Reagan
Patrick Reagan, Development Director, January 24, 2007 0

We covered a lot of ground in the 3-day training course that we planned with Chad Fowler.  Much of the material is still sinking in for most of us, but we gleaned a lot of really good information and tips from the event.  Some highlights from the three days based on my notes:

  • Blocks - Methods that accept blocks can use this construct to clean up after the fact.  The File.open and open (as part of open-uri) both accept blocks to automatically close the stream when finished.
  • Mix-ins - Using modules provides a handy way to re-use functionality inside different classes.
  • RESTful development - This is a big area of interest for us especially since Rails 1.2 was just officially released last week.  We’re already looking forward to using the ResourceFeeder plugin with ‘respond_to’ to handle the RSS feeds we previously created by hand.
  • Routing - Though the material we covered about named routes existed in Rails 1.1.6, many of us hadn’t made full use of it yet – something that we will be leaning on more as we push for more meaningful URLs
  • Testing - We’re already actively using unit and functional tests (and have been for quite a while), but the intro to Selenium that Chad did really blew us away!  We’re planning to use the Selenium IDE plugin to Firefox to allow project managers to create their own regression test suites.
  • Advanced ActiveRecord - Association scoping is extremely useful to us and promises to clean up our controllers by refactoring logic back into the models.  Because of the “leaky abstractions” in Rails, we’re now using Nathaniel Talbott’s Query Trace plugin to see where we should be auto-loading associations.
  • Debugging Tips - Since ‘puts’ doesn’t work as you might think in your controllers and views, Chad gave a couple really useful tips:  add a single ‘raise’ call in your controller to inspect the state of your app or drop a call to ‘debug(var)’ into your view.  For more advanced debugging, we saw the full power of using ‘script/breakpointer’ to interact with controllers from an IRB console.
  • ActionMailer - We’ve been using ActionMailer for a while to send out emails from web apps, but the process for reading incoming mail is shockingly simple (much less involved than my previous PHP solution).
  • Performance - As we need to increase performance with Rails apps, we will now start looking at pushing session and fragment storage to memcached and pass off resource intensive processing to BackgrounDRb.
  • AJAX - Besides looking at RJS, we were introduced to the observe_form and observe_field magic to create auto-updating displays (useful for live searching).

Thanks to Chad for coming out and giving an excellent training session, and to both David Bock and FGM for their hospitality in opening up the space to us on such short notice.

Chad will be giving a couple of talks at The Rails Edge Conference this week that will make for a good continuation of some of the topics we covered in the class.  Ben and I will be attending all three days, so if you’re a Rails developer looking for a full-time gig, let us know.

December NovaRUG Recap & Rails Training

Patrick Reagan
Patrick Reagan, Development Director, January 02, 2007 0

A couple weeks ago, Kevin, Ben, and myself headed out to the December NovaRUG meeting to catch Rich Kilmer’s talk on Domain Specific Languages (DSLs) in Ruby.  People who have read the testing chapter in the latest Agile Web Development with Rails book may be familiar with the DSL that Dave presents when demonstrating integration tests in Rails:


  def test_buying_a_product
    dave = regular_user
    dave.get '/store/index'
    dave.is_viewing 'index'
    dave.buys_a @ruby_book
  end

Rich provided many examples of DSLs that he’s used, including one that he created for the DoD to handle planning of in-flight airplane refueling.  He also discussed his work with GUITopia to create an intuitive GUI DSL which was a bit more accessible to me as a newcomer to Ruby:


window.close(:button)
window.close(:button).click

Rich also discussed differences between both implicit and explicit DSLs and the scoping issues resulting from both.  My limited understanding of blocks and closures put me at a bit of a disadvantage here – something that I hope to resolve when we have our training event in January.

Training?

Yes.  We will be hosting a Rails training event here in the DC Metro area (Reston, to be exact) January 15th - 17th with Chad Fowler.  The session is geared toward people who have web development experience and have played a bit with Rails but want to get more in-depth.  The skill level required for this course falls between the Basic and Advanced Rails Studio classes offered by the Pragmatic Studio folks. 

Cost is $750 per person for all 3 days, email training@viget.com if you’d like to attend – space is limited. Hope to see you there.

A Development Community for Viget Labs and Beyond

Every team member here at Viget Labs strives to be an innovator. We members of the development team are no different - that's why we're constantly engaging in community discussions and exploring the unknown that is the next generation of open-source web applications.

Viget Is Hiring!

Viget has job openings for Ruby Developers, Interns, and Front-End Developers. Learn More »

Recent Comments

Interesting.

I’ve been (mis)using similar behaviour in javascript for years.


var i = 0, car;
while( car = cars[i++]){
// do stuff
}

I suppose that the reason it works is exactly the same reason it works in Ruby ... but in this case I think the code is actually very easy to read.