You are on page 1of 24

Ruby Compendium

An Essential Guide to the Ruby Ecosystem


Rev. 0.1.0
by Fabio Cevasco
January 2011
Ruby Compendium - Table of Contents

Table of Contents
So you want to learn Ruby... .................................................................................................. 4

About this Book....................................................................................................................................... 4

1. Quick Tour ......................................................................................................................... 5

1.1 10 good things about Ruby .............................................................................................................. 5


1.2 Versions and Implementations ....................................................................................................... 5
1.2.1 MRI .............................................................................................................................................. 6
1.2.2 YARV ........................................................................................................................................... 6
1.2.3 JRuby ........................................................................................................................................... 6
1.2.4 Rubinius...................................................................................................................................... 7
1.2.5 MacRuby ..................................................................................................................................... 7
1.2.6 IronRuby..................................................................................................................................... 7
1.3 Syntax ................................................................................................................................................ 7
1.4 The Core and the Standard Library ................................................................................................ 9
1.5 Advanced Language Features ........................................................................................................ 10

2. Ruby Gems........................................................................................................................ 11

2.1 RubyGems.org ................................................................................................................................. 11


2.2 What you can use for...................................................................................................................... 11
2.2.1 Command Line Applications................................................................................................... 12
2.2.2 Documentation ........................................................................................................................ 12
2.2.3 Gem Management.................................................................................................................... 13
2.2.4 GUI Programming.................................................................................................................... 14
2.2.5 Markup and Template Languages.......................................................................................... 15
2.2.6 Static Web Site Generators ..................................................................................................... 16
2.2.7 Testing ...................................................................................................................................... 17
2.2.8 Web Development.................................................................................................................... 18
2.2.9 Web and App Servers .............................................................................................................. 19
2.2.10 XML Parsing ........................................................................................................................... 19

3. Resources ......................................................................................................................... 21

3.1 Web Sites ......................................................................................................................................... 21

ii
Ruby Compendium - Table of Contents

3.2 Books................................................................................................................................................ 22
3.3 Podcasts and Screencasts............................................................................................................... 22

A. Notable Rubyists .............................................................................................................. 23

iii
Ruby Compendium - So you want to learn Ruby...

So you want to learn Ruby...


…or maybe not. Maybe you’re thinking about it, but you’re not entirely convinced it’s a good idea.
Maybe you have an annoying co-worker who constantly raves about it and made you curious.
Whatever the case, this tiny book is about telling you all you need to know about the language before
you actually start getting your hands dirty.

There are many different ways to learn new programming languages. Typically, you’d start reading
tutorials online, try a few example programs, maybe buy a book and start reading it. That’s what most
people do nowadays, and it works, in the end. The downside of this is that you may spend weeks or
even months trying to get the hang of the language, spend a lot of time trying to find information
about it, ask dumb questions in forums and mailing lists, re-invent the wheel only to find out —months
later— that someone already made a library which does exactly the same thing as yours, but in a much
better way.

You can learn through mistakes, but there’s no harm in starting with the right foot.

This Ruby Compendium gives you an overview of the Ruby Ecosystem from 10,000ft. It briefly describes
the language, its libraries, and what resources you can find online. By the time you finish reading
this, you will not know how to write Ruby programs (yet) but you’ll definitely know how to learn this
amazing and powerful language and where to look for information and help.

Close your editor now, relax, and enjoy!

About this Book


This book was written by Fabio Cevasco and it is licensed under a Creative Commons Attribution-
ShareAlike 3.0 Unported License.

This book was authored using Glyph and the PDF version was produced with Prince XML.

The Ruby logo is copyright © 2006, Yukihiro Matsumoto, and used under the terms of the Creative
Commons Attribution-ShareAlike 2.5 License.

iv
Ruby Compendium - Quick Tour

Chapter I: Quick Tour


Ruby is a relatively new programming language. It was created by Yukihiro Matzumoto (aka “Matz”)
in 1995, but it took another ten years to become popular outside Japan, thanks to the Ruby on Rails web
framework.

1.1 10 good things about Ruby


