Archive for the 'This Week in Ruby' Category

This Week in Ruby (April 28, 2008)

Antonio Cangiano April 28th, 2008

This is the 5th episode of This Week in Ruby, please consider subscribing to my feed so as to not miss any weekly installments.

Rails

For some, the greatest Rails news this week was the announcement of a third edition of the Agile Web Development with Rails book. It’s currently in beta and will be finished by October, much to the anticipation of many, I’m sure.

Another interesting development, this time based on actual code, was announced through a post by Ezra Zygmuntowicz, entitled Hey Rails, nice Rack!. Basically, he’s working on “porting Merb’s rack machinery to rails” and it’ll eventually be merged with Rails’ core.

Three Rails related articles caught my eye in particular over the last few days. The first is 5 little-known Rails methods. I’d like to think that most Rails developers already take advantage of them, but if you don’t, it’s a good idea to learn about them now. The second is Building a Social Network Site in Rails, which is not a step-by-step guide, but rather a list of useful resources for building such a site. And finally, I liked Database agnostic != database ignorant in which the author provides a very basic intro to SQL joins and indexes. A much needed piece in the Rails community.

Ruby

The big news in this realm is that GitHub has began serving RubyGems. You can follow the instructions here, and read a nice interview with Chris Wanstrath, too.

JRuby 1.1.1 was released and I’m constantly more impressed by the speed of development of that project. Speaking of which, Charlie Nutter has published an excellent overview and status update of the various alternative Ruby implementations - and don’t miss the video of John Lam’s presentation on IronRuby’s status and DLR.

RubyLearning published a guide to Yahoo! Web Services in Ruby. And by the way, the same site is looking for ways to promote their free Ruby eBook.

Three interesting Ruby articles I want to point out are A Look at Ruby Debuggers by InfoQ, a tutorial about building Mac apps with RubyCocoa and XCode and a screencast on video transcoding and uploading to Amazon S3. Nice stuff.

In the alternative web frameworks arena, Mack 0.4.7 was released as further proof of the development speed of this project. This week Feather was also announced and it’s an open source, lightweight blog engine written in Merb.

Until next week…

This Week in Ruby (April 21, 2008)

Antonio Cangiano April 21st, 2008

This is the 4th episode of This Week in Ruby, please consider subscribing to my feed so as to not miss any weekly installments.

Ruby

Ruby Heroes’s logoAs you’ve probably heard by now, this week Ruby 1.8.7-preview1 was released and it’s a major upgrade because it includes several backports from Ruby 1.9. It should help many in this transitionary period without substantially breaking the existing code. On the subject of migrating to Ruby 1.9, I recommend Bruce Williams’ beautiful slides from Scotland on Rails. I’d suggest reading the interview he gave for RubyLearning, in which he dispenses some good advice to Ruby newcomers. Those who’d like something more advanced, may find this clever presentation about metaprogramming very interesting, too.

The funny guys from RailsEnvy came up with an idea for promoting Ruby/Rails people: the Ruby Hero Awards. On the website you can nominate any person from the Ruby community and a panel of community leaders will pick 6 winners and announce them at RailsConf.

With the release of App Engine, Google has surely proven their interest for Python once again. But this month they gave some love to Ruby as well, by releasing a guide for using Ruby with the Google Data APIs.

There were three announcements that may spark your curiosity:

  • Ruby-Processing got an upgrade and now has the ability to export Mac applications;
  • forkoff was released, and it’s “brain-dead simple parallel processing for Ruby”;
  • Nick DeMonner released Stone, a plug&play Ruby solution to data persistence.

Other interesting articles were Converting Groovy to Ruby by Charlie Nutter, Symbols are not pretty strings and the second part of Rubinius for the Layman.

Rails

As mentioned last week, Rails’ repository has moved to GitHub while this week the tracker moved to Lighthouse. With these changes in place you may want to read about the best practices for contributing to Rails with Git and freezing Rails with Git.

The first tutorials for mod_rails have started to pop up, in particular there was this guide for setting up Passenger on SliceHost with Ubuntu 7.10 and the more discursive Why mod_rails is great for light-duty Rails apps.

The website Open Source Rails collects open source projects that are implemented in Rails. It’s surprising how many of them are practically unknown to the community.

This week two must-read, hands-on posts were published: Import Gmail Contacts using Ruby on Rails and Paperclip: Attaching Files in Rails. Both cover tasks that are extremely common and useful for many web developers.

