Interesting Ruby Tidbits That Don’t Warrant Separate Posts #1
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:
It allows you to send a SIGQUIT to a ruby process to get a dump of the running threads to STDERR or a file. This is *incredibly* useful for diagnosing hung or slow processes, since you can introspect the ruby process on demand. This is a feature built into the JVM, and has always been an essential part of the diagnostic toolkit.
Using 64 bit primary keys with Rails migrationsGot an app that needs more IDs than the standard 32 bit amount? MySQL can use BIGINT columns, but, as Sanjay Vakil says, "it is a little tricky to convince Rails and Migrations to use it." So Sanjay has come up with a set of instructions and code on how to solve the problem.How to customize attachment_fu file namesattachment_fu is one of the most popular "file upload" plugins for Rails applications nowadays, but it can prove a little tricky to work out how to get it to use custom file names. Patrick Crowley to the rescue with plenty of code!Using Amazon S3 from Amazon EC2 with RubyExactly what it says in its title. A great, comprehensive article by Jack Herrington.Webistrano - Easier Capistrano DeploymentWebistrano is a Web-based interface for managing Capistrano deployments by Jonathan Weiss. There are two screencasts available to demonstrate its use.10 Reasons to Learn RubyA well written, comprehensive look at ten reasons to learn Ruby. I didn't post this separately as it's going to be second nature to most Ruby Inside readers, but it's a good read that deserves some eyeballs nonetheless.macaddr - MAC address retrieval librarymacaddr is a cross-platform library by Ara Howard that lets you retrieve the MAC network interface addresses from the local machine. Just use gem install macaddr and then require macaddr in and use Mac.addr and Mac.addr.list. Works on OS X, Windows and Linux.