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

Merged
merged 2 commits into from
Jan 1, 2025

Conversation

kurioscreative
Copy link
Contributor

  • 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
@pcai
Copy link
Contributor

pcai commented Jan 1, 2025

Thanks! I appreciate the detailed notes. I'm going accept this - the ruby/rails_head test failure is already addressed in main

@pcai pcai merged commit 128b662 into zombocom:main Jan 1, 2025
32 of 34 checks passed
@pcai pcai mentioned this pull request Jan 1, 2025
pcai added a commit that referenced this pull request Jan 1, 2025
pcai added a commit that referenced this pull request Jan 1, 2025
pcai added a commit that referenced this pull request Jan 1, 2025
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.

2 participants