More New Rails Screencasts from RailsCasts.com
Ryan Bates is being a total champ in rolling out more and more consistently good Rails related screencasts for free at RailsCasts.com. Some of the latest include:

Ryan Bates is being a total champ in rolling out more and more consistently good Rails related screencasts for free at RailsCasts.com. Some of the latest include:


Welcome to the first "Interesting Ruby Tidbits That Don't Warrant Separate Posts"! This is going to be a somewhat regular feature of all the reasonably interesting things I'm e-mailed about or discover that aren't getting as much attention as they should, but which aren't captivating enough to warrant an entire post on their own. So without further ado..thread-dump librarythread-dump is an interesting library that lets you to get a dump of thread activity when a Ruby process quits by Greg Fodor. In his own words:

Alex Young, a UK-based Rails developer, has put together a great guide that looks at the different development patterns used in Rails plugins and helps you develop well-designed plugins of your own.

Charlie Savage, author of ruby-prof, recently baked in support for Rails to ruby-prof, so now it's possible to profile your Rails application, see where the delays are, and work on improving performance.




Gregory Brown has put together a great four-page tutorial on how to build a database driven console application using Ruby and ActiveRecord (no Rails needed!). As well as delivering what the title suggests, Brown also looks at some neat Ruby techniques for structuring applications in general (such as using modules and module_function). The end result is an app called "EarGTD," a basic time / task management tool.
Geoffrey Grosenbach, author of the famous PeepCode screencasts, has written a tutorial about using Ryan Davis' hoe library to make releasing your own RubyGems a cakewalk. Geoffrey says that using Hoe turns a laborious, multi-step twenty minute process into only a few Rake tasks. Hoe takes the automation of Gem publishing seriously, and once you've set it up properly you can go as far as let it post announcements (to your blog and/or Rubyforge), build your docs, create an e-mail announcement, run testing packages against the library, as well as actually releasing and uploading the gem to Rubyforge ready for public consumption. CPAN, eat your heart out!


Matthew Bass has written a tutorial, published by InfoQ, called "Automating File Uploads with SSH and Ruby." It provides an in-depth look into building a small Ruby script that can backup files to a remote machine over SSH using the Net-SSH and Net-SFTP libraries. It goes into quite some depth, and provides source code for a recursive backup script. If you haven't had a dig into the Net-SSH and Net-SFTP libraries yet, it's worth a look to see how the basics work.
Classifier is a Ruby gem developed by Lucas Carlson and David Fayram II to allow Bayesian and other types of classifications, including Latent Semantic Indexing.
Andrzej Krzywda has put together a solid, 15 point tutorial on how to build a Rails application from the ground up using Test Driven Development (TDD) techniques. This is pure gold because so few of the books and "how to build a blog in 5 minutes" type articles bother to cover testing and Andrzej shows how to get into the habit from almost the first step.
Victor Igumnov has put together a simple walkthrough of how to package a Rails application into a single WAR file to run on a Tomcat server using JRuby, a pure Ruby PostgreSQL library (no ActiveRecord-JDBC needed!), and GoldSpike (JRuby addon that provides rake tasks to make WAR files). This is useful knowledge for anyone who might be forced into deploying Rails apps in an enterprise type system where Tomcat may be the only viable deployment option.

Data Structures and Algorithms with Object-Oriented Design Patterns in Ruby is an online book (free to read!) by Dr. Bruno R. Preiss, an incredibly well qualified engineer and computer scientist. It covers all of the various data structures and algorithms that beginning Computer Science students have to learn, but from a Ruby perspective and using object oriented design patterns.
The book itself is now a few years old, but I've only just come across it and it still seems relevant although, rather sadly, the on-page code is in graphics only (a ZIP file containing the source is available) and feels like a line-by-line conversion from C++ rather than true Ruby code. Still, if computer science, data structures, and algorithms elude you to any degree, and you want to learn about them while following Ruby code, it's a good place to start. There are also versions for C++, Java, C# and Python available from Bruno's homepage.

(photo credit: RBerteig)

(credit: Chance Gardener)



Ilya Grigorik has written a article demonstrating three different ways you can schedule tasks to run using Ruby, including a simple thread based scheduler, a OpwnWFEru based scheduler, and a BackgrounDRB based scheduler. A notable omission is RailsCron, which provides another alternative for Rails users.




Benchmarking with httperf is a new screencast by Geoffrey Grosenbach in his Peepcode series of Ruby / Rails related videos. It costs $9, but for that you get a bundle of source code and a very high quality video of 53 minutes' length.