Source: http://sketches.rubyforge.org/

Description

Sketches allows you to create and edit Ruby code from the comfort of your editor, while having it safely reloaded in IRB whenever changes to the code are saved.

Features

  • Spawn an editor of your choosing from IRB.
  • Automatically reload your code when it changes.
  • Use a custom editor command.
  • Use a custom temp directory to store sketches in.

Install

Download it here or run:

$ sudo gem install sketches

Then require sketches in your .irbrc file:

require 'sketches'

Sketches can be configured to use a custom editor command:

Sketches.config :editor => 'gvim'

Sketches.config :editor => lambda { |path|
  "xterm -fg gray -bg black -e vim #{path} &"
}

Examples

  • Open a new sketch:
    sketch
  • Open a new named sketch:
    sketch :foo
  • Open a sketch from an existing file:
    sketch_from 'path/to/bar.rb'
  • Reopen an existing sketch:
    sketch 2
    sketch :foo
  • List all sketches:
    sketches
  • Name a sketch:
    name_sketch 2, :foo
  • Save a sketch to an alternant location:
    save_sketch :foo, 'path/to/foo.rb'
Advertisements

Source: http://pablotron.org/software/wirble/

Wirble is a set of enhancements for Irb. Wirble enables several items mentioned on the RubyGarden “Irb Tips and Tricks” page, including tab-completion, history, and a built-in ri command, as well as colorized results and a couple other goodies. The idea, of course, is to fill Irb with useful features without turning your ~/.irbrc file into swiss cheese. Using Wirble is simple, too. Here’s what a standard Wirble-enabled ~/.irbrc looks like:

# load libraries
require 'rubygems'
require 'wirble'

# start wirble (with color)
Wirble.init
Wirble.colorize

Don’t like the defaults? Wirble is configurable. For documentation on enabling specific features or tweaking the color settings. take a look at the excessively-verbose Wirble README. Finally, here’s a screenshot of Wirble-enabled Irb:

Wirble Screenshot
Obligatory Wirble Screenshot

Latest:
Download Wirble 0.1.2 Tarball (Signature)
Download Wirble 0.1.2 Gem (Signature)
Read the Wirble 0.1.2 README
Read the ChangeLog