1. It’s free and open source.
2. It’s high-level, no need to worry about memory allocation or similar.
3. It’s fully cross platform, or at least most of its implementations are.
4. It’s elegant. Really, Ruby syntax is truly beautiful, with no semicolons or braces, generally.
5. It has a large core and Standard Library.
6. It has over 1300 user-contributed libraries for almost anything you can think of.
7. It is multi-paradigm and offers many advanced language features.
8. It has a friendly and supportive community and plenty of useful resources.
9. There are loads of web sites about it and free online learning material.
10. A lot of books have been written about it.
If you want to know more...
For general information on Ruby and more introductory material, head over to the
Official Ruby Web Site, in particular to the Ruby from Other Languages articles, if you are
already familiar with C, C++, Java, PHP, Perl, or Python.

1.2 Versions and Implementations


One thing that may appear unusual and even discouraging to newcomers is the different versions and
implementations of the language. Ruby has two version branches:

▪ 1.8 – The former stable version, which is still widely used in production and it is still updated.
▪ 1.9 – As of release 1.9.2, this is considered the current stable and recommended version of the
language. Although most third-party libraries work with it, some old and now unmaintained
libraries may not. The good news is that there are normally newer and better libraries available
instead.

5
Ruby Compendium - Quick Tour

Different implementations of Ruby offer different degrees of support to one or the other version.
Compared to 1.8, Ruby 1.9 has some additional syntax for certain expressions, improved character
encoding support and a few new bundled libraries and features.

If you’re new to Ruby and you have no particular restrictions or needs, you should start learning Ruby
using version 1.9 (either YARV, JRuby or MacRuby)!

If you want to know more...

There are many articles and presentations online outlining the changes in Ruby 1.9, for
example:

▪ Piter.rb #2 – Ruby 1.8 vs Ruby 1.9


▪ Changes in Ruby 1.9
▪ Ruby 1.9: What to Expect

1.2.1 MRI
Matz’s Ruby Interpreter is the official Ruby 1.8 implementation, written in C by Yukihiru Matsumoto,
the creator of Ruby. As of Ruby 1.9, it has been replaced with YARV.

▪ Current Version: 1.8.7-p330


▪ Download: Official Ruby Web Site

1.2.2 YARV
Yet Another Ruby VM, the official Ruby 1.9 implementation is a bytecode interpreter written Koichi
Sasada. It has been tested to be faster than MRI.

▪ Current Version: 1.9.2-p136


▪ Download: Official Ruby Web Site

1.2.3 JRuby
An implementation of the Ruby language running on the Java Virtual Machine, mature and usable
in production. It offers real threading, performance improvements, and Java interoperability. Fully-
compatible with both Ruby 1.8 and 1.9.

▪ Current Version: 1.6.0RC1


▪ Download: JRuby Web Site

6
Ruby Compendium - Quick Tour

1.2.4 Rubinius
A C++ and LLVM-powered Ruby implementation. Although still not as mature as YARV or JRuby, it’s
getting there. It currently aims at being compatible with Ruby 1.8.7, although support for Ruby 1.9 is
planned.

▪ Current Version: 1.2.0


▪ Download: Rubinius Web Site

1.2.5 MacRuby
A Mac-only Ruby implementation compatible with Ruby 1.9, specifically tuned for Mac OS X operating
systems.

▪ Current Version: 0.8


▪ Download: MacRuby Web Site

1.2.6 IronRuby
A .NET implementation of the Ruby Programming Language, compatible with Ruby 1.8.6 (IronRuby
1.0) and 1.9 (IronRuby 1.1.1 onwards). Not as mature as the other implementations.

▪ Current Version: 1.1.1


▪ Download: IronRuby CodePlex Page
Isn't Ruby slow?

Being a high-level, interpreted language, Ruby is slower than compiled languages like C
or C++ or even other interpreted languages like Perl 5. However, this may vary depending
on the implementation.

▪ If you are interested in Ruby benchmarks, check out Antonio Cangiano’s Great Ruby
Shootout, which also includes data on Ruby Enterprise Edition and MagLev
implementations.
▪ If you are interested in benchmarks between Ruby implementations and other
languages, the Computer Language Benchmark Game is a good place to start.

