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
activesupport requires Ruby version >= 2.2.2 #182
Comments
Do you know off-hand how ActiveSupport is being used? When possible, I prefer that gems keep their dependencies minimal, to avoid potential conflicts when including them. If it's used heavily, that's fine, but if it's only used for a few small functions, I'd suggest removing it. |
You can use this hack to support older rubies... On Aug 3, 2016 3:14 PM, "Jon Moter" notifications@github.com wrote:
|
iirc it is used for things like |
@bdunne @Fryguy I saw that around but that's evaluated at build-time... which means that depending on what Ruby you use, you build a gem with different dependencies. If you build the gem on Ruby < 2.2.2 (and release) then you generate a dependency of If you build on Ruby >= 2.2.2 (and release) then you generate a dependency of
|
Any project that requires Rails 5 can only use Ruby >= 2.2.2 since rails itself requires 2.2.2, so nothing should break. Most projects use bundler, and bundler would protect against your particular error. |
Requiring rails only for pluralization seems an overhead @Fryguy @bdunne @jonmoter do you have any alternative? (I saw the If no alternatives, then only solution is to drop support for Rails < 2.2.2. |
I'm not following why @bdunne's thing doesn't work. |
@Fryguy it would make it travis pass but it's not fixing the issue. |
@Fryguy, to give you more information, with the change: - spec.add_dependency 'activesupport'
+ active_support_version = "< 5" if Gem::Version.new(RUBY_VERSION) <= Gem::Version.new("2.2.2")
+ spec.add_runtime_dependency "activesupport", active_support_version suggested by @bdunne, the conditional is evaluated at gem build-time. When you build with Ruby < 2.2.2:
When you build with Ruby >= 2.2.2:
@Fryguy @bdunne now which one would you release (and why)? |
FYI, I spent a few minutes experimenting with removing the ActiveSupport dependency and seeing what breaks. It appears we use these methods that are in ActiveSupport:
We could just include method definitions for each of those. Or for the first three, just create our own static mapping table for the entity types we support. We have a well-defined set of words we need to deal with here, not arbitrary text. |
@moolitayer in your #181 are you dropping any of the requirements above? (cc @jonmoter) |
#184 is dropping the dependency on activesupport:
Afraid No. A different implementations might do so. We can deal with that later.
appears to be stdlib |
The
activesupport
dependency kubeclient has:is breaking travis jobs for Ruby < 2.2.2 on:
The gem installation on Ruby < 2.2.2 fails as well (when activesupport is not installed yet):
Unless there is a way to have a conditional dependency (
activesupport < 5
for Ruby < 2.2.2) we should probably consider to drop support for Ruby < 2.2.2.Other possible options and workarounds:
activesupport
has any suggestion on how other projects should specify the dependencyactivesupport
cc @zakiva @zeari @moolitayer @abonas @Fryguy @bdunne @jonmoter @jimmidyson
The text was updated successfully, but these errors were encountered: