| |
| |
Foreword to the Third Edition | |
| |
| |
Preface | |
| |
| |
Road Map | |
| |
| |
| |
Facets of Ruby | |
| |
| |
| |
Getting Started | |
| |
| |
| |
The Command Prompt | |
| |
| |
| |
Installing Ruby | |
| |
| |
| |
Running Ruby | |
| |
| |
| |
Ruby Documentation: RDoc and ri | |
| |
| |
| |
Ruby.new | |
| |
| |
| |
Ruby Is an Object-Oriented Language | |
| |
| |
| |
Some Basic Ruby | |
| |
| |
| |
Arrays and Hashes | |
| |
| |
| |
Symbols | |
| |
| |
| |
Control Structures | |
| |
| |
| |
Regular Expressions | |
| |
| |
| |
Blocks and Iterators | |
| |
| |
| |
Reading and 'Riting | |
| |
| |
| |
Command-Line Arguments | |
| |
| |
| |
Onward and Upward | |
| |
| |
| |
Classes, Objects, and Variables | |
| |
| |
| |
Objects and Attributes | |
| |
| |
| |
Classes Working with Other Classes | |
| |
| |
| |
Access Control | |
| |
| |
| |
Variables | |
| |
| |
| |
Containers, Blocks, and Iterators | |
| |
| |
| |
Arrays | |
| |
| |
| |
Hashes | |
| |
| |
| |
Blocks and Iterators | |
| |
| |
| |
Containers Everywhere | |
| |
| |
| |
Sharing Functionality: Inheritance, Modules, and Mixins | |
| |
| |
| |
Inheritance and Messages | |
| |
| |
| |
Modules | |
| |
| |
| |
Mixins | |
| |
| |
| |
Iterators and the Enumerable Module | |
| |
| |
| |
Composing Modules | |
| |
| |
| |
Inheritance, Mixins, and Design | |
| |
| |
| |
Standard Types | |
| |
| |
| |
Numbers | |
| |
| |
| |
Strings | |
| |
| |
| |
Ranges | |
| |
| |
| |
Regular Expressions | |
| |
| |
| |
What Regular Expressions Let You Do | |
| |
| |
| |
Ruby's Regular Expressions | |
| |
| |
| |
Digging Deeper | |
| |
| |
| |
Advanced Regular Expressions | |
| |
| |
| |
More About Methods | |
| |
| |
| |
Defining a Method | |
| |
| |
| |
Calling a Method | |
| |
| |
| |
Expressions | |
| |
| |
| |
Operator Expressions | |
| |
| |
| |
Miscellaneous Expressions | |
| |
| |
| |
Assignment | |
| |
| |
| |
Conditional Execution | |
| |
| |
| |
Case Expressions | |
| |
| |
| |
Loops | |
| |
| |
| |
Variable Scope, Loops, and Blocks | |
| |
| |
| |
Exceptions, catch, and throw | |
| |
| |
| |
The Exception Class | |
| |
| |
| |
Handling Exceptions | |
| |
| |
| |
Raising Exceptions | |
| |
| |
| |
catch and throw | |
| |
| |
| |
Basic Input and Output | |
| |
| |
| |
What Is an IO Object? | |
| |
| |
| |
Opening and Closing Files | |
| |
| |
| |
Reading and Writing Files | |
| |
| |
| |
Talking to Networks | |
| |
| |
| |
Parsing HTML | |
| |
| |
| |
Fibers, Threads, and Processes | |
| |
| |
| |
Fibers | |
| |
| |
| |
Multithreading | |
| |
| |
| |
Controlling the Thread Scheduler | |
| |
| |
| |
Mutual Exclusion | |
| |
| |
| |
Running Multiple Processes | |
| |
| |
| |
Unit Testing | |
| |
| |
| |
The Testing Framework | |
| |
| |
| |
Structuring Tests | |
| |
| |
| |
Organizing and Running Tests | |
| |
| |
| |
RSpec and Shoulda | |
| |
| |
| |
Test::Unit assertions | |
| |
| |
| |
When Trouble Strikes! | |
| |
| |
| |
Ruby Debugger | |
| |
| |
| |
Interactive Ruby | |
| |
| |
| |
Editor Support | |
| |
| |
| |
But It Doesn't Work! | |
| |
| |
| |
But Ifs Too Slow! | |
| |
| |
| |
Ruby in Its Setting | |
| |
| |
| |
Ruby and Its World | |
| |
| |
| |
Command-Line Arguments | |
| |
| |
| |
Program Termination | |
| |
| |
| |
Environment Variables | |
| |
| |
| |
Where Ruby Finds Its Libraries | |
| |
| |
| |
RubyGems Integration | |
| |
| |
| |
The Rake Build Tool | |
| |
| |
| |
Build Environment | |
| |
| |
| |
Namespaces, Source Files, and Distribution | |
| |
| |
| |
Namespaces | |
| |
| |
| |
Organizing Your Source | |
| |
| |
| |
Distributing and Installing Your Code | |
| |
| |
| |
Character Encoding | |
| |
| |
| |
Encodings | |
| |
| |
| |
Source Files | |
| |
| |
| |
Transcoding | |
| |
| |
| |
Input and Output Encoding | |
| |
| |
| |
Default External Encoding | |
| |
| |
| |
Encoding Compatibility | |
| |
| |
| |
Default Internal Encoding | |
| |
| |
| |
Fun with Unicode | |
| |
| |
| |
Interactive Ruby Shell | |
| |
| |
| |
Command Line | |
| |
| |
| |
Commands | |
| |
| |
| |
Documenting Ruby | |
| |
| |
| |
Adding RDoc to Ruby Code | |
| |
| |
| |
Adding RDoc to C Extensions | |
| |
| |
| |
Running RDoc | |
| |
| |
| |
Ruby source file documented with RDoc | |
| |
| |
| |
C source file documented with RDoc | |
| |
| |
| |
Ruby and the Web | |
| |
| |
| |
Writing CGI Scripts | |
| |
| |
| |
Using cgi.rb | |
| |
| |
| |
Templating Systems | |
| |
| |
| |
Cookies | |
| |
| |
| |
Choice of Web Servers | |
| |
| |
| |
Frameworks | |
| |
| |
| |
Ruby and Microsoft Windows | |
| |
| |
| |
Running Ruby Under Windows | |
| |
| |
| |
Win32API | |
| |
| |
| |
Windows Automation | |
| |
| |
| |
Ruby Crystallized | |
| |
| |
| |
The Ruby Language | |
| |
| |
| |
Source File Encoding | |
| |
| |
| |
Source Layout | |
| |
| |
| |
The Basic Types | |
| |
| |
| |
Names | |
| |
| |
| |
Variables and Constants | |
| |
| |
| |
Expressions, Conditionals, and Loops | |
| |
| |
| |
Method Definition | |
| |
| |
| |
Invoking a Method | |
| |
| |
| |
Aliasing | |
| |
| |
| |
Class Definition | |
| |
| |
| |
Module Definitions | |
| |
| |
| |
Access Control | |
| |
| |
| |
Blocks, Closures, and Proc Objects | |
| |
| |
| |
Exceptions | |
| |
| |
| |
catch and throw | |
| |
| |
| |
Duck Typing | |
| |
| |
| |
Classes Aren't Types | |
| |
| |
| |
Coding like a Duck | |
| |
| |
| |
Standard Protocols and Coercions | |
| |
| |
| |
Walk the Walk, Talk the Talk | |
| |
| |
| |
Metaprograrruning | |
| |
| |
| |
Objects and Classes | |
| |
| |
| |
Singletons | |
| |
| |
| |
Inheritance and Visibility | |
| |
| |
| |
Modules and Mixins | |
| |
| |
| |
Metaprogramrriing Class-Level Macros | |
| |
| |
| |
Two Other Forms of Class Definition | |
| |
| |
| |
instance_eval and class_eval | |
| |
| |
| |
Hook Methods | |
| |
| |
| |
One Last Example | |
| |
| |
| |
Top-Level Execution Environment | |
| |
| |
| |
The Turtle Graphics Program | |
| |
| |
| |
Reflection, ObjectSpace, and Distributed Ruby | |
| |
| |
| |
Looking at Objects | |
| |
| |
| |
Looking at Classes | |
| |
| |
| |
Calling Methods Dynamically | |
| |
| |
| |
System Hooks | |
| |
| |
| |
Tracing Your Program's Execution | |
| |
| |
| |
Behind the Curtain: The Ruby VM | |
| |
| |
| |
Marshaling and Distributed Ruby | |
| |
| |
| |
Compile Time? Runtime? Anytime! | |
| |
| |
| |
Locking Ruby in the Safe | |
| |
| |
| |
Safe Levels | |
| |
| |
| |
Tainted Objects | |
| |
| |
| |
Trusted Objects | |
| |
| |
| |
Definition of the safe levels | |
| |
| |
| |
Ruby Library Reference | |
| |
| |
| |
Built-in Classes and Modules | |
| |
| |
| |
Standard Library | |
| |
| |
| |
Support | |
| |
| |
| |
Web Sites | |
| |
| |
| |
Usenet Newsgroup | |
| |
| |
| |
Mailing Lists | |
| |
| |
| |
Bug Reporting | |
| |
| |
| |
Bibliography | |
| |
| |
Index | |