1.3 Syntax
Teaching you how to program in Ruby goes beyond the scope of this book, however, this section will
show you at least what Ruby code looks like. If you know another programming language already,
some things may already be familiar to you. If you don't, hopefully the following code will not appear
too intimidating.

7
Ruby Compendium - Quick Tour

1 # This is a comment and will not be executed


2 # by the Ruby interpreter.
3 #
4 # This is not the usual 'Hello World' example, so
5 # don't worry if you don't understand everything.
6 # This example is meant to give you a general feeling
7 # of what it is like to write Ruby programs.
8
9 require 'pathname' # Here we're requiring an external library
10 # which is part of the Ruby Standard Library.
11
12 class FilePrinter
13
14 # Constructor method
15 def initialize(path)
16 # This method expects a valid path, however Ruby is dynamically-typed
17 # so anything can be passed to this method.
18 # To check that the input value is valid, just check if if it behaves
19 # like a path. This is called 'duck typing'.
20 raise RuntimeError, "Invalid path: #{path}" unless path.respond_to? :basename
21 @path = path
22 @name = @path.basename
23 end
24
25 def show
26 # Ruby objects and expressions can be interpolated in strings
27 puts " #@name -- #{@path.stat.size} bytes"
28 end
29
30 end
31
32 class DirPrinter < FilePrinter # Definition of a child class
33
34 def initialize(path)
35 super # Call to the parent's constructur
36 @children = @path.children
37 end
38
39 def show
40 puts " #@name/ -- #{@children.length} item(s)"
41 end
42
43 end
44
45 # No parenthesys are required unless needed!
46 pwd = Pathname.new Dir.pwd
47
48 puts "Current Directory: #{pwd}"
49
50 # Get the children items of the current directory,
51 # select only directories,
52 # sort them alphabetically,
53 # and for each one of them...
54 pwd.children.select{|i| i.directory? }.sort.each do |item|
55 # Call the show method, printing the
56 # directory name and the number of child items
57 DirPrinter.new(item).show
58 end
59
60 pwd.children.select{|i| !i.directory? }.sort.each do |item|
61 FilePrinter.new(item).show
62 end

8
Ruby Compendium - Quick Tour

Trying out Ruby...


If your hands are itching to try writing Ruby code, but you don't want to install it just
yet, head over to Try Ruby!, a unique way to try the language right in your browser. Or, if
you already installed Ruby, follow the Ruby in 20 minutes tutorial, using Interactive RuBy
(IRB).

1.4 The Core and the Standard Library


By default, Ruby always loads its core classes and modules when a script is executed. This means that
in all Ruby programs you can always instantiate core objects like:

▪ Numbers (integers, floats)


▪ Strings
▪ Arrays
▪ Hashes
▪ Files
▪ Regular expressions
▪ Symbols
▪ Threads
▪ Times and dates
▪ …and many more.

Most likely, this is not going to be enough. That’s when the Standard Library comes into play: it’s a
large collection of internal libraries that ships with every Ruby implementations. There are libraries
to connect to the Internet, to read/write to various file formats such as CSV or YAML, to work with
files and paths, access system features, and so on.

Unlike core classes, standard libraries must be required specifically if needed, before they can be used.

If you want to know more...

On core libraries and the Standard Library, checkout the official documentation:

▪ Core Reference
▪ Standard Library Reference

Overwhelmed? Don’t know where to start? Familiarize yourself with the Enumerable
module; you won’t regret it!

9
Ruby Compendium - Quick Tour

1.5 Advanced Language Features


One of the best things about Ruby is that you’re not stuck with a single programming paradigm. Even
though everything in Ruby is an object (thereby making it a fully object-oriented language), nothing
forbids you to program procedurally, or even use typical functional constructs.

The beauty of this is that you can (and should) combine elements from different paradigms, resulting
in very powerful and expressive code. What I really like about Ruby though is its inherent dynamic
nature.

You have a very few constraints when coding:

▪ you can open and close class definitions at will,


▪ you are not constrained by object types
▪ you can mix-in methods in multiple classes at the same time
▪ you can write code that writes itself dynamically (this is commonly called metaprogramming)
▪ you can easily create Domain-Specific Language to solve problems faster, with style
▪ you can create and pass around blocks of code

