The Book of Ruby

Book of Ruby

A Hands-On Guide for the Adventurous
by Huw Collingbourne
July 2011, 400 pp.

Ruby is famous for being easy to learn, but most users only scratch the surface of what it can do. While other books focus on Ruby's trendier features, The Book of Ruby reveals the secret inner workings of one of the world's most popular programming languages, teaching you to write clear, maintainable code.

You'll start with the basics—types, data structures, and control flows—and progress to advanced features like blocks, mixins, metaclasses, and beyond. Rather than bog you down with a lot of theory, The Book of Ruby takes a hands-on approach and focuses on making you productive from day one. As you follow along, you’ll learn to:

  • Leverage Ruby's succinct and flexible syntax to maximize your productivity
  • Balance Ruby's functional, imperative, and object-oriented features
  • Write self-modifying programs using dynamic programming techniques
  • Create new fibers and threads to manage independent processes concurrently
  • Catch and recover from execution errors with robust exception handling
  • Develop powerful web applications with the Ruby on Rails framework

Each chapter includes a "Digging Deeper" section that shows you how Ruby works under the hood, so you'll never be caught off guard by its deceptively simple scoping, multithreading features, or precedence rules.

Whether you're new to programming or just new Ruby, The Book of Ruby is your guide to rapid, real-world software development with this unique and elegant language.

Author Bio 

Huw Collingbourne is the Director of Technology for SapphireSteel Software, developer of the Ruby In Steel IDE. With 30 years of programming experience, he has written programming columns for numerous magazines, presented features on computing for BBC Television, and currently edits the online technical journal Bitwise Magazine. He has previously released two free ebooks on Ruby—The Little Book of Ruby and The Book of Ruby.

Table of contents 


Chapter 1: Strings, Numbers, Classes, and Objects
Chapter 2: Class Hierarchies, Attributes, and Class Variables
Chapter 3: Strings and Ranges
Chapter 4: Arrays and Hashes
Chapter 5: Loops and Iterators
Chapter 6: Conditional Statements
Chapter 7: Methods
Chapter 8: Passing Arguments and Returning Values
Chapter 9: Exception Handling
Chapter 10: Blocks, Procs, and Lambdas
Chapter 11: Symbols
Chapter 12: Modules and Mixins
Chapter 13: Files and IO
Chapter 14: YAML
Chapter 15: Marshal
Chapter 16: Regular Expressions
Chapter 17: Threads
Chapter 18: Debugging and Testing
Chapter 19: Ruby on Rails
Chapter 20: Dynamic Programming

Appendix A: Documenting Ruby with RDoc
Appendix B: Installing MySQL for Ruby on Rails
Appendix C: Further Reading
Appendix D: Ruby and Rails Development Software

View the detailed Table of Contents
View the Index


"I'm no longer afraid of Ruby or daunted by its syntax. If you're looking for a good introduction to the language The Book of Ruby should be on your buying list."
Craig Buckler, OptimalWorks Web Design (Read More)

"Collingbourne knows his subject and if you are a software developer wanting to learn more about Ruby there is plenty of valuable material here."
Tim Anderson, ITWriting (Read More)

"The Book of Ruby is not just technically good or accurate, it is truly well written."
Ecommerce Developer (Read More)

"Recommended for established developers new to Ruby."
Dr. Dobb's Developer Reading List (Read More)

"If you are interested in learning Ruby then this is the book for you."
ACM SIGSOFT Software Engineering Notes

"A nicely written (and nicely printed) guide to Ruby that covers everything you would expect from a Ruby guide in untiring detail."
Durham University Computing Society (Read More)

"Covers all the fundamentals of the language, as well as gives a great start into the Rails framework and dynamic programming."
Sean Patterson, Fresh Consulting (Read More)