Limit search to available items
Book Cover
E-book
Author Clinton, Jason.

Title Ruby phrasebook : essential code and commands / by Jason Clinton
Published Upper Saddle River, N.J. : Addison-Wesley/Pearson, ©2009

Copies

Description 1 online resource (vii, 204 pages) : illustrations
Series Developer's library
Developer's library.
Contents 1. Converting Between Types -- Number from a String -- Number to Formatted String -- String to Array and Back Again -- String to Regular Expression and Back Again -- Array to Hash and Back Again -- Array to Set and Back Again -- Floating-Point, Integer, and Rational Numbers -- 2. Working with Strings -- Searching Strings -- Searching Strings with Regular Expressions -- Replacing Substrings -- Replacing Substrings using SprintF -- Replacing Substrings using Regu -- Working with Unicode -- Sanitizing Input -- Working with Line Endings -- Processing Large Strings -- Comparing Strings -- Checksumming a String (MD5 or Otherwise) -- Encrypting a String -- 3. Working with Collections -- Slicing an Array -- Iterating over an Array -- Creating Enumerable Classes -- Sorting an Array -- Iterating over Nested Arrays -- Modifying All the Values in an Array -- Sorting Nested Arrays -- Building a Hash from a Config File -- Sorting a Hash by Key or Value -- Eliminating Duplicate Data from Arrays (Sets) -- Working with Nested Sets -- 4. Working with Objects -- Inspecting Objects and Classes -- String Presentation of Objects -- Ruby-Style Polymorphisms ("Duck Typing") -- Comparing Objects -- Serializing Objects -- Duplication -- Protecting an Object Instance -- Garbage Collecting -- Using Symbols -- 5. Working with Pipes -- Determining Interactive Standard Pipes -- Synchronizing STDERR with STDOUT -- Capturing the Output of a Child Process -- Implementing a Progress Bar -- Creating a Secured Password Prompt -- 6. Working with Files -- Opening and Closing Files -- Searching and Seeking Large File Contents -- When to Use Binary Mode (Win32) -- Obtaining an Exclusive Lock -- Copying, Moving, and Deleting Files -- 7. Manipulating Text -- Parsing an LDIF -- Parsing a Simple Config File -- Interpolating One Text File -- Sorting the Contents of a File -- Processing a passwd File -- 8. Ruby One-Liners -- Simple Search -- Counting Lines in a File -- Head or Tail of a File -- MD5 or SHA1 Hash -- Simple HTTP Fetch -- Simple TCP Connect -- Escaping HTML -- Deleting Empty Directories -- Adding Users from a Text File -- Delete All the Files Just Extracted -- 9. Processing XML -- Opening an XML File -- Accessing an Element (Node) -- Getting a List of Attributes -- Adding an Element -- Changing an Element's Enclosed Text -- Deleting an Element -- Adding an Attribute -- Changing an Attribute -- Deleting an Attribute -- Escaping Characters for XML -- Transforming Using XSLT -- Validating Your XML -- A Simple RSS Parser -- 10. Rapid Applications Development with GUI Toolkits -- A Simple GTK+ Hello World -- Using Glade -- A Simple Qt Hello World -- Attaching a Signal Handler to a Qt Widget Slot -- Using Qt Designer -- Attaching Signal Handlers to Qt Designer Generated Code -- 11. Simple CGI Forms -- Processing a Web Form -- Returning Tabled Results -- Escaping Input -- Locking Down Ruby -- Receiving an Uploaded File -- Representing Data Graphically -- 12. Connecting to Databases -- Opening (and Closing) a MySQL Database Connection -- Creating a Table -- Getting a List of Tables -- Adding Rows to a Table -- Iterating Over Queried Rows -- Deleting Rows -- Deleting a Table -- 13. Working with Networking and Sockets -- Connecting to a TCP Socket -- Running a TCP Server on a Socket -- Serializing Objects with YAML -- Network Objects with Distributed Ruby -- Using Net::HTTP -- Using Webrick -- 14. Working with Threads -- Creating a Thread -- Using a Timer -- Killing a Thread -- Synchronizing Thread Communication -- Multithreaded Exception Gathering -- 15. Documenting Your Ruby -- Documenting Ruby Code -- Typographic Conventions Used -- Overriding Method Signatures in Documentation -- Hiding a Module, Class, or Method -- Providing Program Usage Help -- Generating HTML Documentation -- Generating and Installing Documentation for ri -- 16. Working with Ruby Packages -- Installing a Module -- Removing a Module -- Searching for a Module -- Updating Modules -- Examining a Module -- Packaging Your Module with Hoe -- Creating a Simple Test Case -- Distributing Your Module on RubyForge -- Making Rakefile Standalone
Summary 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
Notes Print version record
Subject Ruby (Computer program language) -- Terminology
COMPUTERS -- General.
Ruby (Computer program language) -- Terminology.
Ruby (Computer program language)
Genre/Form Terminology
Form Electronic book
ISBN 0768666759
9780768666755
9780672328978
0672328976
9780768678673
0768678676
9780768666434
0768666430