-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Fix usage of inherited Sinatra::Base classes keyword arguments #1670
Fix usage of inherited Sinatra::Base classes keyword arguments #1670
Conversation
Using keyword arguments on inherited classes from Sinatra::Base breaks with ArgumentError: wrong number of arguments (given X, expected 0). This commit fixes the usage of it on Ruby3 by allowing the method to accept both positional and keyword arguments.
b821d91
to
64347b0
Compare
@duduribeiro Nice! Do you think you could add your example as a test? |
@dentarg yeah!. Will do it and ping you after. Thanks 🍻 |
hey @dentarg, Thanks |
.travis.yml
Outdated
@@ -1,7 +1,7 @@ | |||
--- | |||
language: ruby | |||
|
|||
dist: trusty | |||
dist: xenial |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On trusty rvm is failing to install ruby 3.0.0-preview1, but upgrading to xenial makes the jruby build fails.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should try to get the test suite running on GitHub Actions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dentarg wanna merge this and work on GH actions after? I can work on this in a new PR if I get access on it.
Also, this will be importante because:
https://blog.travis-ci.com/2020-11-02-travis-ci-new-billing
Building on a public repositories only
We love our OSS teams who choose to build and test using TravisCI and we fully want to support that community. However, in recent months we have encountered significant abuse of the intention of this offering (increased activity of cryptocurrency miners, TOR nodes operators etc.). Abusers have been tying up our build queues and causing performance reductions for everyone. In order to bring the rules back to fair playing grounds, we are implementing some changes for our public build repositories.
For those of you who have been building on public repositories (on travis-ci.com, with no paid subscription), we will upgrade you to our trial (free) plan with a 10K credit allotment (which allows around 1000 minutes in a Linux environment).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@duduribeiro I'm not maintainer or collaborator, just a fellow contributor :-) It is @namusyaka or @jkowens that can merge PRs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think Actions should work in your fork of Sinatra, so you can work on it right now if you want
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switching to Github Actions would be 💯
I've worked out the Travis issues. Should be good if you rebase master. Thanks! |
@jkowens thanks! This PR is ready for review now 🍻 |
This looks good to me! @namusyaka can you take a look as well? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks.
Follows the "The Only Correct Way" from https://eregon.me/blog/2021/02/13/correct-delegation-in-ruby-2-27-3.html Related to sinatra#1670 Fixes sinatra#1749
Follows the "The Only Correct Way" from https://eregon.me/blog/2021/02/13/correct-delegation-in-ruby-2-27-3.html Related to #1670 Fixes #1749
Follows the "The Only Correct Way" from https://eregon.me/blog/2021/02/13/correct-delegation-in-ruby-2-27-3.html Related to #1670 Fixes #1749
Closes #1669
Using keyword arguments on inherited classes from Sinatra::Base breaks
with ArgumentError: wrong number of arguments (given X, expected 0) on Ruby 3
This can be reproduced by this minimal example:
app.rb
config.ru
This example works on ruby < 3 but it breaks when using Ruby 3 with:
This commit fixes the usage of it on Ruby3 by allowing the method to
accept both positional and keyword arguments.