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

Support Ruby >= 2.0.0 #54

Merged
merged 14 commits into from
Aug 11, 2022
Merged

Support Ruby >= 2.0.0 #54

merged 14 commits into from
Aug 11, 2022

Conversation

arielj
Copy link

@arielj arielj commented Jul 5, 2022

This PR adds support for older Ruby 2 versions.

Things I changed:

  • added explicit default values for keyword arguments (implicit values not supported in older rubies)
  • limit rexml version, newer versions use implicit default values for keywords arguments (related to the previous change)
  • use the <<- heredoc syntax instead of <<~, the ~ version didn't exist in older rubies (since what it does is remove the indentation, I removed the indentation in the code instead)
  • use Object.extend if Object.prepend is not a valid method, it was added in Ruby 2.1.10 https://apidock.com/ruby/v2_1_10/Module/prepend
  • replace a call to Array#to_h, since that method was added in Ruby 2.1.10 https://apidock.com/ruby/v2_1_10/Array/to_h
  • configured the github actions to run the tests with more Ruby versions

I tried to add support for ruby 1.9.3 but it requires rewriting methods because the ruby2 keyword arguments syntax is not valid. Adding this for reference https://bugs.ruby-lang.org/issues/7664

@arielj arielj added the wip label Jul 5, 2022
@arielj arielj requested a review from a team as a code owner July 5, 2022 16:00
@arielj arielj requested review from bronzdoc and lubc and removed request for a team July 5, 2022 16:00
@arielj arielj changed the title (WIP) Support older rubies Support Ruby >= 2.0.0 Jul 5, 2022
@arielj arielj linked an issue Jul 5, 2022 that may be closed by this pull request
@arielj arielj removed the wip label Jul 5, 2022
@kindoflew
Copy link

hello @aisayo! welcome to your first OSS request for review!

whenever you have a moment, could you review this PR (you can log it under the Open Source project in Noko and it will count towards your monthly OSS goal!)

thanks!

@kindoflew kindoflew requested a review from aisayo July 8, 2022 20:44
@kindoflew
Copy link

ping @aisayo 😃

@bronzdoc
Copy link

@arielj can you rebase the changelog

@kindoflew kindoflew merged commit f50f467 into main Aug 11, 2022
@kindoflew kindoflew deleted the support-older-rubies branch August 11, 2022 18:12
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.

[REQUEST] Make next_rails compatible with older ruby versions
5 participants