Archive for May, 2007

How to Transfer Files using SSH and Ruby

Wednesday, May 30th, 2007

Matthew Bass has written a tutorial, published by InfoQ, called “Automating File Uploads with SSH and Ruby.” It provides an in-depth look into building a small Ruby script that can backup files to a remote machine over SSH using the Net-SSH and Net-SFTP libraries. It goes into quite some depth, and provides source code for a recursive backup script. If you haven’t had a dig into the Net-SSH and Net-SFTP libraries yet, it’s worth a look to see how the basics work.

ZenTest 3.6.0: Turbocharge Your Tests

Tuesday, May 29th, 2007

Autotest_red_green

ZenTest is a bundle of useful time-saving tools created by Ryan Davis to make the process of testing your applications faster and more effective:

  • zentest automatically writes your missing code based on simple naming rules.
  • unit_diff compares expected results from actual results and allows you to quickly see exactly what is wrong.
  • autotest continuously runs in the background, running relevant tests as soon as you modify a file. It’s probably the most popular component of the ZenTest package. With RedGreen, you’ll even get colorized tests!
  • multiruby…

RFaceBook: Ruby library for FaceBook’s new API

Tuesday, May 29th, 2007

Facebookplatform

FaceBook, a popular social networking site, recently announced the availability of an API, allowing third party developers to build tools, apps, and systems that integrate with FaceBook and which FaceBook users can use from within their accounts. MySpace users, who are used to copying and pasting crazy blocks of HTML into their profile foxes, will be aware of what a big deal this is.

Rack: Fast Modular Ruby Web Server Interface

Sunday, May 27th, 2007

Rack, recently announced at version 0.2 by Christian Neukirchen, is a minimal, modular and adaptable interface for developing Ruby web applications. By wrapping HTTP requests and responses in the simplest way possible, it unifies and distills the API for web servers, web frameworks, and software in between (the so-called middleware) into a single method call.

A simple Rack application looks like this:

class HelloWorld
def call(env)
[200, {"Content-Type"=>"text/plain"}, ["Hello world!"]]
end
end

If you ever think Rails is a bit overkill for some of…

Ruby Inside Turns 1 Today!

Saturday, May 26th, 2007

Blink and you’d miss it, but Ruby Inside celebrates its first anniversary today. To commemorate it, I want to post about the history of the site, how it all came together, present some statistics, and give some blog-related tips for anyone else who wants to create a similar blog.

Why?

51J3Rnl9Fal. Aa240

Ruby Inside was initially conceived as a promotional vehicle for my then-nascent Beginning Ruby book, now published by Apress and available from all good bookstores (and some bad ones, I imagine). The idea…

Classifier Gem: Bayesian and LSI Classification for Ruby

Thursday, May 24th, 2007

Classifier is a Ruby gem developed by Lucas Carlson and David Fayram II to allow Bayesian and other types of classifications, including Latent Semantic Indexing.

Bayes classifier is a probabilistic algorithm which apply Bayes’ theorem in order to learn the underlying probability distribution of the data. One popular use for this is implemented in most spam filtering packages.

It can also be applied to many other cases of machine learning to make your Ruby application more intelligent (the complicated implementation is transparently handled for you, thankfully!) Ilya Grigorik recently…

15 Steps to a Test Driven Developed Rails Application

Tuesday, May 22nd, 2007

Andrzej Krzywda has put together a solid, 15 point tutorial on how to build a Rails application from the ground up using Test Driven Development (TDD) techniques. This is pure gold because so few of the books and “how to build a blog in 5 minutes” type articles bother to cover testing and Andrzej shows how to get into the habit from almost the first step.

Handshake: Design-by-Contract

Tuesday, May 22nd, 2007

Handshake, currently in version 0.3.0, is an informal design-by-contract system written by Brian Guthrie in pure Ruby. It’s intended to allow Ruby developers to apply simple, clear constraints to their methods and classes.

Handshake is definitely welcome alongside the ever-increasing number of test-driven and behavior-driven design/development based tools, such as RSpec and test/spec.

Some examples of Handshake contracts (from its documentation):

3 Fresh Presentations from RailsConf 2007

Sunday, May 20th, 2007

Scaling

Scaling a Rails Application from the Bottom Up was a presentation by Jason Hoffman, CTO of Joyent. The PDF of the presentation has a mega 192 slides and touches on a ton of interesting stuff about scaling and deployment (all the way down to hash based filing).

Forkoff

Angels & Daemons (PDF of slides) was a presentation by Tammer Saleh of Thoughtbot, Inc that went into the details of building daemons and how to daemonize processes in Ruby. The PDF on its own is pretty…

RSpec 1.0 Released

Sunday, May 20th, 2007

Rspec-1

The RSpec development team have just announced the release of RSpec 1.0, the first major version of what has become a popular “Behavior Driven Development” library for Ruby.

If you’re fresh to RSpec, check out the official home page for a compelling example, or straight from the mouths of the RSpec team:

RSpec provides a Domain Specific Language for describing and verifying the behaviour of Ruby code with executable examples.