Ruby Best Practices
Edition 1
Sada Preisch
David Futato
Robert Romano
Ellen Troutman Zaig
Karen Montgomery
Copyright © 2009 Gregory Brown
Legal Notice
Printed in the United States of America.
Legal Notice
[M]
Legal Notice
O’Reilly books may be purchased for educational, business, or sales
promotional use. Online editions are also available for most titles
(http://my.safaribooksonline.com).
For more information, contact our corporate/institutional sales
department: 800-998-9938 or [email protected].
Legal Notice
O’Reilly and the O’Reilly logo are registered trademarks of O’Reilly Media, Inc. Ruby Best Practices, the image of a green crab, and related trade dress are trademarks of O’Reilly Media, Inc.
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and O’Reilly Media, Inc. was aware of a trademark claim, the designations have been printed in caps or initial caps.
Legal Notice
While every precaution has been taken in the preparation of this book, the publisher and author assume no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein. In March 2010, this work will be released under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to Creative Commons, 171 2nd Street, Suite 300, San Francisco, California, 94105, USA.
- Foreword
- Preface
- 1. Driving Code Through Tests
- 2. Designing Beautiful APIs
- 3. Mastering the Dynamic Toolkit
- 4. Text Processing and File Management
- 5. Functional Programming Techniques
- 6. When Things Go Wrong
- 7. Reducing Cultural Barriers
- 8. Skillful Project Maintenance
- A. Writing Backward-Compatible Code
- B. Leveraging Ruby’s Standard Library
- B.1. Why Do We Need a Standard Library?
- B.2. Pretty-Printer for Ruby Objects (pp)
- B.3. Working with HTTP and FTP (open-uri)
- B.4. Working with Dates and Times (date)
- B.5. Lexical Parsing with Regular Expressions (strscan)
- B.6. Cryptographic Hash Functions (digest)
- B.7. Mathematical Ruby Scripts (mathn)
- B.8. Working with Tabular Data (csv)
- B.9. Transactional Filesystem-Based Data Storage (pstore)
- B.10. Human-Readable Data Serialization (json)
- B.11. Embedded Ruby for Code Generation (erb)
- B.12. Conclusions
- C. Ruby Worst Practices
- Index
- n
- Next Page
- p
- Previos Page
- h
- Book Home
- u
- Go Up One Level
- ?
- Press ? for Help
- esc
- Hide Help
Press '?' for keyboard shortcuts