Beautify Your Ruby Code from TextMate





The great guys over at New Bamboo (a British Ruby on Rails development team) have launched a new blog and their first post is a tour through the testing methods available in Rails. It's ideal for those who've fallen behind with their Rails testing knowledge or those who want to get up to speed quickly.
RubyForIIS is a package that helps you set up the bindings between Ruby, Rails, and Microsoft's IIS server system. Project founder, Boris Leenaars, says:
Lucas Carlson comes up with a cute trick to make Ruby feel a little more like a prototyped language by allowing you to define methods on a class in real-time through child objects, like so:
Simple "Send Email from Ruby" method - Using Net::SMTP to talk to the local SMTP daemon directly to send mail. Not elegant, but a useful quick hack.
HTTP Request => Rails 'params' GET: /users => [:action => 'index'] GET: /users.xml => [:action => 'index', :format => 'xml'] GET: /users/1 => [:action => 'show', :id => 1] GET: /users/1;edit => [:action => 'edit', :id => 1] GET: /users/1.xml => [:action => 'show', :id => 1, :format => 'xml'] POST: /users => [:action => 'create'] PUT: /users/1 => [:action => 'update', :id => 1] DELETE: /users/1 => [:action => 'destroy', :id => 1]
Prolific 'Edge Rails' blogger Ryan Daigle has written "Simply RESTful Support - And How to Use It", a great walkthrough of the features offered by the simply_restful plugin that's now a core part of Edge Rails and which will provide a lot of the new functionality to be seen in Rails 1.2.
Following on from the Parsing XML with REXML using Expat post about using Expat to make REXML faster, Chris Wanstrath e-mailed me to let me know about his co-worker PJ's post, "Parse XML with Hpricot". Hpricot, covered previously in Fast HTML parsing in Ruby with Hpricot, is a fast HTML parser for Ruby written mostly in C by Ruby legend whytheluckystiff.
Two months ago, I wrote How to Create a Ruby Extension in C in under 5 minutes. But times have changed!
Expat is the recognized big daddy of XML parsing. It's a stream-based XML parser written in C and, as a library, is used for XML parsing functions by many languages. Rubyists have tended towards REXML, however, a more flexible (though infinitely slower) parser. Sam Ruby, however, has come up with some techniques to get Ruby's REXML working with Expat.