On the more philosophical side, I published an article called Is the Enterprise world Rails ready? in which I discuss Rails’ origins and their consequences on Rails’ applicability within the corporate world. One a somewhat related note, you can read JRuby - Or how I manage to write Ruby in a strict corporate environment and Why I think Ruby on Rails is an ideal web development environment by Andy Jeffries.

Merb

This week the third part of the Merb and DataMapper Book was published (part 1, 2 and 3). Merb is growing very fast and I think it’s fair to say that it has become THE alternative framework to Rails within the community. New features keep popping up and some of them are indeed very clever ones. For example, this week Ezra published a post about deferred requests with Merb, Ebb and Thin. Briefly put, when you adopt an event-based web server like Ebb or Thin, as opposed to plain vanilla Mongrel, any long request will be a blocker. Now Merb offers the possibility to specify that a certain set of actions, like uploading a file, should be handled by spawning a new thread rather than being served by the main event loop. Very clever and excellent stuff.

This Week in Ruby (April 14, 2008)

Antonio Cangiano April 13th, 2008

This is the third episode of This Week in Ruby, please consider subscribing to my feed in order not to miss any weekly installments.

Phusion Passenger

This week there were a few announcements that will change the history of Ruby. The first of them was the release of Phusion Passenger. For those who spent the last three weeks in a cave, Passenger is the name of mod_rails for Apache and, at the moment, it’s the most talked about piece of software in the Rails community. Let’s put this in perspective to better understand how important it is. A few years ago the recommended way of deploying Rails applications was the employment of Apache or Lighty with Fastcgi. Eventually the community realized that it was less than ideal, and a disaster for those who were using Typo or other Rails applications on most shared hosting plans. Most people then favored the option of using a cluster of mongrel processes, proxy balanced by Apache, Lighty, NGINX, etcetera.

There are other available variants for this configuration, and even some alternatives, but overall most people will agree that the concept of a proxy balancer plus a Ruby web server has been the recommended solution for a while now. It definitely works, it’s stable and scalable, and will probably continue to satisfy many users. There are, however, three disadvantages of this configuration: 1) The setup is not complex, but it’s definitely more complicated for newbies, when compared to what PHP developers are used to. It’s not an “upload and run” solution; 2) In order to work, it requires a decent amount of RAM, and root access to the machine doesn’t hurt either; 3) Most shared hosting companies are unwilling to offer it to their customers. That’s where Passenger comes to the rescue. It’s as easy as it gets (pretty much zero configuration), the company claims a lower memory footprint when used with their soon to be released version of Ruby (called Ruby enterprise edition), and finally it’s ideal for shared hosting because it’s just an Apache module like the ubiquitous mod_php.

As such, Passenger can be that vital missing piece for the wide adoption of Rails on the web. Try it out and if you decide to use it for your projects, don’t forget to feed the two brilliant minds who came up with it by donating here.

GitHub

Amongst other important announcements, is the launch of GitHub, where the Rails community seems to gather now. Think of it as the Facebook of Rails hackers. Aside from Rails, Merb and Capistrano, further projects are continually moving there. Some are even leaving Rubyforge despite their recent addition of a Git option. Both the ORM Sequel and the Ruby VM, Rubinius got on GitHub, even if the latter is only copied over by post-commit hooks.

Ruby Web Frameworks

As we approach the release of Merb 1.0, you may find the official wiki a useful resource and want to consider contributing to expanding it. And if you are interested in Merb thanks to its being leaner and faster than Rails, you may want to read Matt Aimonetti’s informal benchmark, that claims about 70% improvement over Rails for a dummy application.

Sinatra 0.2.0 was released, as a much improved version of the ultra-lean web application framework for Ruby. Very interestingly, an article was published that covers its usage for creating simple Facebook applications. A recommended reading for those who don’t need Rails’ overhead for simple apps.

This week RubyInside covered a new RESTful framework similar to Rails, called Mack. The amount of web frameworks for Ruby is constantly growing and this is due to the ease of creating DSLs in Ruby and the fact that Rack, made the integration with web servers dead easy. Do we really need all these web frameworks? Probably not, but natural selection is a powerful tool and this is interesting stuff that’s worth a test drive anyways.

