I have a gem (available on RubyGems) that relies on another gem. That dependent gem has a bug which I fixed recently. Unfortunately, that dependent gem is pretty much dead; it hasn't seen an update in years, and the owner isn't active on GitHub anymore at all, let alone making commits to this gem, so I don't expect my patch will get accepted—certainly not any time soon.
In light of that, what's the best way to handle the patched version of this dependent gem? Do I fork it and upload a new gem (with a new name) to RubyGems, and depend on that? Do I package my fixed version with my own gem somehow?
First of all check the bugged gem's LICENSE (and your code's license, too - be sure things stay compatible).
Then - as you stated - you have multiple options:
upstream
variant, embracing Open Source and its community).I'd go with the the fork, fix and re-release solution, but you might have to make clear (in the README) that this gem needs a new maintainer.
It depends on what you mean with "best" (...whats the best way...). Easiest would probably be to monkey-patch, second to include the gem in your repository and tell bundler/Gemfile to pick it up from there. Also, no weird gem update will break your code. But then, if there ever should be fixes (by people like you :) ), you'll miss out on them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With