How do you write truly elegant code with Ruby? Ruby Best Practices is for programmers who want to use Ruby as experienced Rubyists do. Written by the developer of the Ruby project Prawn, this concise book explains how to design beautiful APIs and domain-specific languages with Ruby, as well as how to work with functional programming ideas and techniques that can simplify your code and make you more productive. You'll learn how to write code that's readable, expressive, and much more. Ruby Best Practices will help you: Understand the secret powers unlocked by Ruby's code blocks Learn how to…mehr
How do you write truly elegant code with Ruby? Ruby Best Practices is for programmers who want to use Ruby as experienced Rubyists do. Written by the developer of the Ruby project Prawn, this concise book explains how to design beautiful APIs and domain-specific languages with Ruby, as well as how to work with functional programming ideas and techniques that can simplify your code and make you more productive. You'll learn how to write code that's readable, expressive, and much more. Ruby Best Practices will help you: Understand the secret powers unlocked by Ruby's code blocks Learn how to bend Ruby code without breaking it, such as mixing in modules on the fly Discover the ins and outs of testing and debugging, and how to design for testability Learn to write faster code by keeping things simple Develop strategies for text processing and file management, including regular expressions Understand how and why things can go wrong Reduce cultural barriers by leveraging Ruby's multilingual capabilities This book also offers you comprehensive chapters on driving code through tests, designing APIs, and project maintenance. Learn how to make the most of this rich, beautiful language with Ruby Best Practices.Hinweis: Dieser Artikel kann nur an eine deutsche Lieferadresse ausgeliefert werden.
Gregory T. Brown is a New Haven, CT based Rubyist who spends most of his time on free software projects in Ruby. His main projects are Prawn and Ruport, and he is also the author of the upcoming book Ruby Best Practices. He also is in possession of a small bamboo plant that seems to be invincible, and he is quite proud of this accomplishment.
Inhaltsangabe
Inhaltsverzeichnis Chapter 1 Driving Code Through Tests A Quick Note on Testing Frameworks Designing for Testability Testing Fundamentals Advanced Testing Techniques Keeping Things Organized Conclusions Chapter 2 Designing Beautiful APIs Designing for Convenience: Ruport s Table() feature Ruby s Secret Power: Flexible Argument Processing Ruby s Other Secret Power: Code Blocks Avoiding Surprises Conclusions Chapter 3 Mastering the Dynamic Toolkit BlankSlate: A BasicObject on Steroids Building Flexible Interfaces Implementing Per-Object Behavior Extending and Modifying Preexisting Code Building Classes and Modules Programmatically Registering Hooks and Callbacks Conclusions Chapter 4 Text Processing and File Management Line-Based File Processing with State Tracking Regular Expressions Working with Files The tempfile Standard Library Text-Processing Strategies Conclusions Chapter 5 Functional Programming Techniques Laziness Can Be a Virtue (A Look at lazy.rb) Minimizing Mutable State and Reducing Side Effects Modular Code Organization Memoization Infinite Lists Higher-Order Procedures Conclusions Chapter 6 When Things Go Wrong A Process for Debugging Ruby Code Capturing the Essence of a Defect Scrutinizing Your Code Working with Logger Conclusions Chapter 7 Reducing Cultural Barriers m17n by Example: A Look at Ruby s CSV Standard Library Portable m17n Through UTF-8 Transcoding m17n in Standalone Scripts m17n-Safe Low-Level Text Processing Localizing Your Code Conclusions Chapter 8 Skillful Project Maintenance Exploring a Well-Organized Ruby Project (Haml) Conventions to Know About API Documentation via RDoc The RubyGems Package Manager Rake: Ruby s Built-in Build Utility Conclusions Appendix Writing Backward-Compatible Code Avoiding a Mess Nonportable Features in Ruby 1.9 Workarounds for Common Issues Conclusions Appendix Leveraging Ruby s Standard Library Why Do We Need a Standard Library? Pretty-Printer for Ruby Objects (pp) Working with HTTP and FTP (open-uri) Working with Dates and Times (date) Lexical Parsing with Regular Expressions (strscan) Cryptographic Hash Functions (digest) Mathematical Ruby Scripts (mathn) Working with Tabular Data (csv) Transactional Filesystem-Based Data Storage (pstore) Human-Readable Data Serialization (json) Embedded Ruby for Code Generation (erb) Conclusions Appendix Ruby Worst Practices Not-So-Intelligent Design The Downside of Cleverness Conclusions Colophon
Inhaltsverzeichnis Chapter 1 Driving Code Through Tests A Quick Note on Testing Frameworks Designing for Testability Testing Fundamentals Advanced Testing Techniques Keeping Things Organized Conclusions Chapter 2 Designing Beautiful APIs Designing for Convenience: Ruport s Table() feature Ruby s Secret Power: Flexible Argument Processing Ruby s Other Secret Power: Code Blocks Avoiding Surprises Conclusions Chapter 3 Mastering the Dynamic Toolkit BlankSlate: A BasicObject on Steroids Building Flexible Interfaces Implementing Per-Object Behavior Extending and Modifying Preexisting Code Building Classes and Modules Programmatically Registering Hooks and Callbacks Conclusions Chapter 4 Text Processing and File Management Line-Based File Processing with State Tracking Regular Expressions Working with Files The tempfile Standard Library Text-Processing Strategies Conclusions Chapter 5 Functional Programming Techniques Laziness Can Be a Virtue (A Look at lazy.rb) Minimizing Mutable State and Reducing Side Effects Modular Code Organization Memoization Infinite Lists Higher-Order Procedures Conclusions Chapter 6 When Things Go Wrong A Process for Debugging Ruby Code Capturing the Essence of a Defect Scrutinizing Your Code Working with Logger Conclusions Chapter 7 Reducing Cultural Barriers m17n by Example: A Look at Ruby s CSV Standard Library Portable m17n Through UTF-8 Transcoding m17n in Standalone Scripts m17n-Safe Low-Level Text Processing Localizing Your Code Conclusions Chapter 8 Skillful Project Maintenance Exploring a Well-Organized Ruby Project (Haml) Conventions to Know About API Documentation via RDoc The RubyGems Package Manager Rake: Ruby s Built-in Build Utility Conclusions Appendix Writing Backward-Compatible Code Avoiding a Mess Nonportable Features in Ruby 1.9 Workarounds for Common Issues Conclusions Appendix Leveraging Ruby s Standard Library Why Do We Need a Standard Library? Pretty-Printer for Ruby Objects (pp) Working with HTTP and FTP (open-uri) Working with Dates and Times (date) Lexical Parsing with Regular Expressions (strscan) Cryptographic Hash Functions (digest) Mathematical Ruby Scripts (mathn) Working with Tabular Data (csv) Transactional Filesystem-Based Data Storage (pstore) Human-Readable Data Serialization (json) Embedded Ruby for Code Generation (erb) Conclusions Appendix Ruby Worst Practices Not-So-Intelligent Design The Downside of Cleverness Conclusions Colophon
Es gelten unsere Allgemeinen Geschäftsbedingungen: www.buecher.de/agb
Impressum
www.buecher.de ist ein Internetauftritt der buecher.de internetstores GmbH
Geschäftsführung: Monica Sawhney | Roland Kölbl | Günter Hilger
Sitz der Gesellschaft: Batheyer Straße 115 - 117, 58099 Hagen
Postanschrift: Bürgermeister-Wegele-Str. 12, 86167 Augsburg
Amtsgericht Hagen HRB 13257
Steuernummer: 321/5800/1497
USt-IdNr: DE450055826