Rails 2.1 will soon be released, if you are curious about the improved support for Time Zones, don’t miss this well explained overview by Geoff Buesing. The new features are just plain awesome and will make the trouble of upgrading worth it.

Ruby

A few other announcements were made this week in Rubyland. The most important, was the release of the 2.0 version of RDoc, which significantly improves ri performances (hallelujah).

Peter Cooper, who never sleeps, made the announcement of a Ruby community for link sharing, called RubyFlow. It could be a good replacement for ruby.reddit.com, given the clear anti-ruby bias that can be experienced on Reddit.

Jay Fields’ has a nice article entitled Extend modules instead of defining methods on a metaclass which is a good reading about a technique that is often ignored.

The first of 8 books on Ruby coming out soon was published this week. In fact, FXRuby: Create Lean and Mean GUIs with Ruby was finally published. I started reading the first few chapters and it’s very straightforward. If you are into desktop apps, consider getting it. In my opinion it’s a quick read.

Two articles worth mentioning are Ruport: Business Reporting for Ruby by Gregory Brown and Michael Milner, and a brief overview of 19 Ruby template engines. Yes, there are that many!

Finally, please note that the registration for the fifth batch of the popular free online Ruby course by Satish Talim is now open. This course will start on the 3rd of May so sign up now if you are interested.

This Week in Ruby (April 7, 2008)

Antonio Cangiano April 7th, 2008

The first edition of This Week in Ruby received a warm welcome from the community. A week later, here we are with a second installment of the series. I’ll attempt to repeat these posts approximately every week, so feel free to follow along by subscribing to my feed.

The Ruby community is a tremendously active one. In only seven days, there have been so many noteworthy items popping up, that it would take me hours just to mention them all. I’ll try to pretend that you, the reader, have been on a week-long vacation in a remote place without internet access, and on your return you asked me, “Hey, Antonio what happened in Ruby and Rails land while I was away?”

Some fun on April Fools’ Day

We kicked off the week on a lighthearted note, by fully embracing the endless opportunities offered by April Fools’ Day. Most of the spoofs and jokes were aimed at making fun of Ruby on Rails, one way or another. Testimony to the self-irony that we, as a community, certainly have. I personally announced the soon-to-arrive release of a fictitious (of course) framework called Ruby on Crack. Which was supposedly much faster and productive than Rails. At the heart of the joke were the fake endorsements, chocked full of double-meanings (with apologies to Matz, David Heinemeier Hansson, Dave Thomas, Ezra Zygmuntowicz, Obie Fernandez, Zed Shaw, Tim O’Reilly, Guido van Rossum and Paul Graham). I found the SQL on Rails April Fools’ gag very funny and extremely elaborate. Their screencast is comedic genius and their site a spoof in every minute detail. In my book, on that day, they took the cake. The joke itself was from two years ago (as pointed out by a commenter below) but it resurfaced again this year. The hilarious trend continued with Cobol on Cogs and for the ASP.NET and PHP nostalgic, with Acts as ASP.NET and RHAP (Ruby Ain’t Hypertext Preprocessor). Avdi Grimm even found the final solution to the whole Monkey-patching diatribe: Ninja-Patching, “When you really want to catch a coder by surprise, a monkey doesn’t cut it. What you need is a Ninja.”. :)

mod_rails

Last week I mentioned Passenger (aka mod_rails). This week Hongli Lai published some interesting benchmarks that compared it against Mongrel and Thin for three Rails applications (Typo, Petstore and El Dorado). While still synthetic benchmarks, the results where very encouraging and showed how Passenger was on average faster than Mongrel and roughly on par with Thin. Even just the perspective of having performances that are somewhat comparable with those of Mongrel, would be great news, given that it’d highly simplify the deployment process of Rails applications with Apache. Ninh Bui has announced that the official release date for the project is expected sometime this week and that meanwhile they are working with companies like Twitter and Dreamhost to ensure that the module is fully tested. Speed is only one of the project’s aims in fact, with a lot of focus put on stability and robustness, too. They also caught the attention of Engine Yard who is interested in discussing a possible partnership and contributions to the Rubinius project.

Git

By now you should be aware that the Rails community is fully embracing Git, and github.com is only part of the reason. Michael Bleigh has even created a small library called ruby-github to simplify access to the GitHub API. David has announced that Rails is moving to Git and the ticket tracking system is being switched over to Lighthouse. As David pointed out, this means that both the tracking system and version control are to be run by Rails applications, which is a good bonus if you subscribe to the philosophy of “eating your own dog food”. For those who are still git-challenged, Kurt Schrader has a collection of helpful links to get you started. And if you need a simple issue tracker for git, version 0.1.2 of Ditz has just been released, too.

