Beginning Ruby: From Novice to Professional / Edition 1

Paperback (Print)
Used and New from Other Sellers
Used and New from Other Sellers
from $9.74
Usually ships in 1-2 business days
(Save 75%)
Other sellers (Paperback)
  • All (6) from $9.74   
  • New (3) from $38.89   
  • Used (3) from $9.74   
Sort by
Page 1 of 1
Showing All
Note: Marketplace items are not eligible for any coupons and promotions
Seller since 2015

Feedback rating:



New — never opened or used in original packaging.

Like New — packaging may have been opened. A "Like New" item is suitable to give as a gift.

Very Good — may have minor signs of wear on packaging but item works perfectly and has no damage.

Good — item is in good condition but packaging may have signs of shelf wear/aging or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Acceptable — item is in working order but may show signs of wear such as scratches or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Used — An item that has been opened and may show signs of wear. All specific defects should be noted in the Comments section associated with each item.

Refurbished — A used item that has been renewed or updated and verified to be in proper working condition. Not necessarily completed by the original manufacturer.

cd - rom encluded

Ships from: San Diego, CA

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
  • Express, 48 States
  • Express (AK, HI)
Seller since 2008

Feedback rating:


Condition: New

Ships from: Chicago, IL

Usually ships in 1-2 business days

  • Standard, 48 States
  • Standard (AK, HI)
Seller since 2015

Feedback rating:


Condition: New
Brand new.

Ships from: acton, MA

Usually ships in 1-2 business days

  • Standard, 48 States
  • Standard (AK, HI)
Page 1 of 1
Showing All
Sort by


Ruby is perhaps best known as the engine powering the hugely popular Ruby on Rails web framework. However, it is an extremely powerful and versatile programming language in its own right. It focuses on simplicity and offers a fully object-oriented environment.

Beginning Ruby is a thoroughly contemporary guide for every type of reader who wants to learn Ruby, from novice programmers to web developers to Ruby newcomers. It starts by explaining the principles behind object-oriented programming and within a few chapters builds toward creating a genuine Ruby application.

The book then explains key Ruby principles, such as classes and objects, projects, modules, and libraries, and other aspects of Ruby such as database access. In addition, Ruby on Rails is covered in depth, and the books appendixes provide essential reference information as well as a primer for experienced programmers.

What you’ll learn

  • Understand the basics of Ruby and object-oriented building blocks.
  • Work with Ruby libraries, gems, and documentation.
  • Work with files and databases.
  • Write and deploy Ruby applications.
  • Explore Ruby web frameworks and aspects of network programming with Ruby.
  • Develop desktop and GUI applications with Ruby.

Who this book is for

Beginning programmers, programmers new to Ruby, and web developers interested in knowing the foundations of the language.

Read More Show Less

Product Details

  • ISBN-13: 9781590597668
  • Publisher: Apress
  • Publication date: 3/27/2007
  • Series: Expert's Voice in Open Source Series
  • Edition description: 1st Corrected ed. 2007. Corr. 5th printing 2007
  • Edition number: 1
  • Pages: 664
  • Product dimensions: 1.40 (w) x 7.50 (h) x 9.25 (d)

Meet the Author

A bio is not available for this author.
Read More Show Less

Table of Contents

