Ruby Weekly is a weekly newsletter covering the latest Ruby and Rails news.

By Peter Cooper / June 23, 2006

Picture 2-2

Charlie Savage has announced ruby-prof 0.4.0. The main improvements are more speed, support for threads, cross-referenced HTML reports, support for Windows, and much easier profiling in general. If you’re deploying Ruby code that hasn’t been profiled, it’s time to give it a try. You might find some surprising ways to speed up your code. Read More

By Peter Cooper / June 23, 2006

AD.D SoftWare have developed a new plugin for Rails called cssForm that lets you create forms without tables, entirely using CSS.

The interesting thing about this plugin is the way it lets you wrap certain behavior around standard elements. This technique could be very useful to pick about and redevelop for your own preferences. Read More

By Peter Cooper / June 20, 2006

The unstoppable Coda Hale presents an amazing article about setting up a server with Mongrel, Apache, Capistrano, SSL support, etc. for solidly serving Rails applications. An extremely well written and solid guide. Read More

By Peter Cooper / June 20, 2006

There are a few efforts to develop crossovers between .Net and Ruby, but Ruby.NET one that is creating a compiler for the Ruby language that targets the .NET CLR in much the same way as JRuby targets the Java Virtual Machine. This particular implementation is unique in that it can pass all 871 tests in the samples/test.rb of Ruby 1.8.2.

We are pleased to announce the preliminary Beta release of the Gardens Point Ruby.NET compiler. Note: this is not just a Ruby/.NET bridge, nor a Ruby Interpreter implemented on .NET, but a true .NET compiler. The compiler can be used to statically compile a Ruby source file into a verifiable .NET v2.0 assembly or it can be used to directly execute a Ruby source file (compile, load and execute). Read More

By Peter Cooper / June 19, 2006

If you want to cut down on the nastier elements getting through to your Web site, filling in contact forms, and generally causing havoc, consider the rbl_check plugin by Joost.

rbl_check is a Rails plugin that checks every incoming request to see if the client is listed on a Real-time Blackhole List. This helps prevent abuse from spammers/crackers.

Basic source for implementing a block is included. Read More

By Peter Cooper / June 19, 2006

Rmagick20
Tim Hunter, of RMagick, the Ruby Image/GraphicsMagick library, has put together a cool tutorial about how to use RMagick to produce Web 2.0 style graphics, as shown above. It’s pretty in-depth. Read More

By Peter Cooper / June 18, 2006

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: Read More

>> def plus_1(x)
>> x + 1
>> end
=> nil
>> pp method(:plus_1).body_node.transform
[:scope,
{:next=>
[:block,
[[:args, {:rest=>-1, :cnt=>1, :opt=>false}],
[:call,
{:args=>[:array, [[:lit, {:lit=>1}]]],
:mid=>:+,
:recv=>[:lvar, {:vid=>:x, :cnt=>2}]}]]],
:rval=>[:cref, {:next=>false, :clss=>Object}],
:tbl=>[:x]}]

By Peter Cooper / June 18, 2006

Many coders will reach a situation where developing a C extension makes sense, whether for doing ‘heavy lifting’, diving into assembly language, interfacing with other C code, etc. Luckily, developing a basic Ruby extension in C is easy.

Note: This article assumes you are using a UNIX of some sort (this was all tested on OS X) and that you have Ruby installed properly (from source, ideally, so you have ruby.h available). If not, you may be stuck.

First, create a directory called MyTest (or whatever you want your extension to be called) and in there create two files, extconf.rb and MyTest.c (if you want to download pre-written sources, they’re in this tar file). Read More

By Peter Cooper / June 18, 2006

Idioms

Ruby Discoveries and Idioms is a new(ish) Ruby blog that’s full of interesting code featuring the author’s Ruby ‘discoveries’ and lots of Ruby idioms. If hacking around with classes is your idea of fun, it’s a great blog. Read More

By Peter Cooper / June 18, 2006

mly from caboo.se looks at how to quickly protect certain controller actions from GET requests in Rails, and presents a couple of useful test helpers to make testing for POST vs GET compliance simple. His code lets you then do a simple test like so:

def test_update__with_get
assert_method_not_allowed(:update, {:good => :post, :bad => :get})
end

This test ensures that ‘update’ will only accept a POST request and not a GET. Read More

By Peter Cooper / June 17, 2006

Courtenays-Team
Above: Courtenay’s team hard at work.

This year’s Rails Day has kicked off. 24 hours of coding madness where you start with absolutely nothing (except a choice of some JavaScript libraries, Rails, and RubyGems) and build an application to wow the celebrity judges. Winners get tons of prizes from a MacBook Pro, a day at an Adaptive Path workshop, through to Web hosting and other services.

If you want to spectate, there’s a Campfire chatroom for the purpose, as well as graphs and other information on the commits and svn activity of the participants. The repositories are usually opened up sometime after the contest has finished, so there’ll be lots of great code to check out. Read More

By Peter Cooper / June 16, 2006

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:

text.chars.length > length ? text.chars[0...l] + truncate_string : text

chars provides the proxy object from the text string. You can also use code like text.u.length as chars is aliased to u too.

They want to see it accepted as a patch to Rails, although I’m personally more interested in seeing this become a gem and be available in Ruby generally. Read More

By Peter Cooper / June 16, 2006

Coderay

CodeRay is a totally new syntax highlighting library written in Ruby. It deals with Ruby, C, Delphi, HTML, RHTML, and Nitro-XHTML out of the box, with plans to support YAML, SQL, Python, Perl, PHP, and Java. It’s quite customizable and easy to use, as seen in the code in the image above. Nice work! Read More

By Peter Cooper / June 16, 2006

Mauricio Fernandez reports that the next minor version of Ruby, Ruby 1.8.5, is due for release in mid August to coincide with the Japanese holiday of Obon. Ruby releases are usually tied to holiday periods, most notably Christmas for 1.8.3 and 1.8.4.

For the more adventurous, the initial preview release of 1.8.5 is coming by the end of June, with other preview releases in July and August. If Japanese is your thing, there’s more info here. Read More

By Peter Cooper / June 16, 2006

Newruby

Several months ago there was a competition to redesign the official Ruby homepage at ruby-lang.org. A winning design was chosen, and why said the work on implementing it would begin shortly thereafter.
It hasn’t gone live for real yet, but you can preview the new design in the flesh at http://new.ruby-lang.org/en/ Read More

Recently Popular Posts