All these things make the language very flexible and powerful. Do not overuse Ruby’s power: if your
code starts to look like black magic, you’re probably going too far.

If you want to know more...

…on specific and advanced Ruby features, check out these articles:

▪ Ruby Metaprogramming techniques


▪ Ruby Procs And Lambdas (And The Difference Between Them)
▪ Ruby Mixin Tutorial
▪ Domain Specific Languages in Ruby

10
Ruby Compendium - Ruby Gems

Chapter II: Ruby Gems


Sure, the Standard Library is quite large but… no, it does not have everything you need. Luckily, it’s
full of gems out there! Rubygems is Ruby’s packaging system, and the best way to distribute your own
libraries and applications.

The Rubygems packaging system is now included in most Ruby implementation and distributions.
Installing a gem and all its dependencies is as easy as issuing gem install <name of the gem>. So for
example if you want to install the rails gem, you can just run

gem install rails

…and it will be automatically downloaded and installed on your system, along with the other gems it
depends on.

2.1 RubyGems.org
There are over 1300 different gems publicly (and freely!) available. Luckily, the official gem host site,
RubyGems.org makes it very easy to find what you're looking for: just search for a particular gem or a
functionality you're looking for, and browse through the results. You can also register and push your
own gems for other people to use.
What happened to RubyForge?

If you started to learn Ruby a few years ago, the RubyForge was the place to find user-
created ruby code and gems. The site is still there, but nowadays Rubyists prefer using
GitHub as host for their source code repositories and RubyGems.org as the home for their
gems.

2.2 What you can use for...


You could spend hours on the RubyGems web site to find what you’re looking for sometimes. Not
because you can’t find it, but because often there are too many alternative libraries that overlap in
terms of functionalities offered.

11
Ruby Compendium - Ruby Gems

A site to check when you don’t know much of what has been done in a particular domain is The Ruby
Toolbox, which organizes quite a lot of gems into categories. This section is somewhat similar, but it
focuses on just a few common tasks and a small set of hand-picked gems.

2.2.1 Command Line Applications


cmdparse

“cmdparse provides classes for parsing commands on the command line; command line options are parsed
using optparse or any other option parser implementation.”

▪ Web Page: http://cmdparse.rubyforge.org/


▪ Download: http://www.rubygems.org/gems/cmdparse
▪ Documentation: http://www.rubydoc.info/gems/cmdparse

gli

“An application and API for describing command line interfaces that can be used to quickly create a shell
for executing command-line tasks.”

▪ Web Page: http://davetron5000.github.com/gli


▪ Download: http://www.rubygems.org/gems/gli
▪ Documentation: http://www.rubydoc.info/gems/gli

highline

“A high-level IO library that provides validation, type conversion, and more for command-line interfaces.
HighLine also includes a complete menu system that can crank out anything from simple list selection to
complete shells with just minutes of work.”

▪ Web Page: http://highline.rubyforge.org/


▪ Download: http://www.rubygems.org/gems/highline
▪ Documentation: http://www.rubydoc.info/gems/highline

hirb

“A mini view framework for console/irb that’s easy to use, even while under its influence. Console goodies
include a no-wrap table, auto-pager, tree and menu”

▪ Web Page: https://github.com/cldwalker/hirb


▪ Download: http://www.rubygems.org/gems/hirb
▪ Documentation: http://www.rubydoc.info/gems/hirb

2.2.2 Documentation
glyph

12
Ruby Compendium - Ruby Gems

“Glyph is a framework for structured document authoring.”

▪ Web Page: http://www.h3rald.com/glyph/


▪ Download: http://www.rubygems.org/gems/glyph
▪ Documentation: http://www.rubydoc.info/gems/glyph

rdoc

“RDoc produces HTML and online documentation for Ruby projects. RDoc includes the rdoc and ri tools for
generating and displaying online documentation.”

▪ Web Page: https://github.com/rdoc/rdoc/


▪ Download: http://www.rubygems.org/gems/rdoc
▪ Documentation: http://www.rubydoc.info/gems/rdoc

yard

“YARD is a documentation generation tool for the Ruby programming language. It enables the user to
generate consistent, usable documentation that can be exported to a number of formats very easily, and
also supports extending for custom Ruby constructs such as custom class level definitions.”

