What you'll learn
How to Build a Ruby Gem
The book will guide you through the process of how to build a Ruby Gem. From bootstrapping the project to releasing to RubyGems.org, you're only a few steps away from publishing a Ruby gem.
Rails provides a variety of lifecycle hooks to integrate functionality in to the framework, but not all of these hooks are well documented. We'll cover the basics to get you started creating gems that include view helpers, asset inclusions, and shared Active Record scopes.
Open source collaboration
Managing and contributing to an open source project can be complex. This guide will help you manage the expectations and collaboration of a successful open source project.
Whether it's configuration patterns or testing best practices, writing code for a Ruby gem is unique. You'll learn techniques to manage and minimize this complexity for good.
Modular Ruby code
The file conventions used within a Ruby gem are common to well organized Ruby applications. The guide will address best practices related to loading dependencies and testing modular Ruby code.
Increased Understanding of Bundler
Bundler is a powerful gem that allows Ruby developers to easily mananage dependencies. Learn about some lesser known features of Bundler to help you ease the pain of common Ruby gem maintenance tasks.
Build a Ruby gem is an absolute gem! It is a great intro to the open source world and Ruby gem patterns. Both beginner and advanced programmers will learn something new.
I found Build a Ruby Gem to be a really useful resource in understanding how gems work and how best to build them. In particular I thought there was a lot of good "real world tips" to make the process go more smoothly.
Build a Ruby Gem is a well-written and comprehensive book about creating Ruby gems the right way. Brandon's book is the best resource available to strengthen your Ruby Gem foo.
Build a Ruby Gem gave me useful information not only about how to create a gem, but other information like semantic versioning, committing to open source projects and well-structured Ruby code. Without reading this book, I wouldn't have gotten in to building Ruby gems.
- 1 - Introduction
- 2 - Structure
- 3 - Testing
- 4 - Code
- 5 - Release
- 6 - Versioning
- 7 - Changelog
- 8 - Responsibility
- 9 - Loading
- 10 - Command-line Executables
- 11 - Configuration Patterns
- 12 - Rails Hooks
- 13 - Rails View Helpers
- 14 - Rails Controller Includes
- 15 - Rails Model Includes
- 16 - Rails Rake Tasks
- 17 - Rails Generators
- 18 - Rails Engines (sample chapter)
- 19 - Open Source Projects
Everything you need to start building Ruby Gems!
Learn the conventions and best practices of build a Ruby gem and launch your open source career today.
The book is 19 chapters, totaling 125 pages. Its content ranges from how to get started with open source projects to the nitty gritty of configuration patterns in a Ruby gem.
The complete package includes 14 screencasts totaling over 2 hours of video content detailing my workflow. I go through the process of writing the code for each technical chapter and discuss the benefits and downsides to various approaches.
Build a Ruby Gem Screencast Preview
Building Ruby gems is intimidating. It seems impossible to find the right documentation when you need it. Most of the information out there assumes that you already know what you’re doing. And there’s never been a great guide to get started.
Build a Ruby Gem will teach you all of that, in a short, simple, totally approachable guide. It’s the most information about building gems I’ve ever seen in one place, and I can tell I’ll be opening it back up whenever I have a question about a gem I’m building.Even if you’ve been creating gems for years, you’ll *still* learn a ton from Build a Ruby Gem. I certainly did.
I recently ran into an issue at work where we needed to use one of our custom Rails generators in another project. I knew the best way to accomplish this was with a gem, but, I'd never built a gem before and felt pretty intimidated.
While researching how to build a gem, I came across Brandon’s book, "Build a Ruby Gem". Feeling overwhelmed by the task at hand, I took a chance and purchased a copy. It was worth every penny.Brandon's book is clear, well organized, easy to follow and comprehensive. I was able to breeze through the book while following his sample code to build - and publish - my gem in just one day!
What formats do you support?
The book ships with .pdf, .epub and .mobi formats. All screencasts are .mp4.
What if I hate it?
If you feel that strongly, I'm happy to issue a refund within the first 30 days.
Can I read a sample chapter?
Of course! There's one linked above in the chapter list.
You didn't answer my question...