Conferences

Confreaks has now published the remaining videos from MountainWest RubyConf 2008. They’re very interesting and highly recommended. All of them.

In case you missed the Ruby Fools conference, held on April 1st and 2nd in Copenhagen, you can read an interesting personal account by 41Concepts. The conference also took place on April 3rd and 4th in Oslo.

Speaking of conferences, Sam Ruby will be presenting on Ruby 1.9 at this year’s OSCON. In a recent short post, he mentioned his plans for his talk and really nailed one of the problems that will hinder Ruby 1.9’s adoption, in his own words:

My tentative conclusion at this point based on observations of efforts to get products like Rails working on Ruby 1.9: the biggest obstacle to Ruby 1.9’s adoption is the sheer number of mostly working but essentially unmaintained gems that virtually everybody in the Ruby community depends on. — Sam Ruby

Rails

Amazon has an article on Using SimpleDB and Rails in No Time with ActiveResource. Another interesting article which surfaced this week was a post called simple pages for easily creating “boiler-plate” pages in Rails.

Three interesting plugins where released. You can read about them in Introducing Action Messager: Dead simple IM notifications for your app!, Better Partials Plugin for Rails and A Rails 2.0 Message Forum Plugin.

The Rails Jedi posted about two Mac OS X applications for accessing Rails docs in the most efficient way possible. Nookkit.app and RailsBrain are real timesavers, and I highly recommend them to Mac users.

SapphireSteel has announced the Public Beta of their Visual Rails Workbench. With the release of Ruby in Steel 1.2 Beta 3, they have in fact included their drag-and-drop visual environment for Rails. I didn’t have a chance to try it out, but if you are on Windows you may want to give it a shot, starting with reading their online articles.

The ink for printing Ruby and Rails books never runs dry, as I pointed out in my post 7 soon to be released Ruby and Rails books. It turns out that in the months of April and May alone, there will be 8 new Ruby/Rails titles. Check them out, especially if you are looking for updated material relating to Rails 2 or, in the case of the pickaxe 3, to Ruby 1.9.

The guys from Rails Envy, published episode 25 of their Rails podcast. If you are not familiar with their fun podcast, I recommend that you listen to a few episodes by subscribing to it through iTunes.

Ruby

There were countless interesting Ruby articles in the last week, but I’d like to point out the following:

Ruby VMs

In Rubinius for the Layman, Part 1: Rubies All the Way Down, Mathieu Martin has a nice, gentle introduction to Rubinius with some reveling benchmarks too. For those interested in learning more about the current status of Rubinius, InfoQ has a short article with a few pointers.

More remarkably, in the land of alternative Ruby VMs, Jruby 1.1 has finally been released, after months of hard work. The authors are already thinking about what lies ahead for the project. If the subject interests you, feel free to grab a few slides from various presentations on the topic.

This Week in Ruby (March 31, 2008)

Antonio Cangiano March 31st, 2008

One of the main advantages of Ruby’s growing community, is the speed at which exciting news pops up. This post briefly covers must-read highlights for new developments in the Ruby and Rails communities throughout the past week. I’ll attempt to repeat a “This Week in Ruby” post approximately every week, so feel free to follow along by subscribing to my feed.

Rails 2

Craig Webster published the first part of an easy to follow tutorial entitled Getting Started with Rails 2.0. The nice thing is that it also covers version control through Git, which is becoming extremely common in the Ruby/Rails community. Speaking of trends, a study by Gartner predicts that the Ruby language will reach 4 million programmers within the next 5 years. Numbers that would definitely position Ruby as a mainstream programming language. Incidentally, Obie Fernandez published an interesting survey of major corporations and large companies which are embracing Ruby on Rails. A very impressive list that is destined to grow quickly as Ruby’s implementation and ecosystem improve.

The official Rails blog has a post about a few changes in the core Rails team which brings the number of hackers down to 6, and establishes a Core alumni group of “retired” Rails core programmers. The small team seems to be busy, as Rails 2.1 is about to be released with some new exciting features, such as migrations based on UTC timestamp, named_scope, gems as plugins and much more as outlined by this caboo.se post.