▪ Web Page: http://yardoc.org/


▪ Download: http://www.rubygems.org/gems/yard
▪ Documentation: http://www.rubydoc.info/gems/yard

2.2.3 Gem Management


bundler

“Bundler manages an application’s dependencies through its entire life, across many machines,
systematically and repeatably.”

▪ Web Page: http://gembundler.com/


▪ Download: http://www.rubygems.org/gems/bundler
▪ Documentation: http://www.rubydoc.info/gems/bundler

jeweler

“Simple and opinionated helper for creating Rubygem projects on GitHub”

▪ Web Page: http://github.com/technicalpickles/jeweler


▪ Download: http://www.rubygems.org/gems/jeweler
▪ Documentation: http://www.rubydoc.info/gems/jeweler

bones

“Mr Bones is a handy tool that creates new projects from a code skeleton.”

▪ Web Page: https://github.com/TwP/bones

13
Ruby Compendium - Ruby Gems

▪ Download: http://www.rubygems.org/gems/bones
▪ Documentation: http://www.rubydoc.info/gems/bones

2.2.4 GUI Programming


bowline

“Ruby/JS GUI framework”

▪ Web Page: http://bowlineapp.com/


▪ Download: http://www.rubygems.org/gems/bowline
▪ Documentation: http://www.rubydoc.info/gems/bowline

fxruby

“FXRuby is the Ruby binding to the FOX GUI toolkit”

▪ Web Page: http://www.fxruby.org/


▪ Download: http://www.rubygems.org/gems/fxruby
▪ Documentation: http://www.rubydoc.info/gems/fxruby

wxruby

“wxRuby allows the creation of graphical user interface (GUI) applications via the wxWidgets library.
wxRuby provides native-style GUI windows, dialogs and controls on platforms including Windows, OS X and
Linux.”

▪ Web Page: http://wxruby.org/


▪ Download: http://www.rubygems.org/gems/wxruby
▪ Documentation: http://www.rubydoc.info/gems/wxruby

qtruby4

“Qt4 Bindings for Ruby.”

▪ Web Page: http://rubyforge.org/projects/korundum/


▪ Download: http://www.rubygems.org/gems/qtruby4
▪ Documentation: http://www.rubydoc.info/gems/qtruby4

rugui

“RuGUI is a framework which aims to help building desktop applications. RuGUI was mostly inspired by the
Ruby on Rails framework, taking most of its features from it.”

▪ Web Page: http://rugui.org/


▪ Download: http://www.rubygems.org/gems/rugui
▪ Documentation: http://www.rubydoc.info/gems/rugui

14
Ruby Compendium - Ruby Gems

What about Shoes?


Shoes is a cross-platform, easy-to-use Ruby toolkit originally created by . Unfortunately,
it is distributed as a standalone application rather than a gem (yet), due to its internal
architecture and dependencies.

2.2.5 Markup and Template Languages


bluecloth

“BlueCloth is a Ruby implementation of Markdown, a text-to-HTML conversion tool for web writers. To
quote from the project page: Markdown allows you to write using an easy-to-read, easy-to-write plain text
format, then convert it to structurally valid XHTML (or HTML).”

▪ Web Page: http://www.deveiate.org/projects/BlueCloth


▪ Download: http://www.rubygems.org/gems/bluecloth
▪ Documentation: http://www.rubydoc.info/gems/bluecloth

github-markup

“This gem is used by GitHub to render any fancy markup such as Markdown, Textile, Org-Mode, etc. Fork it
and add your own!”

▪ Web Page: http://github.com/github/markup


▪ Download: http://www.rubygems.org/gems/github-markup
▪ Documentation: http://www.rubydoc.info/gems/github-markup

haml

“Haml (HTML Abstraction Markup Language) is a layer on top of XHTML or XML that’s designed to express
the structure of XHTML or XML documents in a non-repetitive, elegant, easy way, using indentation rather
than closing tags and allowing Ruby to be embedded with ease. It was originally envisioned as a plugin for
Ruby on Rails, but it can function as a stand-alone templating engine.”

▪ Web Page: http://haml-lang.com/


