Synopses & Reviews
The Ruby Programming Language is the authoritative guide to Ruby and provides comprehensive coverage of versions 1.8 and 1.9 of the language. It was written (and illustrated!) by an all-star team:
- David Flanagan, bestselling author of programming language "bibles" (including JavaScript: The Definitive Guide and Java in a Nutshell) and committer to the Ruby Subversion repository.
- Yukihiro "Matz" Matsumoto, creator, designer and lead developer of Ruby and author of Ruby in a Nutshell, which has been expanded and revised to become this book.
- why the lucky stiff, artist and Ruby programmer extraordinaire.
This book begins with a quick-start tutorial to the language, and then explains the language in detail from the bottom up: from lexical and syntactic structure to datatypes to expressions and statements and on through methods, blocks, lambdas, closures, classes and modules.
The book also includes a long and thorough introduction to the rich API of the Ruby platform, demonstrating -- with heavily-commented example code -- Ruby's facilities for text processing, numeric manipulation, collections, input/output, networking, and concurrency. An entire chapter is devoted to Ruby's metaprogramming capabilities.
The Ruby Programming Language documents the Ruby language definitively but without the formality of a language specification. It is written for experienced programmers who are new to Ruby, and for current Ruby programmers who want to challenge their understanding and increase their mastery of the language.
Synopsis
If you're interested in developing applications for Apple's Mac OS X platform, but prefer to use a sleek, developer-friendly language, MacRuby is ideal. This in-depth guide shows you how this Apple implementation of the Ruby language provides access to all of the features available to Objective-C programmers. You'll get clear, detailed explanations of MacRuby, including quick programming techniques such as prototyping classes.
Ideal for programmers of all experience levels, MacRuby: The Definitive Guide is packed with code samples. If you're a programmer familiar with Ruby, you can tap your skills to take advantage of Interface Builder, the Cocoa libraries, Objective-C runtime, and more. If you already develop with Cocoa, you'll discover how MacRuby will improve your productivity.
Topics include:
- MacRuby basics, including classes and methods
- Advanced features, such as selectors, blocks, and concurrency
- Primitive object classes and data types in Cocoa's Foundation framework
- AppKit classes for building Mac OS X GUI applications
- Relational object persistence with Cocoas Core Data data model framework
- Apple's Xcode suite of developer tools, including Interface Builder
About the Author
David Flanagan is a computer programmer who spends most of his time writing about JavaScript and Java. His books with O'Reilly include JavaScript: The Definitive Guide, JavaScript Pocket Reference, Java in a Nutshell, Java Examples in a Nutshell, and Java Foundation Classes in a Nutshell. David has a degree in computer science and engineering from the Massachusetts Institute of Technology. He lives with his wife and children in the U.S. Pacific Northwest bewteen the cities of Seattle, Washington and Vancouver, British Columbia. David has a blog at www.davidflanagan.com.
Yukihiro Matsumoto ("Matz"), the creator of Ruby, is a professional programmer who worked for the Japanese open source company, netlab.jp. Matz is also known as one of the open source evangelists in Japan. He's released several open source products, including cmail, the emacs-based mail user agent, written entirely in emacs lisp. Ruby is his first piece of software that has become known outside of Japan.
Table of Contents
Preface; Acknowledgments; Conventions Used in This Book; Using Code Examples; How to Contact Us; Safari® Enabled; Chapter 1: Introduction; 1.1 A Tour of Ruby; 1.2 Try Ruby; 1.3 About This Book; 1.4 A Sudoku Solver in Ruby; Chapter 2: The Structure and Execution of Ruby Programs; 2.1 Lexical Structure; 2.2 Syntactic Structure; 2.3 File Structure; 2.4 Program Encoding; 2.5 Program Execution; Chapter 3: Datatypes and Objects; 3.1 Numbers; 3.2 Text; 3.3 Arrays; 3.4 Hashes; 3.5 Ranges; 3.6 Symbols; 3.7 True, False, and Nil; 3.8 Objects; Chapter 4: Expressions and Operators; 4.1 Literals and Keyword Literals; 4.2 Variable References; 4.3 Constant References; 4.4 Method Invocations; 4.5 Assignments; 4.6 Operators; Chapter 5: Statements and Control Structures; 5.1 Conditionals; 5.2 Loops; 5.3 Iterators and Enumerable Objects; 5.4 Blocks; 5.5 Altering Control Flow; 5.6 Exceptions and Exception Handling; 5.7 BEGIN and END; 5.8 Threads, Fibers, and Continuations; Chapter 6: Methods, Procs, Lambdas, and Closures; 6.1 Defining Simple Methods; 6.2 Method Names; 6.3 Methods and Parentheses; 6.4 Method Arguments; 6.5 Procs and Lambdas; 6.6 Closures; 6.7 Method Objects; 6.8 Functional Programming; Chapter 7: Classes and Modules; 7.1 Defining a Simple Class; 7.2 Method Visibility: Public, Protected, Private; 7.3 Subclassing and Inheritance; 7.4 Object Creation and Initialization; 7.5 Modules; 7.6 Loading and Requiring Modules; 7.7 Singleton Methods and the Eigenclass; 7.8 Method Lookup; 7.9 Constant Lookup; Chapter 8: Reflection and Metaprogramming; 8.1 Types, Classes, and Modules; 8.2 Evaluating Strings and Blocks; 8.3 Variables and Constants; 8.4 Methods; 8.5 Hooks; 8.6 Tracing; 8.7 ObjectSpace and GC; 8.8 Custom Control Structures; 8.9 Missing Methods and Missing Constants; 8.10 Dynamically Creating Methods; 8.11 Alias Chaining; 8.12 Domain-Specific Languages; Chapter 9: The Ruby Platform; 9.1 Strings; 9.2 Regular Expressions; 9.3 Numbers and Math; 9.4 Dates and Times; 9.5 Collections; 9.6 Files and Directories; 9.7 Input/Output; 9.8 Networking; 9.9 Threads and Concurrency; Chapter 10: The Ruby Environment; 10.1 Invoking the Ruby Interpreter; 10.2 The Top-Level Environment; 10.3 Practical Extraction and Reporting Shortcuts; 10.4 Calling the OS; 10.5 Security; Colophon;