Skip to content

Fix incorrect required_ruby_version#985

Merged
iliabylich merged 1 commit intowhitequark:masterfrom
Watson1978:required_ruby_version
Jan 6, 2024
Merged

Fix incorrect required_ruby_version#985
iliabylich merged 1 commit intowhitequark:masterfrom
Watson1978:required_ruby_version

Conversation

@Watson1978
Copy link
Contributor

This gem has used String#delete_suffix which was introduced at Ruby 2.5.

delimiter.delete_suffix(@end_delim).bytes.all? { |c| c == SPACE }

Ref. https://github.com/ruby/ruby/blob/ruby_2_5/NEWS

So, even Ruby 2.0 can be installed now, however it will not work.

This gem has used String#delete_suffix which was introduced at Ruby 2.5.
https://github.com/whitequark/parser/blob/95d26953ebe823211845fb84cb93c18cd501f561/lib/parser/lexer/literal.rb#L250

Ref. https://github.com/ruby/ruby/blob/ruby_2_5/NEWS

So, even Ruby 2.0 can be installed now, however it will not work.
@iliabylich iliabylich merged commit 3f2bbef into whitequark:master Jan 6, 2024
@iliabylich
Copy link
Collaborator

Thanks!

@Watson1978 Watson1978 deleted the required_ruby_version branch January 6, 2024 17:36
koic added a commit to koic/parser that referenced this pull request Jan 6, 2024
This is an alternative approach to the changes in whitequark#985.
The Parser gem may be required to operate across as many Ruby versions as possible.
The use of `delete_suffix` starts from Parser version 3.3.0.0.
Therefore, by replacing `delete_suffix` with `sub`, and releasing Parser 3.3.0.1,
supporting Ruby 2.0 would be feasible.
@koic koic mentioned this pull request Jan 6, 2024
iliabylich pushed a commit that referenced this pull request Jan 6, 2024
This is an alternative approach to the changes in #985.
The Parser gem may be required to operate across as many Ruby versions as possible.
The use of `delete_suffix` starts from Parser version 3.3.0.0.
Therefore, by replacing `delete_suffix` with `sub`, and releasing Parser 3.3.0.1,
supporting Ruby 2.0 would be feasible.
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