▪ Download: http://www.rubygems.org/gems/haml
▪ Documentation: http://www.rubydoc.info/gems/haml

liquid

“A secure, non-evaling end user template engine with aesthetic markup.”

▪ Web Page: http://www.liquidmarkup.org/


▪ Download: http://www.rubygems.org/gems/liquid
▪ Documentation: http://www.rubydoc.info/gems/liquid

mustache

"Inspired by ctemplate, Mustache is a framework-agnostic way to render logic-free views. As ctemplates


says, “It emphasizes separating logic from presentation: it is impossible to embed application logic in this

15
Ruby Compendium - Ruby Gems

template language. Think of Mustache as a replacement for your views. Instead of views consisting of ERB
or HAML with random helpers and arbitrary logic, your views are broken into two parts: a Ruby class and
an HTML template.”

▪ Web Page: http://github.com/defunkt/mustache


▪ Download: http://www.rubygems.org/gems/mustache
▪ Documentation: http://www.rubydoc.info/gems/mustache

rdiscount

“Fast Implementation of Gruber’s Markdown in C”

▪ Web Page: http://github.com/rtomayko/rdiscount/


▪ Download: http://www.rubygems.org/gems/rdiscount
▪ Documentation: http://www.rubydoc.info/gems/rdiscount

redcloth

“RedCloth is a Ruby library for converting Textile into HTML.”

▪ Web Page: http://redcloth.org/


▪ Download: http://www.rubygems.org/gems/redcloth
▪ Documentation: http://www.rubydoc.info/gems/redcloth

2.2.6 Static Web Site Generators


jeckyll

“Jekyll is a simple, blog aware, static site generator.”

▪ Web Page: http://jekyllrb.com/


▪ Download: http://www.rubygems.org/gems/jeckyll
▪ Documentation: http://www.rubydoc.info/gems/jeckyll

nanoc

“a web publishing system written in Ruby for building small to medium-sized websites.”

▪ Web Page: http://nanoc.stoneship.org/


▪ Download: http://www.rubygems.org/gems/nanoc
▪ Documentation: http://www.rubydoc.info/gems/nanoc

toto

“the tiniest blog-engine in Oz.”

▪ Web Page: http://cloudhead.io/toto


▪ Download: http://www.rubygems.org/gems/toto
▪ Documentation: http://www.rubydoc.info/gems/toto

16
Ruby Compendium - Ruby Gems

webby

“Webby is a fantastic little website management system. It would be called a content management system
if it were a bigger kid. But, it’s just a runt with a special knack for transforming text. And that’s really all it
does – manages the legwork of turning text into something else, an ASCII Alchemist if you will.”

▪ Web Page: http://webby.rubyforge.org/


▪ Download: http://www.rubygems.org/gems/webby
▪ Documentation: http://www.rubydoc.info/gems/webby

2.2.7 Testing
bacon

“Bacon is a small RSpec clone weighing less than 350 LoC but nevertheless providing all essential features.”

▪ Web Page: http://github.com/chneukirchen/bacon


▪ Download: http://www.rubygems.org/gems/bacon
▪ Documentation: http://www.rubydoc.info/gems/bacon

cucumber

“Behaviour Driven Development with elegance and joy”

▪ Web Page: http://cukes.info/


▪ Download: http://www.rubygems.org/gems/cucumber
▪ Documentation: http://www.rubydoc.info/gems/cucumber

minitest

“minitest provides a complete suite of testing facilities supporting TDD, BDD, mocking, and benchmarking.
minitest/unit is a small and incredibly fast unit testing framework.”

▪ Web Page: https://github.com/seattlerb/minitest


▪ Download: http://www.rubygems.org/gems/minitest
▪ Documentation: http://www.rubydoc.info/gems/minitest

rspec

“RSpec is a Behaviour-Driven Development tool for Ruby programmers. BDD is an approach to software
development that combines Test-Driven Development, Domain Driven Design, and Acceptance Test-Driven
Planning. RSpec helps you do the TDD part of that equation, focusing on the documentation and design
aspects of TDD.”

▪ Web Page: http://relishapp.com/rspec


▪ Download: http://www.rubygems.org/gems/rspec
▪ Documentation: http://www.rubydoc.info/gems/rspec

