PHP Code Generation with Ruby
I know.. PHP. Don't stone me just yet! Eric Rollins presents some interesting work relating to generating PHP code with Ruby.

I know.. PHP. Don't stone me just yet! Eric Rollins presents some interesting work relating to generating PHP code with Ruby.

The Robot Co-op, the team behind 43things, has released several great Ruby libraries for free, all available as gems. Here are some of the highlights:
RubyNode is an interesting Ruby library that spits out semantic representations of code much in the same way the inspect method does with data. Here's a demo:

I've noticed many readers are using del.icio.us, so this should come in handy. Someone has developed a Ruby script that uses the del.icio.us API to download all of your links, and then uses SQLite to put them into a local database, whereupon you can do whatever you like with them. I just gave it a try and it works well.
The guys over at Fingertips present an article entitled 'excellent and pragmatic proposal for easier Unicode support in Rails'. Julian 'Julik' Tarkhanov has developed a proxy class for String that tweaks all of the methods to work properly with Unicode. You can then use code like this:


Pat Eyler of O'Reilly's Ruby blog has interviewed James Gray of Ruby Quiz fame. James talks about how he was won over to Ruby via Perl 6, and how the Ruby Quiz has continued to explode in popularity.
Paul Lutus says:
The Charming Ruby Compiler is charming not just by name, but by nature. It's a thesis project at the Computer Science Department at Chalmers University of Technology in Sweden to develop a proof of concept Ruby compiler that compiles to the C-- intermediate language. So far, they've only got the basics working, but it's an interesting project, if only to learn about C--, an interesting 'portable assembly language' that makes life easier for compiler developers. It seems a little like Parrot, and is funded by Microsoft Research and the National Science Foundation.
You might have noticed this blog has nice, syntax colored code excerpts, as does Code Snippets. Jim Morris looks at how you can pull this off in a few different ways. One quick and easy way is to use syntax.carldr.com, a Web site that converts any Ruby code you paste into the correct syntax colored HTML. Currently I use TextMate and an external script using the syntax gem, but might use that site instead as it's easier!

If you're on Windows and have been having trouble with your database adapters, this post about new Ruby database adapters for Windows might just be for you. Now, back to TextMate... :)
Craig Webster has posted several times over the few days about his adventures with sockets in Ruby. He provides nice code examples (even doing socket stuff direct from irb!) and his explanations are useful if you know what you're doing with Ruby, but haven't tried doing any TCP or socket work yet:

In this photo, a Ruby script has found the license plate and marked it with a red box (source below).

NArray is an Numerical N-dimensional Array class. Supported element types are 1/2/4-byte Integer, single/double-precision Real/Complex, and Ruby Object. This extension library incorporates fast calculation and easy manipulation of large numerical arrays into the Ruby language.
InternetNews.com have a story called "A Gem Of A Language for Java and .Net" where they look at two attempts to get Ruby working on the Java and .Net runtimes. A choice quote:
Jeremy Voorhis has written an interesting, and seemingly overlooked, article about asset management in Ruby and Rails. Firstly he talks about using rake to build a basic asset compiler, and then demonstrates a basic DSL (Domain Specific Language) he created to manipulate image assets in only a few lines of code. An example:
For the fun of it, I developed a quick Ruby obfuscation tool a few weeks ago. It's not a proper obfuscater that changes variable names and such, but it'll keep your code from being immediately understood. Here's the library, px.rb:
Welcome to Ruby Inside. Learn more about the blog. It's early days yet, but let's get cracking..