Cover image for The Ruby way
Title:
The Ruby way
Personal Author:
Edition:
2nd ed.
Publication Information:
Boston, MA : Pearson, 2007
ISBN:
9780672328848

Available:*

Library
Item Barcode
Call Number
Material Type
Item Category 1
Status
Searching...
30000010124384 QA76.64 F84 2007 Open Access Book Book
Searching...

On Order

Summary

Summary

Ruby is an agile object-oriented language, borrowing some of the best features from LISP, Smalltalk, Perl, CLU, and other languages. Its popularity has grown tremendously in the five years since the first edition of this book.

 

The Ruby Way takes a "how-to" approach to Ruby programming with the bulk of the material consisting of more than 400 examples arranged by topic. Each example answers the question "How do I do this in Ruby?" Working along with the author, you are presented with the task description and a discussion of the technical constraints. This is followed by a step-by-step presentation of one good solution. Along the way, the author provides detailed commentary and explanations to aid your understanding.

 

Coverage includes

 

*    An overview of Ruby, explaining terminology and basic principles

*    Operations on low-level data types (numbers, strings, regular expressions, dates)

*    The new regular expression engine (Oniguruma)

*    Internationalization (I18N) and message catalogs in Ruby

*    Operations on hashes, arrays, and other data structures such as stacks, trees, and graphs

*    Working with general I/O, files, and persistent objects

*    Database coverage including MySQL, SQLite, Oracle, DBI, and more

*    Ruby-specific techniques in OOP and dynamic programming

*    Graphical interfaces in Ruby (Tk, GTK+, Fox, and Qt)

*    Working with Ruby threads for lightweight multitasking

*    Everyday scripting and system administration in Ruby

*    Working with image files, PDFs, YAML, XML, RSS, and Atom

*    Testing, debugging, profiling, and packaging Ruby code

*    Low-level network programming and client-server interaction

*    Web development tools including Rails, Nitro, Wee, IOWA, and more

*    Working with distributed Ruby, Rinda, and Ring

*    Ruby development tools such as IDEs, documentation tools, and more

 

The source code for the book can be downloaded from www.rubyhacker.com

 

 

Hal Fulton has worked for over 15 years with variousforms of Unix, including AIX, Solaris, and Linux. He was first exposed to Ruby in 1999, and in 2001 he began work on the first edition of this book-the second Ruby book published in the English language. He has attendednumerous Ruby conferences and has given presentations at several of those, including the first European Ruby Conference. 

 

He has two degrees in computer science from the University of Mississippi and taught computer science for four years before moving to Austin, Texas to work as a contractor for variouscompanies, including IBM Austin.  Hal currently works at Broadwing Communications in Austin, Texas, maintaining a large data warehouse and related telecom applications, working daily with C++, Oracle, and, of course, Ruby.

 

 


Author Notes

Hal Fulton has two degrees in computer science from the University of Mississippi. He taught computer science for four years at the community college level before moving to Austin, Texas, for a series of contracts (mainly at IBM Austin). He has worked for more than 15 years with various forms of UNIX, including AIX, Solaris, and Linux. He was first exposed to Ruby in 1999, and in 2001 he began work on the first edition of this book, which was the second Ruby book in the English language. He has attended six Ruby conferences and has given presentations at four of those, including the first European Ruby Conference in Karlsruhe, Germany. He currently works at Broadwing Communications in Austin, Texas, working on a large data warehouse and related telecom applications. He works daily with C++, Oracle, and of course, Ruby.

Hal is still active daily on the Ruby mailing list and IRC channel, and has several Ruby projects in progress. He is a member of the ACM and the IEEE Computer Society. In his personal life, he enjoys music, reading, writing, art, and photography. He is a member of the Mars Society and is a space enthusiast who would love to go into space before he dies. He lives in Austin, Texas.


Table of Contents