shoulda

17
Ruby Compendium - Ruby Gems

“Making tests easy on the fingers and eyes”

▪ Web Page: http://www.thoughtbot.com/projects/shoulda


▪ Download: http://www.rubygems.org/gems/shoulda
▪ Documentation: http://www.rubydoc.info/gems/shoulda

2.2.8 Web Development


rails

“Ruby on Rails is a full-stack web framework optimized for programmer happiness and sustainable
productivity. It encourages beautiful code by favoring convention over configuration.”

▪ Web Page: http://rubyonrails.org/


▪ Download: http://www.rubygems.org/gems/rails
▪ Documentation: http://www.rubydoc.info/gems/rails

sinatra

“Classy web-development dressed in a DSL”

▪ Web Page: http://www.sinatrarb.com/


▪ Download: http://www.rubygems.org/gems/sinatra
▪ Documentation: http://www.rubydoc.info/gems/sinatra

padrino-framework

“The Godfather of Sinatra provides a full-stack agnostic framework on top of Sinatra”

▪ Web Page: http://www.padrinorb.com/


▪ Download: http://www.rubygems.org/gems/padrino-framework
▪ Documentation: http://www.rubydoc.info/gems/padrino-framework

merb-core

“Merb. Pocket rocket web framework.”

▪ Web Page: http://www.merbivore.com/


▪ Download: http://www.rubygems.org/gems/merb-core
▪ Documentation: http://www.rubydoc.info/gems/merb-core

ramaze

“Ramaze is a simple and modular web framework”

▪ Web Page: http://ramaze.net/


▪ Download: http://www.rubygems.org/gems/ramaze
▪ Documentation: http://www.rubydoc.info/gems/ramaze

18
Ruby Compendium - Ruby Gems

camping

“minature rails for stay-at-home moms”

▪ Web Page: http://camping.rubyforge.org/


▪ Download: http://www.rubygems.org/gems/camping
▪ Documentation: http://www.rubydoc.info/gems/camping

2.2.9 Web and App Servers


passenger

“Easy and robust Ruby web application deployment.”

▪ Web Page: http://www.modrails.com/


▪ Download: http://www.rubygems.org/gems/passenger
▪ Documentation: http://www.rubydoc.info/gems/passenger

rack

“Rack provides a minimal interface between webservers supporting Ruby and Ruby frameworks.”

▪ Web Page: http://rack.rubyforge.org/


▪ Download: http://www.rubygems.org/gems/rack
▪ Documentation: http://www.rubydoc.info/gems/rack

thin

“A thin and fast web server”

▪ Web Page: http://code.macournoyer.com/thin/


▪ Download: http://www.rubygems.org/gems/thin
▪ Documentation: http://www.rubydoc.info/gems/thin

unicorn

“Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-
bandwidth connections and take advantage of features in Unix/Unix-like kernels.”

▪ Web Page: http://unicorn.bogomips.org/


▪ Download: http://www.rubygems.org/gems/unicorn
▪ Documentation: http://www.rubydoc.info/gems/unicorn

2.2.10 XML Parsing


hpricot

19
Ruby Compendium - Ruby Gems

“a swift, liberal HTML parser with a fantastic library”

▪ Web Page: http://code.whytheluckystiff.net/hpricot/


▪ Download: http://www.rubygems.org/gems/hpricot
▪ Documentation: http://www.rubydoc.info/gems/hpricot

nokogiri

“An HTML, XML, SAX, & Reader parser with the ability to search documents via XPath or CSS3 selectors…
and much more”

▪ Web Page: http://nokogiri.org/


▪ Download: http://www.rubygems.org/gems/nokogiri
▪ Documentation: http://www.rubydoc.info/gems/nokogiri

xml-simple

“A simple API for XML processing.”

▪ Web Page: http://xml-simple.rubyforge.org/


▪ Download: http://www.rubygems.org/gems/xml-simple
▪ Documentation: http://www.rubydoc.info/gems/xml-simple

20
Ruby Compendium - Resources

Chapter III: Resources


There are a lot of resources out there to help you get started or stay up-to-date with Ruby. The Ruby
community is active and supportive, as long as you ask nicely.

