Skip to content

Refactor mkmf with safe navigation operator and split with block#4

Open
Maumagnaguagno wants to merge 2 commits intoruby:masterfrom
Maumagnaguagno:refactor-mkmf
Open

Refactor mkmf with safe navigation operator and split with block#4
Maumagnaguagno wants to merge 2 commits intoruby:masterfrom
Maumagnaguagno:refactor-mkmf

Conversation

@Maumagnaguagno
Copy link
Copy Markdown

With safe navigation operator (Ruby 2.3) and split with block (Ruby 2.6) it is possible to avoid the intermediate variable opt and array created by split, resulting in a more compact and clear code for the mkmf method.

With safe navigation operator (Ruby 2.3) and split with block (Ruby 2.6) it is possible to avoid the intermediate variable ``opt``and array created by split, resulting in a more compact and clear code for the mkmf method.
@Maumagnaguagno
Copy link
Copy Markdown
Author

Maumagnaguagno commented Jun 14, 2022

I just noticed that the un.gemspec contains Ruby version >= 2.3.0, while String#delete_prefix! (Ruby 2.5) is used in the setup method since d96a5e5.

Should I open a new PR to update to Ruby 2.5 to fix this first, or could the current PR with an updated Gemspec to Ruby 2.6 be enough?
EDIT: I just bumped the required Ruby version to 2.6.

@Maumagnaguagno
Copy link
Copy Markdown
Author

irb just dropped Ruby 2.5 support, ruby/irb#383, while un still uses 2.3 in the un.gemspec, despite using new Ruby 2.5 String methods.
This PR bumps the requirements to Ruby 2.6, which already reached EOL.

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