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

Interesting Ruby Tidbits That Don’t Need Separate Posts #22

By Peter Cooper / April 24, 2009

email.png It's been just over a year since the last Interesting Ruby Tidbits That Don’t Need Separate Posts post (number 21, specifically). I think I felt that RubyFlow filled the gap for quick-fire group posts, but.. it doesn't, quite (even though it's going great guns!) There are still a lot of awesome things out there that should be highlighted here but that, perhaps, don't need their own post. So.. the series is back.

Enjoy!

How to Write a RubyGems Command Plugin

rubygems.png Following on from our news about the new version of RubyGems and its plugin functionality, Gabriel Horner has put together a great tutorial that covers how to create your own plugin from scratch.

Mocks and Stubs - A Presentation by Brian Guthrie

A presentation (in video format) by Brian Guthrie on testing using mocks and stubs. It's a heavy download (193MB) but Brian strikes the right balance between code and theory with some good examples. If "mock" and "stub" are jargon words to you, check it out.

What Nick Quaranto Uses for Testing in Ruby and Rails

blueprint sticky.png Nick Quaranto of Thoughtbot has put together a list of the testing tools - with accompanying notes - that he uses in his daily work. Mentioned are Shoulda, Mocha, factory_girl, Cucumber, FakeWeb, and testing from the command line.

Mio: A Tiny Io-subset Interpreter written in Ruby

This one is for the code voyeurs out there! Marc-André Cournoyer has put together a small interpreter (in pure Ruby) that will execute a subset of the Io language. It's an interesting bit of code to look at, rather than something you're going to be using anytime soon.

Fibers for Ruby 1.8.6/1.8.7

Fibers are light-weight non-preemptible threads that are provided as a feature in Ruby 1.9 (think of Ruby 1.8's threads but strip away the scheduling). Joe Damato has implemented fibers for Ruby 1.8.6 and 1.8.7. It's a patch directly against the MRI source code though, so you'll need to be pretty brave or interested to get going. Awesome work nonetheless.

MRI_Instrumentation: DTrace Hooks for MRI

mri_instrumentation is an interesting piece of work by Lourens Naudé. It provides a set of C level probes that can be used to interrogate and otherwise wrestle with the internals of any version of Ruby 1.8 MRI on a platform that supports DTrace (OS X and Solaris, primarily). This is particularly useful for low-level profiling.

dreamhost.png Dreamy: A Dreamhost API Library for Ruby

Dreamhost is a popular budget, shared hosting ISP amongst Rubyists. It's cheap and easy to get Rack-powered apps (including Rails and Sinatra apps) running, even if they can be a little slow from time to time. Still, an interesting place to put apps if you're aware of the issues.

Recently Dreamhost launched an API that can be used to programatically access Dreamhost's control panel's functionality, and Jerod Santo has put together a Ruby library called Dreamy to access it.

kcalc.png Weigh Your Gems

gemweight.rb is a script that calculates the memory use and load time of a given RubyGem. Works only on Linux.

Validating Data with Regular Expressions in Ruby

Brightbox's Caius Durling looks at some gotchas with using regular expressions to validate data in Ruby (and Rails).

Comments

  1. George McGrumble says:

    I for one very much appreciate you occasionally making a post like this. There are so many new things every day that it helps to narrow the focus.

  2. w2tags says:

    try this...

    W2TAGS is HAML for ERB (reach v0.9.4)

    http://github.com/wharsojo/w2tags/tree/master
    http://groups.google.com/group/w2tags/browse_thread/thread/6891e7d5111feed0?hl=en

Other Posts to Enjoy

Twitter Mentions