-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Top level should be module not class #27
Comments
PR's welcome! :)
…On Tue, May 16, 2017 at 8:22 PM, Samuel Williams ***@***.***> wrote:
Hello
The top level of your gem should be a module, not a class, to follow
standard conventions.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#27>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAw0MlLKM1QEg04XGMkj5c5e6t-kC1iks5r6lnMgaJpZM4NdS_l>
.
|
@ioquatix is correct, a class at the top-level can cause a number of problems, and is against standard convention for good reasons. I've made the mistake before, and vowed never to repeat it. Reverse DependenciesThis gem has many reverse dependencies, totalling hundreds of millions of downloads, and, given the nature of software, many of those mature, stable packages would have little reason to be updated other than to pull in a major version upgrade to this gem. This gem should not make a change from top-level class to top-level module without a major version bump, as it would be an "incompatible API change" IMO. If it were to happen it would result in "chained upgrade hell", fracturing the Ruby ecosystem a bit like is happening right now between Faraday v1 and Faraday v2. A Version Split?In a version split a project's dependencies either need to all be updated to work with As a taste of why a version split outcome is undesireable, here are some projects affected by the Faraday version split: elasticsearch, discourse, oauth2, danger, and all their dependencies. Danger, used by thousands of projects, is at risk, as many major projects are removing it so they can upgrade to Faraday 2, including Github's oktokit and Slack's ruby client. What is the state of this library?As an outside observer who has never before interacted with it, or even used it...
Path ForwardGiven the state of this library overall I think the best route forward would be to create a new gem with the same API and funtionality, but with a new name and namespace, so that unmaintained libraries that rely on To that end, I have forked this library, renamed the fork, and will soon release a new gem called Because it will be a new gem and a new namespace, the two gems can be used side by side with no problems! No one is forced to upgrade anything, and the ecosystem remains intact! Prior to making the fork forky though (the namespace change) I'll do upgrades that I can PR upstream to this repo, so they both benefit! I will upstream fixes for:
Q & AQuestion: Why am I doing this if I have never before used this library?
Question: Why
Interested to hear what @rdp thinks about all this. |
I think forking should almost always be a last resort. |
I normally agree, but in this case it might be quite disruptive to fix the top-level namespace. What I've been dealing with on the faraday version split is real bad. I maintain the On the other hand, when factory_girl became factory_bot, a hard fork, it was easy. |
Yeah fair enough. |
I'd be happy to PR the hard fork (by which I mean a namespace change and gem name change) into this repo if @rdp agrees to change both. Then it would be just like the factory_girl/bot rename. Alternatively, or in addition, would be happy to take over maintenance. |
Hello
The top level of your gem should be a module, not a class, to follow standard conventions.
The text was updated successfully, but these errors were encountered: