The Little Book Of Ruby

Sponsor Advertisement

  • Author: Huw Collingbourne
  • Format: PDF
  • Price: free

The Little Book Of Ruby is a PDF eBook which will guide you through the fundamentals of Ruby programming. Starting with the basics (strings, numbers, objects and methods) it quickly moves on to explain all you need to know to create your own class hierarchies, use arrays, hashes, iterators, modules, mixins and much more besides.

Chapters include:

  • Strings and Methods
  • Classes and Objects
  • Class Hierarchies
  • Accessors, Attributes, Class Variables
  • Arrays
  • Hashes
  • Loops and Iterators
  • Conditional Statements
  • Modules and Mixins
  • Saving Files, Moving On

Read: The Little Book of Ruby


Ruby Essentials

Sponsor Advertisement

  • Author: Neil Smyth
  • Format: online HTML
  • Price: free

Ruby Essentials is a free on-line book designed to provide a concise and easy to follow guide to learning Ruby. Everything from installing Ruby and the basics of the language through to topics such as arrays, file handling and object-oriented programming are covered, all combined with easy to understand code examples which serve to bridge the gap between theory and practice.

Ruby Essentials is intended to be of equal use both to those experienced in other programming languages and to novices who have chosen Ruby as their “first programming language”.

Chapters include:

  • What is Ruby?
  • Getting and Installing Ruby
  • Simple Ruby Examples
  • Commenting Ruby Code
  • Understanding Ruby Variables
  • Ruby Variable Scope
  • Ruby Number Classes and Conversions
  • Ruby Methods
  • Ruby Ranges
  • Understanding Ruby Arrays
  • Advanced Ruby Arrays
  • Ruby Operators
  • Ruby Operator Precedence
  • Ruby Math Functions and Methods
  • Understanding Ruby Logical Operators
  • Ruby Object Oriented Programming
  • Ruby Flow Control
  • The Ruby case Statement
  • Ruby While and Until Loops
  • Looping with for and the Ruby Looping Methods
  • Ruby Strings – Creation and Basics
  • Ruby String Concatenation and Comparison
  • Ruby String Replacement, Substitution and Insertion
  • Ruby String Conversions
  • Ruby Directory Handling
  • Working with Files in Ruby
  • Working with Dates and Times in Ruby
  • Useful Ruby Links and Resources

Read: Ruby Essentials


The Bastards Book of Ruby

Sponsor Advertisement

  • Author: Dan Nguyen
  • Format: online HTML
  • Price: free

The Bastards Book of Ruby is an introduction to programming and its practical uses for journalists, researchers, scientists, analysts, and anyone else whose job is to seek out, make sense from, and show the hard-to-find data.

This does not require being “good at computers”, having a background in programming, or the desire (yet) to be a full-fledged hacker/developer. It just takes an eagerness to be challenged.

Chapters include:

  • Installation
  • Tweet Fetching
  • Style, Conventions, and Debugging
  • Numbers
  • Strings
  • Variables
  • Methods
  • Methods Part II: RubyGems
  • If and Else
  • Loops
  • Collections
  • Enumerables
  • File input/output
  • Reviewing Tweet Fetching
  • Regular Expressions
  • An Intro to Web Scraping
  • Meet Your Web Inspector
  • Inspecting a Webpage’s Traffic
  • Parsing HTML with Nokogiri
  • Writing a Web Crawler
  • The Mechanize Gem
  • SQL
  • Using Non-Ruby Programs With Ruby
  • Image Manipulation
  • Exception and Error Handling
  • Object-Oriented Concepts
  • Recursion
  • Comparing California’s Costs of Surgery
  • Counting the Jail Logs
  • Gathering the Standard & Poor’s 500 Stock Listings

Read: The Bastard’s Book of Ruby


Learn Ruby the Hard Way, 3rd Edition

Sponsor Advertisement

  • Author: Zed A. Shaw
  • Format: online HTML
  • Price: free (print edition available on Amazon)

In Learn Ruby the Hard Way, Third Edition , you’ll learn Ruby by working through 52 brilliantly crafted exercises. Read them. Type their code precisely. (No copying and pasting!) Fix your mistakes. Watch the programs run. As you do, you’ll learn how software works; what good programs look like; how to read, write, and think about code; and how to find and fix your mistakes using tricks professional programmers use.

Chapters include:

  • The Setup
  • A Good First Program
  • Comments And Pound Characters
  • Numbers And Math
  • Variables And Names
  • More Variables And Printing
  • Strings And Text
  • More Printing
  • Printing, Printing
  • Printing, Printing, Printing
  • What Was That?
  • Asking Questions
  • Prompting People
  • Parameters, Unpacking, Variables
  • Prompting And Passing
  • Reading Files
  • Reading And Writing Files
  • More Files
  • Names, Variables, Code, Functions
  • Functions And Variables
  • Functions And Files
  • Functions Can Return Something
  • What Do You Know So Far?
  • Read Some Code
  • More Practice
  • Even More Practice
  • Congratulations, Take A Test!
  • Memorizing Logic
  • Boolean Practice
  • What If
  • Else And If
  • Making Decisions
  • Loops And Arrays
  • While Loops
  • Accessing Elements Of Arrays
  • Branches and Functions
  • Designing and Debugging
  • Symbol Review
  • Doing Things To Arrays
  • Dictionaries, Oh Lovely Dictionaries
  • Modules, Classes, And Objects
  • Learning To Speak Object Oriented
  • Is-A, Has-A, Objects, and Classes
  • Gothons From Planet Percal #25
  • Inheritance Vs. Composition
  • You Make A Game
  • A Project Skeleton
  • Automated Testing
  • Advanced User Input
  • Making Sentences
  • Your First Website
  • Getting Input From A Browser
  • The Start Of Your Web Game
  • Advice From An Old Programmer
  • Next Steps
  • Command Line Crash Course

Read: Learn Ruby the Hard Way, 3rd Edition


Buy print edition

Ruby Best Practices

Sponsor Advertisement

My image
  • Author: Gregory Brown
  • Format: online HTML, PDF
  • Price: free (hard copy available on Amazon)

How do you write truly elegant code with Ruby? Ruby Best Practices is for programmers who want to use Ruby as experienced Rubyists do. Written by the developer of the Ruby project Prawn, this concise book explains how to design beautiful APIs and domain-specific languages with Ruby, as well as how to work with functional programming ideas and techniques that can simplify your code and make you more productive. You’ll learn how to write code that’s readable, expressive, and much more.

Chapters include:

  • Driving Code Through Tests
  • Designing Beautiful APIS
  • Mastering the Dynamic Toolkit
  • Text Processing and File Management
  • Functional Programming Techniques
  • When Things Go Wrong
  • Reducing Cultural Barriers
  • Skillful Project Maintenance
  • Writing Backwards Compatible Code
  • Leveraging Ruby’s Standard Library
  • Ruby Worst Practices

Get the book: Ruby Best Practices

Ruby Programming

Sponsor Advertisement

My image
  • Author: Wikibooks
  • Format: online HTML, PDF
  • Price: free

The book is currently broken down into several sections and is intended to be read sequentially. Getting started will show how to install and get started with Ruby in your environment. Basic Ruby demonstrates the main features of the language syntax. The Ruby language section is organized like a reference to the language. Available modules covers some of the standard library. Intermediate Ruby covers a selection of slightly more advanced topics. Each section is designed to be self contained. The book is a work in progress and is subject to change.

Chapters include:

  • Overview
  • Installing Ruby
  • Ruby editors
  • Notation conventions
  • Interactive Ruby
  • Mailing List FAQ
  • Hello world
  • Strings
  • Alternate quotes
  • Here documents
  • Encoding
  • Introduction to objects
  • Ruby basics
  • Data types — numbers, strings, hashes and arrays
  • Writing methods
  • Classes and objects
  • Exceptions
  • Lexicology
  • Variables and Constants
  • Literals
  • Operators
  • Control Structures
  • Methods
  • Classes
  • Built-in Functions
  • Predefined Variables (globals)
  • Predefined Classes
  • Available Standard Library Modules
  • Database Interface Modules
  • GUI Toolkit Modules
  • Tk
  • GTK2 Notes on the GTK/Gnome bindings.
  • Qt4
  • Unit testing
  • RubyDoc
  • Rake
  • RubyGems
  • Running Multiple Processes
  • Using Network Sockets
  • Building C Extensions
  • Rails
  • Embedding Ruby within a separate C program

Just Enough Ruby to Get By

Sponsor Advertisement

My image
  • Author: Jason Kim
  • Format: online HTML
  • Price: free

The book has two main objectives.

Introduce important topics in Ruby as quickly as possible
Ramp up problem solving skills to tackle real world problems
The book has two kinds of audiences in mind.

Absolute beginners who do not have any programming experience
Experienced programmers who have programmed in other languages such as C, C++ and Java
The book isn’t aimed at seasoned Ruby programmers. Most of the topics covered by the book will be familiar to programmers who work primarily with Ruby. It might serve a different purpose for Ruby programmers as a refresher.

While the book will cover wide varieties of topics in Ruby language and its ecosystem, it should not be considered as an exhaustive reference.

The book is still in the beta stage. It contains errors and the structure of the book will change over time.

Chapters include:

  • Overview
  • Basic Data Types
  • Expressions and Statements
  • Error Handling
  • Simple Methods
  • Iterators
  • Classes

Get the book: Just Enough Ruby to Get By

The Ruby Style Guide

Sponsor Advertisement

My image
  • Author: Bozhidar Batsov
  • Format: online HTML, archived HTML
  • Price: free

This Ruby style guide recommends best practices so that real-world Ruby programmers can write code that can be maintained by other real-world Ruby programmers. A style guide that reflects real-world usage gets used, and a style guide that holds to an ideal that has been rejected by the people it is supposed to help risks not getting used at all – no matter how good it is.

Chapters include:

  • Source Code Layout
  • Syntax
  • Naming
  • Comments
  • Classes
  • Exceptions
  • Collections
  • Strings
  • Regular Expressions
  • Percent Literals
  • Metaprogramming
  • Misc
  • Tools

Ruby Hacking Guide

Sponsor Advertisement

My image
  • Author: Minero Aoki, Translated by Vincent Isambart and Clifford Escobar Caoile
  • Format: online HTML
  • Price: free

This book explores several themes with the following goals in mind: To have knowledge of the structure of ruby, To gain knowledge about language processing systems in general, To acquire skills in reading source code.

Ruby is an object-oriented language developed by Yukihiro Matsumoto. The official implementation of the Ruby language is called ruby. It is actively developed and maintained by the open source community. Our first goal is to understand the inner-workings of the ruby implementation. This book is going to investigate ruby as a whole.

Secondly, by knowing about the implementation of Ruby, we will be able to know about other language processing systems. This book tries to cover all topics necessary for implementing a language, such as hash table, scanner and parser, evaluation procedure, and many others. Because this book is not intended as a text book, going through entire areas and ideas without any lack was not reasonable. However the parts relating to the essential structures of a language implementation are adequately explained. And a brief summary of Ruby language itself is also included so that readers who don’t know about Ruby can read this book.

Chapters include:

  • A Minimal Introduction to Ruby
  • Objects
  • Names and name tables
  • Classes and modules
  • Garbage collection
  • Variables and constants
  • Security
  • Ruby Language Details
  • yacc crash course
  • Parser
  • Finite-state scanner
  • Syntax tree construction
  • Structure of the evaluator
  • Context
  • Methods
  • Blocks
  • Dynamic evaluation
  • Loading
  • Threads

Data Structures and Algorithms with Object-Oriented Design Patterns in Ruby

Sponsor Advertisement

  • Author: Bruno R. Preiss
  • Format: online HTML
  • Price: free

Create sound software designs with data structures that use modern object-oriented design patterns!

Author Bruno Preiss presents the fundamentals of data structures and algorithms from a modern, object-oriented perspective.

The text promotes object-oriented design using Ruby and illustrates the use of the latest object-oriented design patterns. Virtually all the data structures are discussed in the context of a single class hierarchy.

This framework clearly shows the relationships between data structures and illustrates how polymorphism and inheritance can be used effectively.

Chapters include:

  • Algorithm Analysis
  • Asymptotic Notation
  • Foundational Data Structures
  • Data Types and Abstraction
  • Stacks, Queues, and Deques
  • Ordered Lists and Sorted Lists
  • Hashing, Hash Tables, and Scatter Tables
  • Trees
  • Search Trees
  • Heaps and Priority Queues
  • Sets, Multisets, and Partitions
  • Garbage Collection and the Other Kind of Heap
  • Algorithmic Patterns and Problem Solvers
  • Sorting Algorithms and Sorters
  • Graphs and Graph Algorithms
  • Ruby and Object-Oriented Programming
  • Class Hierarchy Diagrams
  • Character Codes

Read the book: Data Structures and Algorithms with Object-Oriented Design Patterns in Ruby