Ruby in Practice
Jeremy McAnally and Assaf Arkin
  • February 2009
  • ISBN 9781933988474
  • 360 pages
  • printed in black & white

A treasure trove of ideas.

Christopher Haupt, LearningRails podcast co-host

Like Ruby itself, Ruby in Practice will make you more productive. The book shows you practical techniques and strategies for small projects and large-scale environments. A cookbook-style reference, it gives you concrete examples of systems integration, messaging, web development, and databases, all in a clear problem/ solution format.

Part 1 of the book concentrates on the Ruby way of developing software, especially how to use Ruby as a tool for integration. Part 2 talks about REST, Web services, asynchronous messaging, and deployment. In the last part, you'll discover how to manage all forms of data—from manipulating structured documents to identity management. Along the way you'll learn how to use Ruby to build new applications, solve more problems with less effort, integrate with your existing applications, and give new life to your legacy systems.

Table of Contents detailed table of contents



about this book

Part 1 Ruby techniques

1. Ruby under the microscope

1.1. Why Ruby now?

1.2. Ruby by example

1.3. Facets of Ruby

1.4. Metaprogramming

1.5. Summary

2. Testing Ruby

2.1. Testing principles

2.2. Test-driven development with Ruby

2.3. Behavior-driven development with RSpec

2.4. A testing environment

2.5. Testing your tests

2.6. Summary

3. Scripting with Ruby

3.1. Scripting with Ruby

3.2. Automating with OLE and OSA

3.3. Using Rake

3.4. Summary

Part 2 Integration and communication

4. Ruby on Rails techniques

4.1. Extending Rails

4.2. Rails performance

4.3. Summary

5. Web services

5.1. Using HTTP

5.2. REST with Rails

5.3. SOAP services

5.4. Summary

6. Automating communication

6.1. Automating email

6.2. Automating instant communication

6.3. Summary

7. Asynchronous messaging

7.1. Open source messaging servers

7.2. WebSphere MQ

7.3. Summary

8. Deployment

8.1. Creating deployable packages with RubyGems

8.2. Deploying web applications

8.3. Monitoring with God.rb

8.4. Summary

Part 3 Data and document techniques

9. Database facilities and techniques

9.1. Using plain-text files for data persistence

9.2. Using the (g)dbm API

9.3. The MySQL driver

9.4. Using DBI

9.5. Summary

10. Structured documents

10.1. XML in practice

10.2. Parsing HTML and XHTML with Hpricot

10.3. Writing configuration data: revisited

10.4. Reading RSS feeds

10.5. Creating your own feed

10.6. Using YAML for data storage

10.7. Summary

11. Identity and authentication

11.1. Securely storing a password

11.2. Authenticating against Active Directory

11.3. Adding authentication to your Rails application

11.4. Semi-private, personalized feeds

11.5. HTTP Basic Authentication

11.6. Integrating OpenID into your application

11.7. Summary

12. Searching and indexing

12.1. The principles of searching

12.2. Standalone and high-performance searching

12.3. Integrating search with other technologies

12.4. Summary

13. Document processing and reporting

13.1. Processing CSV data

13.2. Generating and emailing daily reports

13.3. Comparing text reports to well-formed data

13.4. Creating customized documents for printing

13.5. Reporting against large datasets

13.6. Summary

Appendix A: Installing Ruby

Appendix B: JRuby

Appendix C: Deploying web apps


What's inside

  • Using Rails to build REST services
  • Automate communication between components and systems
  • Securely store and authenticate passwords
  • Index and query any set of documents
  • Generate scheduled reports in Ruport

About the authors

A consultant, speaker, and author, Jeremy McAnally is a Ruby developer at entp. A co-founder and CTO of Intalio, Assaf Arkin is an open source advocate passionate about building business applications that just work.

eBook $31.99 pdf + ePub + kindle + liveBook

FREE domestic shipping on three or more pBooks

Extremely practical working examples.

Doug Warren, Java Web Services

Stunning examples of how Ruby can be used to save the world from chaos and damnation.

Mark Ryall, ThoughtWorks

A must-read for every Ruby programmer.

Patrick Dennis, Management Dynamics Inc.

Excellent real world examples - not just for practice!

Sheldon Kotyk, TruthMedia Internet Group