Humburger Icon
Let's Explore, Bibiliophile
close menu
Bookswagon-24x7 online bookstore
close menu
My Account
Ruby Phrasebook: (Developer's Library)

Ruby Phrasebook: (Developer's Library)

          
5
4
3
2
1

Out of Stock


Premium quality
Premium quality
Bookswagon upholds the quality by delivering untarnished books. Quality, services and satisfaction are everything for us!
Easy Return
Easy return
Not satisfied with this product! Keep it in original condition and packaging to avail easy return policy.
Certified product
Certified product
First impression is the last impression! Address the book’s certification page, ISBN, publisher’s name, copyright page and print quality.
Secure Checkout
Secure checkout
Security at its finest! Login, browse, purchase and pay, every step is safe and secured.
Money back guarantee
Money-back guarantee:
It’s all about customers! For any kind of bad experience with the product, get your actual amount back after returning the product.
On time delivery
On-time delivery
At your doorstep on time! Get this book delivered without any delay.
Notify me when this book is in stock
Add to Wishlist

About the Book

Ruby Phrasebook

 

Jason Clinton

 

Essential Code and Commands

 

Ruby Phrasebook gives you the code you need to quickly and effectively work with Ruby, one of the fastest-growing languages in the world thanks to popular new Ruby technologies like Ruby on Rails.

 

Concise and Accessible

Easy to carry and easy to use—lets you ditch all those bulky books for one portable pocket guide

 

Flexible and Functional

Packed with more than 100 customizable code snippets—so you can readily code functional Ruby in just about any situation

 

Jason Clinton uses Ruby daily in system administration and development for Advanced Clustering Technologies, a Linux Beowulf cluster integrator. He has been working in the computer industry for more than a decade and is actively involved in the Kansas City Ruby Users Group (KCRUG), serving as administrator of the group’s web site and mailing list.

 

Register your book at informit.com/register for convenient access to downloads, updates, and corrections as they become available.

 

Programming / Ruby



Table of Contents:
Introduction 1

Audience 1

How to Use This Book 2

Conventions 2

Acknowledgments 4

 

1 Converting Between Types 5

Number from a String 6

Number to Formatted String 7

String to Array and Back Again 10

String to Regular Expression and Back Again 12

Array to Hash and Back Again 13

Array to Set and Back Again 15

Floating-Point, Integer, and Rational Numbers 15

 

2 Working with Strings 19

Searching Strings 20

Searching Strings with Regular Expressions 21

Replacing Substrings 23

Replacing Substrings using SprintF 24

Replacing Substrings using Regu 26

Working with Unicode 26

Sanitizing Input 27

Working with Line Endings 28

Processing Large Strings 30

Comparing Strings 31

Checksumming a String (MD5 or Otherwise) 31

Encrypting a String 32

 

3 Working with Collections 35

Slicing an Array 35

Iterating over an Array 37

Creating Enumerable Classes 38

Sorting an Array 40

Iterating over Nested Arrays 41

Modifying All the Values in an Array 42

Sorting Nested Arrays 42

Building a Hash from a Config File 44

Sorting a Hash by Key or Value 45

Eliminating Duplicate Data from Arrays (Sets) 46

Working with Nested Sets 47

 

4 Working with Objects 49

Inspecting Objects and Classes 50

String Presentation of Objects 50

Ruby-Style Polymorphisms (“Duck Typing”) 51

Comparing Objects 52

Serializing Objects 53

Duplication 54

Protecting an Object Instance 55

Garbage Collecting 56

Using Symbols 57

 

5 Working with Pipes 61

Determining Interactive Standard Pipes 62

Synchronizing STDERR with STDOUT 63

Capturing the Output of a Child Process 64

Implementing a Progress Bar 65

Creating a Secured Password Prompt 66

 

6 Working with Files 69

Opening and Closing Files 69

Searching and Seeking Large File Contents 70

 When to Use Binary Mode (Win32) 73

Obtaining an Exclusive Lock 74

Copying, Moving, and Deleting Files 74

 

7 Manipulating Text 77

Parsing an LDIF 77

Parsing a Simple Config File 78

Interpolating One Text File 79

Sorting the Contents of a File 80

Processing a passwd File 81

 

8 Ruby One-Liners 83

Simple Search 84

Counting Lines in a File 84

Head or Tail of a File 84

MD5 or SHA1 Hash 85

Simple HTTP Fetch 86

Simple TCP Connect 87

Escaping HTML 87

Deleting Empty Directories 88

Adding Users from a Text File 88

Delete All the Files Just Extracted 89

 

9 Processing XML 91

Opening an XML File 92

Accessing an Element (Node) 93

Getting a List of Attributes 95

Adding an Element 96

Changing an Element’s Enclosed Text 97

Deleting an Element 98

Adding an Attribute 98

Changing an Attribute 99

Deleting an Attribute 99

Escaping Characters for XML 100

Transforming Using XSLT 100

Validating Your XML 102

A Simple RSS Parser 103

 

10 Rapid Applications Development with GUI

Toolkits 107

A Simple GTK+ Hello World 108

Using Glade 110

A Simple Qt Hello World 115

Attaching a Signal Handler to a Qt

Widget Slot 116

Using Qt Designer 118

Attaching Signal Handlers to Qt Designer

Generated Code 124

 

11 Simple CGI Forms 127

Processing a Web Form 128

Returning Tabled Results 131

Escaping Input 134

Locking Down Ruby 136

Receiving an Uploaded File 137

Representing Data Graphically 138

 

12 Connecting to Databases 143

Opening (and Closing) a MySQL Database

Connection 144

Creating a Table 145

Getting a List of Tables 146

Adding Rows to a Table 146

Iterating Over Queried Rows 147

Deleting Rows 147

Deleting a Table 148

 

13 Working with Networking and Sockets 151

Connecting to a TCP Socket 152

Running a TCP Server on a Socket 153

 Serializing Objects with YAML 156

Network Objects with Distributed Ruby 158

Using Net::HTTP 159

Using Webrick 160

 

14 Working with Threads 163

Creating a Thread 164

Using a Timer 165

Killing a Thread 168

Synchronizing Thread Communication 169

Multithreaded Exception Gathering 172

 

15 Documenting Your Ruby 175

Documenting Ruby Code 176

Typographic Conventions Used 177

Overriding Method Signatures in

Documentation 179

Hiding a Module, Class, or Method 180

Providing Program Usage Help 180

Generating HTML Documentation 182

Generating and Installing Documentation for ri 183

 

16 Working with Ruby Packages 185

Installing a Module 187

Removing a Module 188

Searching for a Module 188

Updating Modules 188

Examining a Module 189

Packaging Your Module with Hoe 189

Creating a Simple Test Case 190

Distributing Your Module on RubyForge 191

Making Rakefile Standalone 192

 

Index 195


Best Seller

| | See All

Product Details
  • ISBN-13: 9780768666434
  • Publisher: Pearson Education (US)
  • Publisher Imprint: Sams Publishing
  • Language: English
  • Series Title: Developer's Library
  • ISBN-10: 0768666430
  • Publisher Date: 06 Aug 2008
  • Binding: Digital download
  • No of Pages: 218


Similar Products

How would you rate your experience shopping for books on Bookswagon?

Add Photo
Add Photo

Customer Reviews

REVIEWS           
Be The First to Review
Ruby Phrasebook: (Developer's Library)
Pearson Education (US) -
Ruby Phrasebook: (Developer's Library)
Writing guidlines
We want to publish your review, so please:
  • keep your review on the product. Review's that defame author's character will be rejected.
  • Keep your review focused on the product.
  • Avoid writing about customer service. contact us instead if you have issue requiring immediate attention.
  • Refrain from mentioning competitors or the specific price you paid for the product.
  • Do not include any personally identifiable information, such as full names.

Ruby Phrasebook: (Developer's Library)

Required fields are marked with *

Review Title*
Review
    Add Photo Add up to 6 photos
    Would you recommend this product to a friend?
    Tag this Book
    Read more
    Does your review contain spoilers?
    What type of reader best describes you?
    I agree to the terms & conditions
    You may receive emails regarding this submission. Any emails will include the ability to opt-out of future communications.

    CUSTOMER RATINGS AND REVIEWS AND QUESTIONS AND ANSWERS TERMS OF USE

    These Terms of Use govern your conduct associated with the Customer Ratings and Reviews and/or Questions and Answers service offered by Bookswagon (the "CRR Service").


    By submitting any content to Bookswagon, you guarantee that:
    • You are the sole author and owner of the intellectual property rights in the content;
    • All "moral rights" that you may have in such content have been voluntarily waived by you;
    • All content that you post is accurate;
    • You are at least 13 years old;
    • Use of the content you supply does not violate these Terms of Use and will not cause injury to any person or entity.
    You further agree that you may not submit any content:
    • That is known by you to be false, inaccurate or misleading;
    • That infringes any third party's copyright, patent, trademark, trade secret or other proprietary rights or rights of publicity or privacy;
    • That violates any law, statute, ordinance or regulation (including, but not limited to, those governing, consumer protection, unfair competition, anti-discrimination or false advertising);
    • That is, or may reasonably be considered to be, defamatory, libelous, hateful, racially or religiously biased or offensive, unlawfully threatening or unlawfully harassing to any individual, partnership or corporation;
    • For which you were compensated or granted any consideration by any unapproved third party;
    • That includes any information that references other websites, addresses, email addresses, contact information or phone numbers;
    • That contains any computer viruses, worms or other potentially damaging computer programs or files.
    You agree to indemnify and hold Bookswagon (and its officers, directors, agents, subsidiaries, joint ventures, employees and third-party service providers, including but not limited to Bazaarvoice, Inc.), harmless from all claims, demands, and damages (actual and consequential) of every kind and nature, known and unknown including reasonable attorneys' fees, arising out of a breach of your representations and warranties set forth above, or your violation of any law or the rights of a third party.


    For any content that you submit, you grant Bookswagon a perpetual, irrevocable, royalty-free, transferable right and license to use, copy, modify, delete in its entirety, adapt, publish, translate, create derivative works from and/or sell, transfer, and/or distribute such content and/or incorporate such content into any form, medium or technology throughout the world without compensation to you. Additionally,  Bookswagon may transfer or share any personal information that you submit with its third-party service providers, including but not limited to Bazaarvoice, Inc. in accordance with  Privacy Policy


    All content that you submit may be used at Bookswagon's sole discretion. Bookswagon reserves the right to change, condense, withhold publication, remove or delete any content on Bookswagon's website that Bookswagon deems, in its sole discretion, to violate the content guidelines or any other provision of these Terms of Use.  Bookswagon does not guarantee that you will have any recourse through Bookswagon to edit or delete any content you have submitted. Ratings and written comments are generally posted within two to four business days. However, Bookswagon reserves the right to remove or to refuse to post any submission to the extent authorized by law. You acknowledge that you, not Bookswagon, are responsible for the contents of your submission. None of the content that you submit shall be subject to any obligation of confidence on the part of Bookswagon, its agents, subsidiaries, affiliates, partners or third party service providers (including but not limited to Bazaarvoice, Inc.)and their respective directors, officers and employees.

    Accept

    New Arrivals

    | | See All


    Inspired by your browsing history


    Your review has been submitted!

    You've already reviewed this product!
    ASK VIDYA