Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Pluck It: Extracting Micro-libraries into RubyGems

Pluck It: Extracting Micro-libraries into RubyGems

How many times have you written the same bits of code, over and over, and thought, “You know, if only this was big enough to be a gem, I would pluck it out." Often, we think of a RubyGem as a larger library of code that we “bolt on” to an app. And, these smaller code blobs become a hassle to distribute to the multiple apps that use them.

A small micro-library, done the right way, at the right time, can greatly improve an app.

But, when can you benefit from extracting a micro-library? And, how do you build and publish that code into a RubyGem? I'll go through the process, from A to Z.

Adam Cuppy (he/him)

November 15, 2015
Tweet

More Decks by Adam Cuppy (he/him)

Other Decks in Programming

Transcript

  1. 1. Modify code 2. Increment VERSION constant 3. Rebuild gem

    4. Publish new version 5. Update apps: $ cd /path/to/app; bundle update my_gem New Release
  2. It’s when the cost of maintaining an internal library, exceeds

    the cost of maintaining an external dependency.