Skip to content
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

Using RUBY_VERSION in a gemspec doesn't work #79

Open
ekohl opened this issue Mar 15, 2019 · 2 comments
Open

Using RUBY_VERSION in a gemspec doesn't work #79

ekohl opened this issue Mar 15, 2019 · 2 comments

Comments

@ekohl
Copy link
Contributor

ekohl commented Mar 15, 2019

Currently there's the following code in the gemspec:

if RUBY_VERSION < "2.3"
spec.add_development_dependency "ruby_dep", "~> 1.3.1"
spec.add_development_dependency "listen", "~> 3.0.8"
else
spec.add_development_dependency "listen", "~> 3.1"
end

This doesn't work because gemspecs evaluate tot static content. This means it's evaluated only when gem build is called. That Ruby version used there determines the actual resulting gem dependencies.

I'm not aware of any method to do this more dynamically for users.

@kamui
Copy link
Owner

kamui commented Jan 11, 2020

Hm, maybe I should freeze a specific version to <= 2.3 and have the current version only support 2.3+. 2.3 is pretty old at this point.

@ekohl
Copy link
Contributor Author

ekohl commented Feb 20, 2020

I agree that at this point it'd be safe to make it 2.3+.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants