Open ioquatix opened 7 years ago
PR's welcome! :)
On Tue, May 16, 2017 at 8:22 PM, Samuel Williams notifications@github.com 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 https://github.com/rdp/os/issues/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.
This 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.
In a version split a project's dependencies either need to all be updated to work with v.<next>
, or they all have to remain stuck at v.<current>
(forever). Many dependencies are not being maintained any more which has resulted in a great deal of effort expended on the part of too few people.
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.
As an outside observer who has never before interacted with it, or even used it...
OS::VERSION
constantspec.required_ruby_version
in gemspecRakefile
# HOW TO DEPLOY
# bump VERSION file manually
# rake release
# Don't forget to run rake gemspec with each release! ... I think...or rake release might be same thing
# then manually edit os.gemspec remove duplicatee rspecs, circular dependency on os? HUH?
# # then gem build os.gemspec
# rake build doesn't work???
# sooo...
# ...gem push os-1.1.2.gem
bundle install
:❯ bundle install
Fetching bundler 2.1.4
Installing bundler 2.1.4
Fetching gem metadata from http://rubygems.org/.......
Resolving dependencies...
Your bundle requires gems that depend on each other, creating an infinite loop. Please remove gem 'os' and try again.
..................F..F..............
Failures:
1) OS has working cpu count method Failure/Error: assert (cpu_count & (cpu_count - 1)) == 0 # CPU count is normally a power of 2 Test::Unit::AssertionFailedError:
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 oauth2
gem, and I ended up having to remove danger
in order to support faraday v2. oauth2
has a huge reverse dependency tree as well. It was a mess.
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.