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

Ruby 2.7 support #167

Closed
mirelon opened this issue Mar 14, 2020 · 3 comments · Fixed by #202
Closed

Ruby 2.7 support #167

mirelon opened this issue Mar 14, 2020 · 3 comments · Fixed by #202

Comments

@mirelon
Copy link

mirelon commented Mar 14, 2020

I see the branch https://github.com/activeadmin/arbre/tree/ruby27_warnings
to suppress ruby 2.7 warnings,
but isn't it worth adding support for ruby 2.7 (and following 3.0?)

By adding a new syntax
helpers.send(...) instead of helpers.send(name, *args, &block) here: https://github.com/activeadmin/arbre/blob/master/lib/arbre/element.rb#L181

Is a branch for 2.7 a good idea? Because it won't be compatible with 2.6...

@deivid-rodriguez
Copy link
Member

I've seen warnings in that same place but I wasn't planning to use a ruby 2.7 specific syntax to fix it. I think it can be fixed in a backwards compatible way.

Other than that warning, arbre works fine on ruby 2.7, right?

@mirelon
Copy link
Author

mirelon commented Mar 14, 2020

Yeah, it works fine. I agree with backward-compatible (probably with ruby2_keywords gem: https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/#a-compatible-delegation)

@deivid-rodriguez
Copy link
Member

Yeah, ruby2_keywords could be an option, but it looks really ugly to me, honestly.

I think I would prefer a more verbose and less DRY alternative like:

if RUBY_VERSION >= "2.7"
  # current code adapted to keyword separation
else
  # current code
end

If that would work.

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 a pull request may close this issue.

2 participants