This page is a collection of links to documentation, articles, books, and libraries related to Ruby and Rails.
- Ruby guides, tutorials, and reference material
- Rails guides
- The Rails doctrine
- How to make a gem
- RubyGems .gemspec reference
Articles
Books
- Design Patterns in Ruby
- This book covers the 14 most relevant Gang of Four design patterns for Ruby programmers. I haven’t finished reading it yet.
- Metaprogramming Ruby
- If you’ve seen things like
class << self
in your codebase and aren’t sure what that means, you should probably read this. It covers stuff like the Ruby object model, scope flattening, closures, ghost methods, and many more somewhat advanced topics.
- If you’ve seen things like
- Practical Object-Oriented Design: An Agile Primer Using Ruby
- This book improved the way I think about object-oriented programming. The focus is on the messages between objects, minimizing dependencies and coupling, and how to design code that won’t be painful to extend in the future. It includes many UML sequence diagrams, which I thought was interesting.
- Modern Front-End Development for Rails: Hotwire, Stimulus, Turbo, and React (1st Edition)
- As a primarily backend web developer, I read this to learn about Hotwire. This book delivered on that and then some (I learned a fair bit about React too). I also haven’t finished reading this one.
- Rails Anti-patterns
- This book covers a wide range of Rails anti-patterns using Rails 3, with explanations of what to do instead.
- The RSpec Book
- A nice introduction to RSpec, BDD, Cucumber, and other tools for testing. Some of the syntax may be outdated, but it’s still worth reading in general.
- Service-Oriented Design with Ruby and Rails
- If you’re working on a Rails monolith and dream of smaller code bases, you may find this book interesting. I probably wouldn’t try to break up a monolith into services without first going back to this book.
Libraries
- fuubar
- Adds an option to
rspec
that formats the test output with a progress bar and gives fast feedback.
- Adds an option to
- jekyll
- The static code generator used to build the website you are looking at.
- rdoc
- Extracts documentation from comments. Also see sdoc.
- rubocop
- Code linter for Ruby.
- There are extensions to RuboCop that add additional cops to enforce good practices for specific libraries, performance concerns, and other things:
- rubyzip
- Zip and unzip files with Ruby.
- simplecov
- Measure your tests by lines of code or branches covered.
- sqlite3
- Use Ruby with SQlite3 databases.