Skip to content

Fix gemspec ruby version checks#259

Merged
pcai merged 2 commits intozombocom:mainfrom
kurioscreative:fix/gemspec-ruby-version-checks
Jan 1, 2025
Merged

Fix gemspec ruby version checks#259
pcai merged 2 commits intozombocom:mainfrom
kurioscreative:fix/gemspec-ruby-version-checks

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