/Polished-Ruby-Programming

Polished Ruby Programming, published by Packt

Primary LanguageRubyMIT LicenseMIT

Polished Ruby Programming

Polished Ruby Programming

This is the code repository for Polished Ruby Programming, published by Packt.

Build better software with more intuitive, maintainable, scalable, and high-performance Ruby code

What is this book about?

The most successful apps become more difficult to maintain over time as the codebase increases in size. Often, the source code reaches a point where a rewrite is required because the application can no longer be effectively maintained. Ruby allows you to enjoy programming by making it as simple as possible to build maintainable and scalable apps. Polished Ruby Programming provides you with recommendations and advice for designing Ruby programs that are easy to maintain in the long-term.

This book covers the following exciting features:

  • Use Ruby's core classes and design custom classes effectively
  • Explore the principles behind variable usage and method argument choice
  • Implement advanced error handling approaches such as exponential backoff
  • Design extensible libraries and plugin systems in Ruby
  • Use metaprogramming and DSLs to avoid code redundancy
  • Implement different approaches to testing and understand their trade-offs
  • Discover design patterns, refactoring, and optimization with Ruby
  • Explore database design principles and advanced web app security

If you feel this book is for you, get your copy today!

https://www.packtpub.com/

Instructions and Navigations

All of the code is organized into folders. For example, Chapter02.

The code will look like the following:

class Foo
  def self.bar
    :baz
  end
end

Following is what you need for this book: If you already know how to program in Ruby and want to learn more about the principles and best practices behind writing maintainable, scalable, optimized, and well-structured Ruby code, then this Ruby book is for you. Intermediate to advanced-level working knowledge of the Ruby programming language is expected to get the most out of this book.

With the following software and hardware list you can run all code files present in the book (Chapter 1-17).

Software and Hardware List

Chapter Software required OS required
1-17 Ruby 3.0 Any OS that runs Ruby

Errata

  • Page 34: The sentence "If the method starts with the double underscore and is not already defined, someone is trying to override the aliased methods, so you can overwrite the aliased method by aliasing the original method again:" must be read as "If the method that was added starts with the double underscore, and the related method without the double underscore is already defined, someone is trying to override the aliased methods, so you can overwrite the aliased method by aliasing the original method again:"

  • Page 34: The sentence "If the method doesn't start with the double underscore and is already defined, you can fix the issue by aliasing the aliased method back to the original method:" can also be read as "If the method that was added doesn't start with the double underscore, and the related method with the double underscore is already defined, you can fix the issue by aliasing the aliased method back to the original method:"

Related products

Get to Know the Author

Jeremy Evans is a Ruby committer who focuses on fixing bugs in Ruby, as well as improving the implementation of Ruby. He is the maintainer of many popular Ruby libraries, including the fastest web framework (Roda) and fastest database library (Sequel). His libraries are known not just for their performance, but also for their code quality, understandability, documentation, and how quickly any bugs found are fixed. For his contributions to Ruby and the Ruby community, he has received multiple awards, such as receiving the prestigious RubyPrize in 2020 and being chosen as a Ruby Hero in 2015. He has given presentations at over 20 Ruby conferences. In addition to working on Ruby, he is also a committer for the OpenBSD operating system.