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

Fix gemspec ruby version checks #259

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kurioscreative
Copy link

  • Fixed the logic in the gemspec file to correctly compare the current Ruby version with the required version.
  • Replaced string comparison of RUBY_VERSION with Gem::Version for better semantic version handling.
  • Addressed edge cases, such as "3.10" being greater than "3.2".
  • Adds flexibility for the syntax_suggest gem version to allow 2.x for Ruby 3.0 & 3.1 (related: Syntax suggest in gemspec #258)

Why:
The previous comparison caused a LoadError for syntax_suggest on Ruby 3.1.6 due to string-based version comparison. RUBY_VERSION returns a string, not a comparable version, breaking the current comparison in some cases.

- Fixed the logic in the gemspec file to correctly compare the current Ruby version with the required version.
- Replaced string comparison of `RUBY_VERSION` with `Gem::Version` for better semantic version handling.
- Addressed edge cases, such as "3.10" being greater than "3.2".

Why:
The previous comparison caused a `LoadError` for `syntax_suggest` on Ruby 3.1.6 due to incorrect string-based version comparison. RUBY_VERSION returns a string, not a comparable version, breaking the current comparison in some cases.
- `”syntax_suggest", "~> 1.1.0"`  to `”syntax_suggest", ">= 1.1.0"` in the gemspec

Why:
Allows greater flexibility for users by supporting newer versions of `syntax_suggest` beyond the `1.x` range, especially as 2.x requires ruby >= 3.0
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

Successfully merging this pull request may close these issues.

1 participant