Foreword     xix
About the Author     xxiii
About the Technical Reviewers     xxv
Acknowledgments     xxvii
Introduction     xxix
Foundations and Scaffolding
Let's Get It Started: Installing Ruby     3
Installing Ruby     4
Windows     4
Apple Mac OS X     7
Linux     10
Other Platforms     12
Summary     13
Programming == Joy: A Whistle-Stop Tour of Ruby and Object Orientation     15
Baby Steps     16
Irb: interactive Ruby     16
Ruby Is English for Computers     17
Why Ruby Makes a Great Programming Language     17
Trails for the Mind     18
Turning Ideas into Ruby Code     20
How Ruby Understands Concepts with Objects and Classes     20
The Making of a Man     21
Basic Variables     23
From People to Pets     24
Everything Is an Object     27
Kernel Methods     29
Passing Data to Methods     29
Using the Methods of the String Class     31
Using Ruby Without Object Orientation     32
Summary     33
Ruby's Building Blocks: Data, Expressions, and Flow Control     35
Numbers and Expressions     35
Basic Expressions     35
Variables     36
Comparison Operators and Expressions     38
Looping Through Numbers with Blocks and Iterators     40
Floating Point Numbers     42
Constants     43
Text and Strings     44
String Literals     44
String Expressions     46
Interpolation     47
String Methods     49
Regular Expressions and String Manipulation     50
Arrays and Lists     57
Basic Arrays     58
Splitting Strings Into Arrays     60
Array Iteration     61
Other Array Methods     62
Hashes     65
Basic Hash Methods     66
Hashes Within Hashes     67
Flow Control     68
If and unless     69
?:, The Ternary Operator     70
Elsif and case     71
While and until     72
Code Blocks     74
Other Useful Building Blocks     76
Dates and Times     76
Large Numbers      80
Ranges     81
Symbols     83
Converting Between Classes     84
Summary     85
Developing a Basic Ruby Application     87
Working with Source Code Files     87
Creating a Test File     88
The Test Source Code File     90
Running Your Source Code     90
Our Application: A Text Analyzer     93
Required Basic Features     94
Building the Basic Application     94
Obtaining Some Dummy Text     95
Loading Text Files and Counting Lines     95
Counting Characters     97
Counting Words     98
Counting Sentences and Paragraphs     100
Calculating Averages     102
The Source Code So Far     102
Adding Extra Features     103
Percentage of "Useful" Words     103
Summarizing by Finding "Interesting" Sentences     105
Analyzing Files Other than text.txt     107
The Completed Program     108
Summary     111
The Ruby Ecosystem     113
Ruby's History     113
The Land of the Rising Sun     114
Ruby's Influences      115
Go West     115
Ruby on Rails     117
Why Rails Came into Existence     118
How the Web (2.0) Was Won     119
The Open Source Culture     119
What Is Open Source?     120
Where and How to Get Help     121
Mailing Lists     121
Usenet Newsgroups     121
Internet Relay Chat (IRC)     122
Documentation     123
Forums     124
Joining the Community     124
Give Help to Others     124
Contribute Code     125
Weblogs     125
Summary     126
The Core of Ruby
Classes, Objects, and Modules     129
Why Use Object Orientation?     129
Object Orientation Basics     133
Local, Global, Object, and Class Variables     133
Class Methods vs. Object Methods     138
Inheritance     140
Overriding Existing Methods     143
Reflection and Discovering an Object's Methods     145
Encapsulation     146
Polymorphism     151
Nested Classes     153
The Scope of Constants     154
Modules, Namespaces, and Mix-Ins     156
Namespaces     156
Mix-ins     159
Building a Dungeon Text Adventure with Objects     168
Dungeon Concepts     168
Creating the Initial Classes     168
Structs: Quick and Easy Data Classes     170
Creating Rooms     173
Making the Dungeon Work     173
Summary     178
Projects and Libraries     181
Projects and Using Code from Other Files     181
Basic File Inclusion     181
Inclusions from Other Directories     184
Logic and Including Code     185
Nested Inclusions     185
Libraries     186
The Standard Libraries     187
RubyGems     189
Summary     198
Documentation, Error Handling, Debugging, and Testing     201
Documentation     201
Generating Documentation with RDoc     202
RDoc Techniques     203
Debugging and Errors     208
Exceptions and Error Handling     208
Catch and Throw     212
The Ruby Debugger     213
Testing     216
The Philosophy of Test-Driven Development      217
Unit Testing     219
More Test::Unit Assertions     221
Benchmarking and Profiling     222
Simple Benchmarking     223
Profiling     225
Summary     227
Files and Databases     229
Input and Output     229
Keyboard Input     230
File I/O     231
Basic Databases     248
Text File Databases     248
Storing Objects and Data Structures     251
Relational Databases and SQL     255
Relational Database Concepts     256
The Big Four: MySQL, PostgreSQL, Oracle, and SQLite     257
Installing SQLite     258
A Crash Course in Basic Database Actions and SQL     259
Using SQLite with Ruby     264
Connecting to Other Database Systems     269
ActiveRecord: A Sneak Peek     274
Summary     275
Deploying Ruby Applications and Libraries     279
Distributing Basic Ruby Programs     279
The Shebang Line     280
Associated File Types in Windows     282
"Compiling" Ruby     282
Detecting Ruby's Runtime Environment     284
Easy OS Detection with RUBY_PLATFORM     285
Environment Variables     285
Accessing Command Line Arguments     287
Distributing and Releasing Ruby Libraries As Gems     288
Creating a Gem     289
Distributing a Gem     293
RubyForge     294
Deploying Ruby Applications As Remote Services     295
CGI Scripts     295
Generic HTTP Servers     298
Remote Procedure Calls     303
Summary     308
Advanced Ruby Features     309
Dynamic Code Execution     309
Bindings     310
Other Forms of eval     311
Creating Your Own Version of attr_accessor     314
Running Other Programs from Ruby     315
Getting Results from Other Programs     315
Transferring Execution to Another Program     316
Running Two Programs at the Same Time     316
Interacting with Another Program     317
Safely Handling Data and Dangerous Methods     318
Tainted Data and Objects     319
Safe Levels     321
Working with Microsoft Windows     322
Using the Windows API     323
Controlling Windows Programs     325
Threads     327
Basic Ruby Threads in Action     328
Advanced Thread Operations     329
RubyInline     331
Why Use C As an Inline Language?     332
Creating a Basic Method or Function     332
Benchmarking C vs. Ruby     334
Unicode and UTF-8 Support     336
Summary     339
Tying It Together: Developing a Larger Ruby Application     341
Let's Build a Bot     341
What Is a Bot?     341
Why a Bot?     343
How?     343
Creating a Text Processing Tools Library     344
Building the WordPlay Library     345
Testing the Library     351
Wordplay's Source Code     354
Building the Bot's Core     357
The Program's Life Cycle and Parts     358
Bot Data     360
Constructing the Bot Class and Data Loader     363
The response_to Method     365
Playing with the Bot     371
Main Bot Code Listings     374
Bot.rb     375
Basic_client.rb     378
Extending the Bot     378
Using Text Files As a Source of Conversation     379
Connecting the Bot to the Web     379
Bot-to-Bot Conversations     382
Summary     384
Ruby Online
Ruby on Rails: Ruby's Killer App     387
First Steps     387
What Is Rails and Why Use It?     387
Installing Rails     389
Database Considerations     391
Building a Basic Rails Application     391
Creating a Blank Rails Application     391
Database Initialization     396
Creating a Model and Migrations     398
Scaffolding     404
Controllers and Views     408
Routing     418
Model Relationships     420
Sessions and Filters     422
Other Features     424
Layouts     424
Testing     426
Plugins     428
References and Demo Applications     429
Reference Sites and Tutorials     429
Example Rails Applications     430
Summary     430
Ruby and the Internet     433
HTTP and the Web     433
Downloading Web Pages     433
Generating Web Pages and HTML      443
Processing Web Content     448
E-Mail     454
Receiving Mail with POP3     454
Sending Mail with SMTP     456
Sending Mail with ActionMailer     457
File Transfers with FTP     458
Connection and Basic FTP Actions     459
Downloading Files     461
Uploading Files     462
Summary     464
Networking, Sockets, and Daemons     467
Networking Concepts     467
TCP and UDP     468
IP Addresses and DNS     468
Basic Network Operations     469
Checking Machine and Service Availability     469
Performing DNS Queries     471
Connecting to a TCP Server Directly     474
Servers and Clients     475
UDP Client and Server     475
Building a Simple TCP Server     478
Multi-Client TCP Servers     480
GServer     482
A GServer-Based Chat Server     485
Web/HTTP Servers     488
Daemon Processes     488
Summary     490
Useful Ruby Libraries and Gems     493
Abbrev     494
Installation      494
Examples     494
Further Information     495
Base64     496
Installation     496
Examples     496
Further Information     499
BlueCloth     500
Installation     500
Examples     500
Further Information     501
Cgi     502
Installation     502
Examples     502
Further Information     507
Chronic     508
Installation     508
Examples     508
Further Information     509
Digest     510
Installation     510
Examples     510
Further Information     512
English     513
Installation     513
Examples     513
Further Information     514
ERB     515
Installation     515
Examples     515
Further Information     518
FasterCSV     519
Installation     519
Examples     519
Further Information     525
Iconv     526
Installation      526
Examples     526
Further Information     527
Logger     528
Installation     528
Examples     528
Further Information     530
Pp     531
Installation     531
Examples     531
Further Information     532
RedCloth     533
Installation     533
Examples     533
Further Information     534
StringScanner     535
Installation     535
Examples     535
Further Information     538
Tempfile     539
Installation     539
Examples     539
Further Information     541
Uri     542
Installation     542
Examples     542
Further Information     546
Zlib     547
Installation     547
Examples     547
Further Information     548
Ruby Primer and Review for Developers     549
The Basics     549
Definition and Concepts     549
The Ruby Interpreter and Running Ruby Code      551
Interactive Ruby     553
Expressions, Logic, and Flow Control     553
Basic Expressions     553
Class Mismatches     554
Comparison Expressions     555
Flow     557
Object Orientation     561
Objects     562
Classes and Methods     563
Reflection     565
Reopening Classes     567
Method Visibility     568
Data     569
Strings     569
Regular Expressions     569
Numbers     572
Arrays     574
Hashes (Associative Arrays)     574
Complex Structures     576
Input/Output     576
Files     577
Databases     577
Web Access     578
Libraries     579
File Organization     579
Packaging     580
Ruby Reference     581
Useful Classes and Methods     581
Array     581
Bignum and Fixnum     583
Enumerable     584
Float     585
Hash     585
Integer     586
Numeric      586
Object     587
String     588
Regular Expression Syntax     590
Regular Expression Options     591
Special Characters and Formations     591
Character and Sub-Expression Suffixes     592
Exception Classes     592
Special Variables     596
Ruby License     597
Useful Resources     601
References     601
Ruby     601
Ruby on Rails     602
Blogs     603
Aggregators and Community Blogs     603
Personal Blogs     604
Forums and Newsgroups     604
Mailing Lists     605
Real-Time Chat     606
Tutorials and Guides     607
Installation     607
Ruby and Techniques     608
Ruby on Rails     609
Other     610
Index     611
Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star


4 Star


3 Star


2 Star


1 Star


Your Rating:

Your Name: Create a Pen Name or

Barnes & Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation


  • - By submitting a review, you grant to Barnes & and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Terms of Use.
  • - Barnes & reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously

    If you find inappropriate content, please report it to Barnes & Noble
    Why is this product inappropriate?
    Comments (optional)