The following section contains a small set of hand-picked web sites, books and podcasts which you
should definitely have a look at. For even more community resources, check out the Community Page
on the Official Ruby Web Site.

3.1 Web Sites


Ruby-Lang.org – The official Ruby web site, completely maintained by members of the Ruby
community and available in several languages.

RubyGems.org – The home of all Ruby gems.

Ruby Koans – Learn Ruby (and testing) through Koans. Probably the coolest way to learn Ruby right
now.

Ruby Learning – Ruby guru Satish Talim’s web site about learning the Ruby language. It contains
tutorials, study notes, and even online classes.

Ruby Corner – The most comprehensive Ruby blog aggregator.

Ruby Inside – The Ruby blog, by Peter Cooper.

Ruby Forum – A mirror of the most important Ruby-related mailing lists.

RubyDoc.info – Your one-stop resource for reference documentation. Everything from Ruby core,
Standard Library, gems, and even Github-hosted Ruby projects.

RubyFlow – Community-powered link blog. Created by Peter Cooper

The Ruby Toolbox – A collection of ruby resources and libraries, organized by category and
popularity.

RubyCommitters.org – List of all the Ruby core committers. Created by Aaron Petterson, currently
looking for a fancy CSS makeover.

21
Ruby Compendium - Resources

3.2 Books
The Humble Little Ruby Book – A nicely-written free book on Ruby, by Jeremy McAnally

The Little Book of Ruby – An 87-page free introduction covering Ruby basics.

The Book of Ruby – A 400-page free Ruby bible by Huw Collingbourne.

Programming Ruby – The first edition of the so-called Pickaxe book, available for free, by Dave
Thomas, Chad Fowler and Andy Hunt

Why’s (poignant) guide to Ruby – The legendary book by why the lucky stiff. With foxes, little elves,
and… chunky bacon!). Exquisitely weird and witty.

What about "real" books?

All the books mentioned so far are free, but there’s plenty of published books on Ruby.
Check out the following titles:

▪ Addison-Wesley Progessional Ruby Series


▪ Ruby books by O’Reilly
▪ Ruby books by Pragmatic Programmers

3.3 Podcasts and Screencasts


The Ruby Show – The Ruby podcast.

Ruby On Rails Screencasts – Free Ruby on Rails screencasts

SD Ruby Podcast – Ruby podcasts by the San Diego Ruby community.

Ruby Pulse – Free Ruby-related podcasts.

22
Ruby Compendium - Notable Rubyists

Appendix A: Notable Rubyists

Yukihiro Matsumoto – @yukihiro_matx


The creator of the Ruby Programming Language.

Dave Thomas – @pragdave


Pragmatic Programmer, published author, Ruby core committer.

Chad Fowler – @chadfowler


Pragmatic Programmer, published author, Ruby core committer.

David Heinemeier Hansson – @dhh


Creator of the Ruby on Rails framework.

why the lucky stiff – @_why


Semi-legendary, prolific Ruby developer, core committer, blogger, book author. Mysteriusly
disappeared in August 2009.

Yehuda Katz – @wycatz


Rails core committer, lead developer of the Merb project.

Jeremy McAnally – @jm


Published author, blogger. Known for the Little Humble Ruby Book.

Obie Fernandez – @obie


Published author, editor of Addison-Wesley's Professional Ruby Series, enterpreneur.

Ola Bini – @olabini


JRuby core committer, published author, blogger.

Peter Cooper – @peterc


Published author, blogger, enterpreneaur. Creator of Ruby Inside.

Antonio Cangiano – @acangiano


Technical Evangelist, blogger, published author, and Ruby's unofficial benchmarker.

Andy Hunt – @pragmaticandy


Pragmatic Programmer, published author.

Satish Talim – @indianguru


Creator of RubyLearning.com, one of the best resources for learning Ruby.

23
Ruby Compendium - Notable Rubyists

David A. Black – @david_a_black


Ruby core committer, published.

James Edward Gray II – @jeg2


Ruby core committer, conference organizer, published author and blogger.

Luis Lavena – @luislavena


Ruby core committer, maintainer of RubyInstaller for Windows.

Aaron Petterson – @tenderlove


Ruby core committer, blogger.

24

You might also like