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

Hacking on Gems - A GitHub-Oriented Workflow

Hacking on Gems - A GitHub-Oriented Workflow

There are a lot of really interesting and useful gems out there, and they are part of what makes working in Ruby so enjoyable. Every now and then, however, you can run into a bug or a missing feature in a gem that you are using, and it's important to know how you can help yourself and the community by contributing back a bug fix or a feature to the gem. This is a simple example workflow that demonstrates how to do that, in a context where the gem project is hosted publicly on GitHub.

Evgeny Rahman

July 17, 2013
Tweet

More Decks by Evgeny Rahman

Other Decks in Programming

Transcript

  1. ABOUT ME • Developer • Curious but lazy • Hate

    getting stuck t & g: evgenyrahman
  2. USING GEMS • Somebody solved part of your problem •

    Easy to get / easy to install • Ruby community is great • RubyGems.org
  3. POSSIBLE PROBLEMS • Gem is broken for your environment •

    Bug in gem breaks your code • Missing feature
  4. WHAT NOW? • The gem’s source is on GitHub (hooray!)

    • You have a GitHub account (yay!) • Fork the repo • git clone <repo-url>
  5. DO WORK • git checkout -b <new-branch> • Add the

    fix/feature/docs • Make sure to add tests • Make sure all tests pass! • Don’t bump version! • Commit and push to forked repo
  6. PULL REQUEST • Contact gem author/maintainer • Create a pull

    request on the gem’s repo • Point to <new-branch> on your repo • Be descriptive in pull request • Issue created automatically
  7. DREAMS DO COME TRUE! • Pull Request is accepted and

    merged • New version of gem is published • ??? • Profit! (Fame?)
  8. WHAT IF? • Host your forked gems • Monkeypatch in

    application • But it’s better to contribute