On the deployment side, there are a few exciting happenings. Apple has published the third part of their tutorial, titled Deploying Rails Applications on Mac OS X Leopard. HighScalability.com has an article about an incredible service offered by Heroku that offers one-click, hassle free, cloud computing based Rails deployment. Their service is still in beta, and takes advantage of Amazon web services, but from what I’ve seen so far their secure and scalable deployment is as easy as it gets and it’s going to be a welcomed addition to the deployment options available to Rails programmers. Even more interestingly, a Dutch company called Phusion put up a demo about their Passenger project. Phusion Passenger, aka mod_rails, is a module for Apache that will bring ease of deployment, stability and performance to Rails. The company claims that according to their tests, mod_rails should be slightly faster than using Apache+Mongrel, it handles Rails processes automatically by spawning them depending on the effective traffic, and they are working with the largest hosts in order to ensure real world performance and stability when under heavy loads.

James Golick continues his series of “Plugins I’ve Known and Loved”, this time covering Ultrasphinx, a plugin for the uber-fast search daemon Sphinx.

Nicolas Sanguinetti wrote a script, that attempts to speed up the process of setting up an empty Rails project. I don’t find the procedure particularly boring so I don’t plan to use it, but it might be useful to some people.

Ruby

Peter Cooper, of Ruby Inside, has an article about two re-implemenations of the Ruby language. They are both named Sapphire, adding further to the confusion. The first one is a real fork, which was apparently born from the author’s dissatisfaction with the current management of the MRI, and the desire to have better support for Windows along, of course, with extra features like Aspect Oriented Programming, Unicode, etc, etc… The second one appears to be a new language, a stripped down and “stricter” version of Ruby that is supposed to be more Smalltalk-like and would be running, at least in the beginning, on the .NET platform. They are both worth mentioning, but currently I honestly fail to get excited about them. Ruby has an implementation problem, not a design one, in my opinion. However, we’ll see what they are able to deliver. In my book, a good implementation of a Ruby like language would be far from being frowned upon.

Remaining in the field of new implementations, InfoQ has an article about a neat new addition called HotRuby which is able to execute opcodes generated by the Ruby 1.9 VM (aka YARV). HotRuby is an incomplete and tiny (40 KB) implementation, faster than Ruby 1.9, that runs on JavaScript and Flash.

For those interested in Ruby and compilers, Vidar Hokstad has published the first two parts of a tutorial called “Writing a compiler in Ruby bottom up” (part 1 and part 2). Even if you are not into compilers, it’s a rather interesting read.

Sun reaffirmed their commitment to Ruby this week, by announcing the Ruby Development Center on the Sun Developer Network. I like Sun’s serious efforts and fast paced development of both JRuby and NetBeans (whose 6.1 beta is now out).

A new project hit the frontpage of programming.reddit.com: StrokeDB. Odd name, I know, but if you are interested in CouchDB, you may also take an in-depth look at StrokeDB. It’s a project that sounds rather promising if properly implemented. In their own words: “StrokeDB is an embeddable distributed document database written in Ruby. It is schema-free, it scales infinitely, it even tracks revisions and perfectly integrates with Ruby applications.”. The developers had a talk at EURUKO 2008, the European Ruby conference that took place this past weekend. Videos from the conference are not up yet, but meanwhile you can equally enjoy the videos and slides from MountainWest RubyConf 2008 on ConFreaks, which has published a talk by Evan Phoenix and Ezra Zygmuntowicz, respectively about Rubinius and Merb.

Finally, last week I spotted a bug that made Ruby 1.9 (built from trunk) significantly slower than Ruby 1.8. After a bit of investigation I was able to single out that the problem concerned Mac OS X only. With some testing by Chris Shea, the exact culprit revision was isolated and the core team has already worked on a fix. It was a very prompt and impressive response by Matz and his team.

RubyGems

Eric Hodel has announced the release of RubyGems 1.1.0. Aside from bugfixes and a couple of minor features, the most welcomed improvement is a significant speed boost that makes the tool faster. If you’d like to hear Eric talk about Rubygems and his involvement with the Ruby community, this week InfoQ published an interview with him (the interview itself is from RubyConf 2007 though).

This is my first episode of “This Week in Ruby” so feel free to provide feedback if you found it useful or if you have suggestions for improving it. Thank you for reading!

« Prev