Foreword
Acknowledgments
About the Author
1 Ruby in Review
1.1 An Introduction to Object Orientation
1.1.1 What Is an Object?
1.1.2 Inheritance
1.1.3 Polymorphism
1.1.4 A Few More Terms
1.2 Basic Ruby Syntax and Semantics
1.2.1 Keywords and Identifiers
1.2.2 Comments and Embedded Documentation
1.2.3 Constants, Variables, and Types
1.2.4 Operators and Precedence
1.2.5 A Sample Program
1.2.6 Looping and Branching
1.2.7 Exceptions
1.3 OOP in Ruby
1.3.1 Objects
1.3.2 Built-in Classes
1.3.3 Modules and Mixins
1.3.4 Creating Classes
1.3.5 Methods and Attributes
1.4 Dynamic Aspects of Ruby
1.4.1 Coding at Runtime
1.4.2 Reflection
1.4.3 Missing Methods
1.4.4 Garbage Collection (GC)
1.5 Training Your Intuition: Things to Remember
1.5.1 Syntax Issues
1.5.2 Perspectives in Programming
1.5.3 Ruby's case Statement
1.5.4 Rubyisms and Idioms
1.5.5 Expression Orientation and Other Miscellaneous Issues
1.6 Ruby Jargon and Slang
1.7 Conclusion
2 Working with Strings
2.1 Representing Ordinary Strings
2.2 Representing Strings with Alternate Notations
2.3 Using Here-Documents
2.4 Finding the Length of a String
2.5 Processing a Line at a Time
2.6 Processing a Byte at a Time
2.7 Performing Specialized String Comparisons
2.8 Tokenizing a String
2.9 Formatting a String
2.10 Using Strings As IO Objects
2.11 Controlling Uppercase and Lowercase
2.12 Accessing and Assigning Substrings
2.13 Substituting in Strings
2.14 Searching a String
2.15 Converting Between Characters and ASCII Codes
2.16 Implicit and Explicit Conversion
2.17 Appending an Item Onto a String
2.18 Removing Trailing Newlines and Other Characters
2.19 Trimming Whitespace from a String
2.20 Repeating Strings
2.21 Embedding Expressions Within Strings
2.22 Delayed Interpolation of Strings
2.23 Parsing Comma-Separated Data
2.24 Converting Strings to Numbers (Decimal and Otherwise)
2.25 Encoding and Decoding rot13 Text
2.26 Encrypting Strings
2.27 Compressing Strings
2.28 Counting Characters in Strings
2.29 Reversing a String
2.30 Removing Duplicate Characters
2.31 Removing Specific Characters
2.32 Printing Special Characters
2.33 Generating Successive Strings
2.34 Calculating a 32-Bit CRC
2.35 Calculating the MD5 Hash of a String
2.36 Calculating the Levenshtein Distance Between Two Strings
2.37 Encoding and Decoding base64 Strings
2.38 Encoding and Decoding Strings (uuencode/uudecode)
2.39 Expanding and Compressing Tab Characters
2.40 Wrapping Lines of Text
2.41 Conclusion
3 Working with Regular Expressions
3.1 Regular Expression Syntax
3.2 Compiling Regular Expressions
3.3 Escaping Special Characters
3.4 Using Anchors
3.5 Using Quantifiers
3.6 Positive and Negative Lookahead
3.7 Accessing Backreferences
3.8 Using Character Classes
3.9 Extended Regular Expressions
3.10 Matching a Newline with a Dot
3.11 Using Embedded Options
3.12 Using Embedded Subexpressions
3.13 Ruby and Oniguruma
3.13.1 Testing the Presence of Oniguruma
3.13.2 Building Oniguruma
3.13.3 A Few New Features of Oniguruma
3.13.4 Positive and Negative Lookbehind
3.13.5 More on Quantifiers
3.13.6 Named Matches
3.13.7 Recursion in Regular Expressions
3.14 A Few Sample Regular Expressions
3.14.1 Matching an IP Address
3.14.2 Matching a Keyword-Value Pair
3.14.3 Matching Roman Numerals
3.14.4 Matching Numeric Constants