Books & Videos

Table of Contents

  1. Chapter 1 Driving Code Through Tests

    1. A Quick Note on Testing Frameworks

    2. Designing for Testability

    3. Testing Fundamentals

    4. Advanced Testing Techniques

    5. Keeping Things Organized

    6. Conclusions

  2. Chapter 2 Designing Beautiful APIs

    1. Designing for Convenience: Ruport’s Table( ) feature

    2. Ruby’s Secret Power: Flexible Argument Processing

    3. Ruby’s Other Secret Power: Code Blocks

    4. Avoiding Surprises

    5. Conclusions

  3. Chapter 3 Mastering the Dynamic Toolkit

    1. BlankSlate: A BasicObject on Steroids

    2. Building Flexible Interfaces

    3. Implementing Per-Object Behavior

    4. Extending and Modifying Preexisting Code

    5. Building Classes and Modules Programmatically

    6. Registering Hooks and Callbacks

    7. Conclusions

  4. Chapter 4 Text Processing and File Management

    1. Line-Based File Processing with State Tracking

    2. Regular Expressions

    3. Working with Files

    4. The tempfile Standard Library

    5. Text-Processing Strategies

    6. Conclusions

  5. Chapter 5 Functional Programming Techniques

    1. Laziness Can Be a Virtue (A Look at lazy.rb)

    2. Minimizing Mutable State and Reducing Side Effects

    3. Modular Code Organization

    4. Memoization

    5. Infinite Lists

    6. Higher-Order Procedures

    7. Conclusions

  6. Chapter 6 When Things Go Wrong

    1. A Process for Debugging Ruby Code

    2. Capturing the Essence of a Defect

    3. Scrutinizing Your Code

    4. Working with Logger

    5. Conclusions

  7. Chapter 7 Reducing Cultural Barriers

    1. m17n by Example: A Look at Ruby’s CSV Standard Library

    2. Portable m17n Through UTF-8 Transcoding

    3. m17n in Standalone Scripts

    4. m17n-Safe Low-Level Text Processing

    5. Localizing Your Code

    6. Conclusions

  8. Chapter 8 Skillful Project Maintenance

    1. Exploring a Well-Organized Ruby Project (Haml)

    2. Conventions to Know About

    3. API Documentation via RDoc

    4. The RubyGems Package Manager

    5. Rake: Ruby’s Built-in Build Utility

    6. Conclusions

  1. Appendix Writing Backward-Compatible Code

    1. Avoiding a Mess

    2. Nonportable Features in Ruby 1.9

    3. Workarounds for Common Issues

    4. Conclusions

  2. Appendix Leveraging Ruby’s Standard Library

    1. Why Do We Need a Standard Library?

    2. Pretty-Printer for Ruby Objects (pp)

    3. Working with HTTP and FTP (open-uri)

    4. Working with Dates and Times (date)

    5. Lexical Parsing with Regular Expressions (strscan)

    6. Cryptographic Hash Functions (digest)

    7. Mathematical Ruby Scripts (mathn)

    8. Working with Tabular Data (csv)

    9. Transactional Filesystem-Based Data Storage (pstore)

    10. Human-Readable Data Serialization (json)

    11. Embedded Ruby for Code Generation (erb)

    12. Conclusions

  3. Appendix Ruby Worst Practices

    1. Not-So-Intelligent Design

    2. The Downside of Cleverness

    3. Conclusions

  4. Colophon