Book description
You don't have to know everything about a car to drive one, and you don't need to know everything about Ruby to start programming with it. Written for both experienced and new programmers alike, Learning Ruby is a just-get-in-and-drive book -- a hands-on tutorial that offers lots of Ruby programs and lets you know how and why they work, just enough to get you rolling down the road.
Interest in Ruby stems from the popularity of Rails, the web development framework that's attracting new devotees and refugees from Java and PHP. But there are plenty of other uses for this versatile language. The best way to learn is to just try the code! You'll find examples on nearly every page of this book that you can imitate and hack. Briefly, this book:
- Outlines many of the most important features of Ruby
- Demonstrates how to use conditionals, and how to manipulate strings in Ruby. Includes a section on regular expressions
- Describes how to use operators, basic math, functions from the Math module, rational numbers, etc.
- Talks you through Ruby arrays, and demonstrates hashes in detail
- Explains how to process files with Ruby
- Discusses Ruby classes and modules (mixins) in detail, including a brief introduction to object-oriented programming (OOP)
- Introduces processing XML, the Tk toolkit, RubyGems, reflection, RDoc, embedded Ruby, metaprogramming, exception handling, and other topics
- Acquaints you with some of the essentials of Rails, and includes a short Rails tutorial.
Publisher resources
Table of contents
- Dedication
- A Note Regarding Supplemental Files
- Preface
-
1. Ruby Basics
-
Hello, Matz
- A Very Short Ruby Program
- Shebang!
- Issue a System Command
- Appending a String
- Multiply
- Inserting a Shell Command
- Using a Variable
- Expression Substitution
- Formatting a String
- The eval Method and -e Option
- Getting Input from the Keyboard
- Methods
- The block
- The each Method
- The proc
- XML
- The Class
- The Tk Toolkit
- Editing and Running Ruby in TextMate
- Interactive Ruby
- Resources
- Installing Ruby
- Permission Denied
- Associating File Types on Windows
- Review Questions
-
Hello, Matz
- 2. A Quick Tour of Ruby
- 3. Conditional Love
- 4. Strings
- 5. Math
- 6. Arrays
- 7. Hashes
- 8. Working with Files
- 9. Classes
- 10. More Fun with Ruby
- 11. A Short Guide to Ruby on Rails
- A. Ruby Reference
- B. Answers to Review Questions
- Glossary
- Index
- About the Author
- Colophon
- Copyright
Product information
- Title: Learning Ruby
- Author(s):
- Release date: May 2007
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9780596529864
You might also like
video
Learning Ruby
In this Ruby training course, expert author Mike McMillan teaches you the fundamentals of the Ruby …
book
Ruby Cookbook
Do you want to push Ruby to its limits? The Ruby Cookbook is the most comprehensive …
book
Comprehensive Ruby Programming
This book will provide you with all of the tools you need to be a professional …
book
Ruby in a Nutshell
Ruby is an absolutely pure object-oriented scripting language written in C and designed with Perl and …